diff --git a/pkgs/development/libraries/science/math/libamplsolver/default.nix b/pkgs/development/libraries/science/math/libamplsolver/default.nix new file mode 100644 index 000000000000..bcbde5f61359 --- /dev/null +++ b/pkgs/development/libraries/science/math/libamplsolver/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchurl, fetchpatch }: + +stdenv.mkDerivation rec { + pname = "libamplsolver"; + version = "20211109"; + + src = fetchurl { + url = "https://ampl.com/netlib/ampl/solvers.tgz"; + sha256 = "sha256-LVmScuIvxmZzywPSBl9T9YcUBJP7UFAa3eWs9r4q3JM="; + }; + + patches = [ + # Debian provides a patch to build a shared library + (fetchpatch { + url = "https://sources.debian.org/data/main/liba/libamplsolver/0~20190702-2/debian/patches/fix-makefile-shared-lib.patch"; + sha256 = "sha256-96qwj3fLugzbsfxguKMce13cUo7XGC4VUE7xKcJs42Y="; + }) + ]; + + installPhase = '' + runHook preInstall + pushd sys.`uname -m`.`uname -s` + install -D -m 0644 *.h -t $out/include + install -D -m 0644 *.so* -t $out/lib + install -D -m 0644 *.a -t $out/lib + popd + runHook postInstall + ''; + + meta = with lib; { + description = "A library of routines that help solvers work with AMPL"; + homepage = "https://ampl.com/netlib/ampl/"; + license = [ licenses.mit ]; + platforms = platforms.linux; + maintainers = with maintainers; [ aanderse ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a8b54c390f85..b95a7ab17e66 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32123,6 +32123,8 @@ with pkgs; lapack-reference = callPackage ../development/libraries/science/math/liblapack { }; liblapack = lapack-reference; + libamplsolver = callPackage ../development/libraries/science/math/libamplsolver { }; + libbraiding = callPackage ../development/libraries/science/math/libbraiding { }; libhomfly = callPackage ../development/libraries/science/math/libhomfly { };