2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip, file, licenseFile ? null, optgamsFile ? null}:
|
2018-04-27 14:26:08 +01:00
|
|
|
|
|
|
|
assert licenseFile != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "25.0.2";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gams";
|
2018-04-27 14:26:08 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://d37drm4t2jghv5.cloudfront.net/distributions/${version}/linux/linux_x64_64_sfx.exe";
|
|
|
|
sha256 = "4f95389579f33ff7c2586838a2c19021aa0746279555cbb51aa6e0efd09bd297";
|
|
|
|
};
|
|
|
|
unpackCmd = "unzip $src";
|
2021-02-20 21:01:53 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
buildInputs = [ file ];
|
2018-04-27 14:26:08 +01:00
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/bin" "$out/share/gams"
|
|
|
|
cp -a * "$out/share/gams"
|
|
|
|
|
2018-05-31 14:00:18 +01:00
|
|
|
cp ${licenseFile} $out/share/gams/gamslice.txt
|
2021-01-15 09:19:50 +00:00
|
|
|
'' + lib.optionalString (optgamsFile != null) ''
|
2018-05-31 14:00:18 +01:00
|
|
|
cp ${optgamsFile} $out/share/gams/optgams.def
|
2018-04-27 14:26:08 +01:00
|
|
|
ln -s $out/share/gams/optgams.def $out/bin/optgams.def
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for f in $out/share/gams/*; do
|
|
|
|
if [[ -x $f ]] && [[ -f $f ]] && [[ ! $f =~ .*\.so$ ]]; then
|
|
|
|
if patchelf \
|
|
|
|
--set-rpath "$out/share/gams" \
|
|
|
|
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $f; then
|
|
|
|
ln -s $f $out/bin/$(basename $f)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
meta = with lib;{
|
2018-04-27 14:26:08 +01:00
|
|
|
description = "General Algebraic Modeling System";
|
|
|
|
longDescription = ''
|
|
|
|
The General Algebraic Modeling System is a high-level modeling system for mathematical optimization.
|
|
|
|
GAMS is designed for modeling and solving linear, nonlinear, and mixed-integer optimization problems.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.gams.com/";
|
2018-04-27 14:26:08 +01:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = [ maintainers.Scriptkiddi ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|