mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
singular: reimplement using mkDerivation
This commit is contained in:
parent
42fc03411f
commit
022bbe1c0c
1 changed files with 22 additions and 43 deletions
|
@ -1,55 +1,34 @@
|
||||||
x@{builderDefsPackage
|
{ stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils }:
|
||||||
, gmp, bison, perl, autoconf, ncurses, readline
|
|
||||||
, coreutils
|
|
||||||
, ...}:
|
|
||||||
builderDefsPackage
|
|
||||||
(a :
|
|
||||||
let
|
|
||||||
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
|
|
||||||
[];
|
|
||||||
|
|
||||||
buildInputs = map (n: builtins.getAttr n x)
|
stdenv.mkDerivation rec {
|
||||||
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
|
name = "singular-${version}";
|
||||||
sourceInfo = rec {
|
version="3-1-2";
|
||||||
baseName="Singular";
|
|
||||||
version="3-1-2";
|
src = fetchurl {
|
||||||
revision="-1";
|
url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${version}/${name}.tar.gz";
|
||||||
name="${baseName}-${version}${revision}";
|
sha256 = "04f9i1xar0r7qrrbfki1h9rrmx5y2xg4w7rrvlbx05v2dy6s8djv";
|
||||||
url="http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${version}/${name}.tar.gz";
|
|
||||||
hash="04f9i1xar0r7qrrbfki1h9rrmx5y2xg4w7rrvlbx05v2dy6s8djv";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
src = a.fetchurl {
|
|
||||||
url = sourceInfo.url;
|
|
||||||
sha256 = sourceInfo.hash;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit (sourceInfo) name version;
|
buildInputs = [ gmp bison perl autoconf ncurses readline coreutils ];
|
||||||
inherit buildInputs;
|
|
||||||
|
|
||||||
/* doConfigure should be removed if not needed */
|
preConfigure = ''
|
||||||
phaseNames = ["doFixPaths" "doConfigure" "doMakeInstall" "fixInstall"];
|
find . -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';'
|
||||||
doFixPaths = a.fullDepEntry (''
|
find . -exec sed -e 's@/bin/uname@${coreutils}&@g' -i '{}' ';'
|
||||||
find . -exec sed -e 's@/bin/rm@${a.coreutils}&@g' -i '{}' ';'
|
'';
|
||||||
find . -exec sed -e 's@/bin/uname@${a.coreutils}&@g' -i '{}' ';'
|
|
||||||
'') ["minInit" "doUnpack"];
|
postInstall = ''
|
||||||
fixInstall = a.fullDepEntry (''
|
|
||||||
rm -rf "$out/LIB"
|
rm -rf "$out/LIB"
|
||||||
cp -r Singular/LIB "$out"
|
cp -r Singular/LIB "$out"
|
||||||
mkdir -p "$out/bin"
|
mkdir -p "$out/bin"
|
||||||
ln -s "$out/"*/Singular "$out/bin"
|
ln -s "$out/"*/Singular "$out/bin"
|
||||||
'') ["minInit" "defEnsureDir"];
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
description = "A CAS for polynomial computations";
|
description = "A CAS for polynomial computations";
|
||||||
maintainers = with a.lib.maintainers;
|
maintainers = with maintainers;
|
||||||
[
|
[ raskin ];
|
||||||
raskin
|
platforms = platforms.linux;
|
||||||
];
|
license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
|
||||||
platforms = with a.lib.platforms;
|
|
||||||
linux;
|
|
||||||
license = a.stdenv.lib.licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
|
|
||||||
homepage = "http://www.singular.uni-kl.de/index.php";
|
homepage = "http://www.singular.uni-kl.de/index.php";
|
||||||
};
|
};
|
||||||
passthru = {
|
passthru = {
|
||||||
|
@ -57,4 +36,4 @@ rec {
|
||||||
downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
|
downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}) x
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue