1 { lib, stdenv, fetchurl, unzip, file, licenseFile ? null, optgamsFile ? null}:
3 assert licenseFile != null;
5 stdenv.mkDerivation rec {
9 url = "https://d37drm4t2jghv5.cloudfront.net/distributions/${version}/linux/linux_x64_64_sfx.exe";
10 sha256 = "4f95389579f33ff7c2586838a2c19021aa0746279555cbb51aa6e0efd09bd297";
12 unpackCmd = "unzip $src";
13 nativeBuildInputs = [ unzip ];
14 buildInputs = [ file ];
18 mkdir -p "$out/bin" "$out/share/gams"
19 cp -a * "$out/share/gams"
21 cp ${licenseFile} $out/share/gams/gamslice.txt
22 '' + lib.optionalString (optgamsFile != null) ''
23 cp ${optgamsFile} $out/share/gams/optgams.def
24 ln -s $out/share/gams/optgams.def $out/bin/optgams.def
28 for f in $out/share/gams/*; do
29 if [[ -x $f ]] && [[ -f $f ]] && [[ ! $f =~ .*\.so$ ]]; then
31 --set-rpath "$out/share/gams" \
32 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $f; then
33 ln -s $f $out/bin/$(basename $f)
40 description = "General Algebraic Modeling System";
42 The General Algebraic Modeling System is a high-level modeling system for mathematical optimization.
43 GAMS is designed for modeling and solving linear, nonlinear, and mixed-integer optimization problems.
45 homepage = "https://www.gams.com/";
46 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
47 license = licenses.unfree;
48 maintainers = [ maintainers.Scriptkiddi ];
49 platforms = platforms.linux;