nixpkgs/pkgs/development/libraries/science/math/libamplsolver/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.1 KiB
Nix
Raw Normal View History

2022-08-23 22:18:45 +00:00
{ lib, stdenv, substitute, fetchurl, fetchpatch }:
2022-02-26 14:25:00 +00:00
stdenv.mkDerivation rec {
pname = "libamplsolver";
version = "20211109";
src = fetchurl {
url = "https://ampl.com/netlib/ampl/solvers.tgz";
sha256 = "sha256-LVmScuIvxmZzywPSBl9T9YcUBJP7UFAa3eWs9r4q3JM=";
};
patches = [
2022-08-23 22:18:45 +00:00
(substitute {
src = ./libamplsolver-sharedlib.patch;
substitutions = [ "--replace" "@sharedlibext@" "${stdenv.hostPlatform.extensions.sharedLibrary}" ];
2022-02-26 14:25:00 +00:00
})
];
installPhase = ''
runHook preInstall
2022-08-23 22:18:45 +00:00
pushd sys.$(uname -m).$(uname -s)
2022-02-26 14:25:00 +00:00
install -D -m 0644 *.h -t $out/include
2022-08-23 22:18:45 +00:00
install -D -m 0644 *${stdenv.hostPlatform.extensions.sharedLibrary}* -t $out/lib
2022-02-26 14:25:00 +00:00
install -D -m 0644 *.a -t $out/lib
popd
'' + lib.optionalString stdenv.isDarwin ''
install_name_tool -id $out/lib/libamplsolver.dylib $out/lib/libamplsolver.dylib
'' + ''
2022-02-26 14:25:00 +00:00
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 ];
2022-08-23 22:18:45 +00:00
platforms = platforms.unix;
2022-02-26 14:25:00 +00:00
maintainers = with maintainers; [ aanderse ];
};
}