nixpkgs/pkgs/development/tools/minizinc/ide.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

72 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
qtbase,
qmake,
qtwebsockets,
minizinc,
makeWrapper,
Cocoa,
}:
let
executableLoc =
if stdenv.hostPlatform.isDarwin then
"$out/Applications/MiniZincIDE.app/Contents/MacOS/MiniZincIDE"
else
"$out/bin/MiniZincIDE";
in
stdenv.mkDerivation rec {
pname = "minizinc-ide";
version = "2.8.7";
src = fetchFromGitHub {
owner = "MiniZinc";
repo = "MiniZincIDE";
rev = version;
hash = "sha256-mlLW7RHwO+VHWJdKhDjIWYoRpdTrt7QpPKp0EiHGkEs=";
fetchSubmodules = true;
};
nativeBuildInputs = [
qmake
makeWrapper
];
buildInputs = [
qtbase
qtwebsockets
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa ];
sourceRoot = "${src.name}/MiniZincIDE";
dontWrapQtApps = true;
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"
'';
meta = with lib; {
homepage = "https://www.minizinc.org/";
description = "IDE for MiniZinc, a medium-level constraint modelling language";
mainProgram = "MiniZincIDE";
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;
platforms = platforms.unix;
maintainers = [ maintainers.dtzWill ];
};
}