nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 callPackage,
6 jq,
7 cmake,
8 flex,
9 bison,
10 gecode,
11 mpfr,
12 cbc,
13 zlib,
14}:
15
16let
17 gecode_6_3_0 = gecode.overrideAttrs (_: {
18 version = "6.3.0";
19 src = fetchFromGitHub {
20 owner = "gecode";
21 repo = "gecode";
22 rev = "f7f0d7c273d6844698f01cec8229ebe0b66a016a";
23 hash = "sha256-skf2JEtNkRqEwfHb44WjDGedSygxVuqUixskTozi/5k=";
24 };
25 patches = [ ];
26 });
27in
28let
29 gecode = gecode_6_3_0;
30in
31
32stdenv.mkDerivation (finalAttrs: {
33 pname = "minizinc";
34 version = "2.9.3";
35
36 src = fetchFromGitHub {
37 owner = "MiniZinc";
38 repo = "libminizinc";
39 rev = finalAttrs.version;
40 sha256 = "sha256-eu2yNRESypXWCn8INTjGwwRXTWdGYvah/hc2iqFKQmw=";
41 };
42
43 nativeBuildInputs = [
44 bison
45 cmake
46 flex
47 jq
48 ];
49
50 buildInputs = [
51 gecode
52 mpfr
53 cbc
54 zlib
55 ];
56
57 postInstall = ''
58 mkdir -p $out/share/minizinc/solvers/
59 jq \
60 '.version = "${gecode.version}"
61 | .mznlib = "${gecode}/share/minizinc/gecode/"
62 | .executable = "${gecode}/bin/fzn-gecode"' \
63 ${./gecode.msc} \
64 >$out/share/minizinc/solvers/gecode.msc
65 '';
66
67 passthru.tests = {
68 simple = callPackage ./simple-test { };
69 };
70
71 meta = {
72 homepage = "https://www.minizinc.org/";
73 description = "Medium-level constraint modelling language";
74 longDescription = ''
75 MiniZinc is a medium-level constraint modelling
76 language. It is high-level enough to express most
77 constraint problems easily, but low-level enough
78 that it can be mapped onto existing solvers easily and consistently.
79 It is a subset of the higher-level language Zinc.
80 '';
81 license = lib.licenses.mpl20;
82 platforms = lib.platforms.unix;
83 maintainers = [ ];
84 };
85})