2024-02-07 01:22:34 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, qtbase, qmake, qtwebsockets, minizinc, makeWrapper, Cocoa }:
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
let
|
|
|
|
executableLoc = if stdenv.isDarwin then "$out/Applications/MiniZincIDE.app/Contents/MacOS/MiniZincIDE" else "$out/bin/MiniZincIDE";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "minizinc-ide";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "2.8.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MiniZinc";
|
|
|
|
repo = "MiniZincIDE";
|
|
|
|
rev = version;
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-ljOtY4k0uQwb8YPH14DspofjY7kMMBu4QJ7MABYfIpA=";
|
2021-02-13 14:23:35 +00:00
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
nativeBuildInputs = [ qmake makeWrapper ];
|
|
|
|
buildInputs = [ qtbase qtwebsockets ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${src.name}/MiniZincIDE";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontWrapQtApps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv $out/bin/MiniZincIDE.app $out/Applications/
|
|
|
|
'' + ''
|
|
|
|
wrapProgram ${executableLoc} \
|
|
|
|
--prefix PATH ":" ${lib.makeBinPath [ minizinc ]} \
|
|
|
|
--set QT_QPA_PLATFORM_PLUGIN_PATH "${qtbase}/lib/qt-6/plugins/platforms"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.minizinc.org/";
|
|
|
|
description = "IDE for MiniZinc, a medium-level constraint modelling language";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "MiniZincIDE";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
MiniZinc is a medium-level constraint modelling
|
|
|
|
language. It is high-level enough to express most
|
|
|
|
constraint problems easily, but low-level enough
|
|
|
|
that it can be mapped onto existing solvers easily and consistently.
|
|
|
|
It is a subset of the higher-level language Zinc.
|
|
|
|
'';
|
|
|
|
license = licenses.mpl20;
|
2024-02-07 01:22:34 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.dtzWill ];
|
|
|
|
};
|
|
|
|
}
|