1{ lib
2, stdenv
3, fetchurl
4, fetchpatch
5, perl
6}:
7
8stdenv.mkDerivation rec {
9 pname = "gecode";
10 version = "3.7.3";
11
12 src = fetchurl {
13 url = "http://www.gecode.org/download/${pname}-${version}.tar.gz";
14 sha256 = "0k45jas6p3cyldgyir1314ja3174sayn2h2ly3z9b4dl3368pk77";
15 };
16
17 patches = [
18 (import ./fix-const-weights-clang-patch.nix fetchpatch)
19 ];
20
21 postPatch = ''
22 substituteInPlace gecode/flatzinc/lexer.yy.cpp \
23 --replace "register " ""
24 '';
25
26 nativeBuildInputs = [ perl ];
27
28 preConfigure = "patchShebangs configure";
29
30 env.CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++14";
31
32 meta = with lib; {
33 license = licenses.mit;
34 homepage = "https://www.gecode.org";
35 description = "Toolkit for developing constraint-based systems";
36 platforms = platforms.all;
37 maintainers = [ maintainers.manveru ];
38 };
39}