1 { lib, stdenv, fetchFromGitHub, qtbase, qmake, qtwebsockets, minizinc, makeWrapper, Cocoa }:
4 executableLoc = if stdenv.isDarwin then "$out/Applications/MiniZincIDE.app/Contents/MacOS/MiniZincIDE" else "$out/bin/MiniZincIDE";
6 stdenv.mkDerivation rec {
7 pname = "minizinc-ide";
10 src = fetchFromGitHub {
14 hash = "sha256-/x4mWjAk24s6Ax22Q15WUPLLwm7YrzwaoMIINjQr5zU=";
15 fetchSubmodules = true;
18 nativeBuildInputs = [ qmake makeWrapper ];
19 buildInputs = [ qtbase qtwebsockets ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
21 sourceRoot = "${src.name}/MiniZincIDE";
23 dontWrapQtApps = true;
25 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
26 mkdir -p $out/Applications
27 mv $out/bin/MiniZincIDE.app $out/Applications/
29 wrapProgram ${executableLoc} \
30 --prefix PATH ":" ${lib.makeBinPath [ minizinc ]} \
31 --set QT_QPA_PLATFORM_PLUGIN_PATH "${qtbase}/lib/qt-6/plugins/platforms"
35 homepage = "https://www.minizinc.org/";
36 description = "IDE for MiniZinc, a medium-level constraint modelling language";
37 mainProgram = "MiniZincIDE";
39 MiniZinc is a medium-level constraint modelling
40 language. It is high-level enough to express most
41 constraint problems easily, but low-level enough
42 that it can be mapped onto existing solvers easily and consistently.
43 It is a subset of the higher-level language Zinc.
45 license = licenses.mpl20;
46 platforms = platforms.unix;
47 maintainers = [ maintainers.dtzWill ];