about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2018-05-23 09:26:49 +0100
committerGitHub <noreply@github.com>2018-05-23 09:26:49 +0100
commitbe4b3e89e5a7f7ac1bdb88404768764cdeacc270 (patch)
tree10b961058047f7486070abd689c7b718374c42b9
parent4aa04d185cff21f3c6ea3e75256835daa621d1e3 (diff)
parent9668a66948cf16dde38629e0f48770058f791f0b (diff)
downloadnixlib-be4b3e89e5a7f7ac1bdb88404768764cdeacc270.tar
nixlib-be4b3e89e5a7f7ac1bdb88404768764cdeacc270.tar.gz
nixlib-be4b3e89e5a7f7ac1bdb88404768764cdeacc270.tar.bz2
nixlib-be4b3e89e5a7f7ac1bdb88404768764cdeacc270.tar.lz
nixlib-be4b3e89e5a7f7ac1bdb88404768764cdeacc270.tar.xz
nixlib-be4b3e89e5a7f7ac1bdb88404768764cdeacc270.tar.zst
nixlib-be4b3e89e5a7f7ac1bdb88404768764cdeacc270.zip
Merge pull request #39603 from Scriptkiddi/master
gams: init at 25.02
-rw-r--r--maintainers/maintainer-list.nix5
-rw-r--r--pkgs/tools/misc/gams/default.nix50
-rw-r--r--pkgs/top-level/all-packages.nix5
3 files changed, 60 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 0c3175823b07..f001ba6be8df 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -140,6 +140,11 @@
     github = "roosemberth";
     name = "Roosembert (Roosemberth) Palacios";
   };
+  Scriptkiddi = {
+    email = "nixos@scriptkiddi.de";
+    github = "scriptkiddi";
+    name = "Fritz Otlinghaus";
+  };
   SShrike = {
     email = "severen@shrike.me";
     github = "severen";
diff --git a/pkgs/tools/misc/gams/default.nix b/pkgs/tools/misc/gams/default.nix
new file mode 100644
index 000000000000..613fdc0f4555
--- /dev/null
+++ b/pkgs/tools/misc/gams/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchurl, unzip, lib, file, licenseFile, optgamsFile}:
+
+assert licenseFile != null;
+
+stdenv.mkDerivation rec {
+  version = "25.0.2";
+  name = "gams-${version}";
+  src = fetchurl {
+    url = "https://d37drm4t2jghv5.cloudfront.net/distributions/${version}/linux/linux_x64_64_sfx.exe";
+    sha256 = "4f95389579f33ff7c2586838a2c19021aa0746279555cbb51aa6e0efd09bd297";
+  };
+  unpackCmd = "unzip $src";
+  buildInputs = [ unzip file ];
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p "$out/bin" "$out/share/gams"
+    cp -a * "$out/share/gams"
+
+    cp ${licenseFile} $out/share/gamslice.txt
+  '' + stdenv.lib.optionalString (optgamsFile != null) ''
+    cp ${optgamsFile} $out/share/optgams.def
+    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
+  '';
+
+  meta = with stdenv.lib;{
+    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.
+    '';
+    homepage = https://www.gams.com/;
+    license = licenses.unfree;
+    maintainers = [ maintainers.Scriptkiddi ];
+    platforms = platforms.linux;
+  };
+}
+
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 670729bb7e65..c4c1f03ed5f1 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -646,6 +646,11 @@ with pkgs;
 
   genymotion = callPackage ../development/mobile/genymotion { };
 
+  gams = callPackage ../tools/misc/gams {
+    licenseFile = config.gams.licenseFile or null;
+    optgamsFile = config.gams.optgamsFile or null;
+  };
+
   git-fire = callPackage ../tools/misc/git-fire { };
 
   gitless = callPackage ../applications/version-management/gitless/default.nix { };