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