Merge pull request #38754 from timokau/gap-4r8p10

gap: 4r8p3 -> 4r8p10

authored by Michael Raskin and committed by GitHub 78d5690d a7c51f14

+72 -15
+70 -15
pkgs/applications/science/math/gap/default.nix
··· 1 - { stdenv, fetchurl, m4, gmp }: 2 - 3 - let 4 - baseName = "gap"; 5 - version = "4r8p3"; 6 - 7 - pkgVer = "2016_03_19-22_17"; 8 - in 1 + { stdenv 2 + , fetchurl 3 + , fetchpatch 4 + , m4 5 + , gmp 6 + # don't remove any packages -- results in a ~1.3G size increase 7 + # see https://github.com/NixOS/nixpkgs/pull/38754 for a discussion 8 + , keepAllPackages ? true 9 + }: 9 10 10 11 stdenv.mkDerivation rec { 11 - name = "${baseName}-${version}"; 12 + pname = "gap"; 13 + # https://www.gap-system.org/Releases/ 14 + # newer versions (4.9.0) are available, but still considered beta (https://github.com/gap-system/gap/wiki/GAP-4.9-release-notes) 15 + version = "4r8p10"; 16 + pkgVer = "2018_01_15-13_02"; 17 + name = "${pname}-${version}"; 12 18 13 - src = fetchurl { 14 - url = "ftp://ftp.gap-system.org/pub/gap/gap48/tar.gz/${baseName}${version}_${pkgVer}.tar.gz"; 15 - sha256 = "1rmb0lj43avv456sjwb7ia3y0wwk5shlqylpkdwnnqpjnvjbnzv6"; 19 + src = let 20 + # 4r8p10 -> 48 21 + majorminor = stdenv.lib.replaceStrings ["r"] [""] ( 22 + builtins.head (stdenv.lib.splitString "p" version) # 4r8p10 -> 4r8 23 + ); 24 + in 25 + fetchurl { 26 + url = "https://www.gap-system.org/pub/gap/gap${majorminor}/tar.bz2/gap${version}_${pkgVer}.tar.bz2"; 27 + sha256 = "0wzfdjnn6sfiaizbk5c7x44rhbfayis4lf57qbqqg84c7dqlwr6f"; 16 28 }; 17 29 30 + # remove all non-essential packages (which take up a lot of space) 31 + preConfigure = stdenv.lib.optionalString (!keepAllPackages) '' 32 + find pkg -type d -maxdepth 1 -mindepth 1 \ 33 + -not -name 'GAPDoc-*' \ 34 + -not -name 'autpgrp*' \ 35 + -exec echo "Removing package {}" \; \ 36 + -exec rm -r {} \; 37 + ''; 38 + 18 39 configureFlags = [ "--with-gmp=system" ]; 19 40 buildInputs = [ m4 gmp ]; 20 - 41 + 42 + patches = [ 43 + # fix infinite loop in writeandcheck() when writing an error message fails. 44 + (fetchpatch { 45 + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/gap/patches/writeandcheck.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba"; 46 + sha256 = "1r1511x4kc2i2mbdq1b61rb6p3misvkf1v5qy3z6fmn6vqwziaz1"; 47 + }) 48 + ]; 49 + 50 + doCheck = true; 51 + checkTarget = "testinstall"; 52 + # "teststandard" is a superset of testinstall. It takes ~1h instead of ~1min. 53 + # tests are run twice, once with all packages loaded and once without 54 + # checkTarget = "teststandard"; 55 + 56 + preCheck = '' 57 + # gap tests check that the home directory exists 58 + export HOME="$TMP/gap-home" 59 + mkdir -p "$HOME" 60 + ''; 61 + 62 + postCheck = '' 63 + # The testsuite doesn't exit with a non-zero exit code on failure. 64 + # It leaves its logs in dev/log however. 65 + 66 + # grep for error messages 67 + if grep ^##### dev/log/*; then 68 + exit 1 69 + fi 70 + ''; 71 + 21 72 postBuild = '' 22 73 pushd pkg 23 74 bash ../bin/BuildPackages.sh 24 75 popd 25 76 ''; 26 - 77 + 27 78 installPhase = '' 28 79 mkdir -p "$out/bin" "$out/share/gap/" 29 80 ··· 31 82 32 83 sed -e "/GAP_DIR=/aGAP_DIR='$out/share/gap/build-dir/'" -i "$out/share/gap/build-dir/bin/gap.sh" 33 84 34 - ln -s "$out/share/gap/build-dir/bin/gap.sh" "$out/bin" 85 + ln -s "$out/share/gap/build-dir/bin/gap.sh" "$out/bin/gap" 35 86 ''; 36 87 37 88 meta = with stdenv.lib; { ··· 42 93 chrisjefferson 43 94 ]; 44 95 platforms = platforms.all; 96 + # keeping all packages increases the package size considerably, wchich 97 + # is why a local build is preferable in that situation. The timeframe 98 + # is reasonable and that way the binary cache doesn't get overloaded. 99 + hydraPlatforms = stdenv.lib.optionals (!keepAllPackages) platforms; 45 100 license = licenses.gpl2; 46 101 homepage = http://gap-system.org/; 47 102 };
+2
pkgs/top-level/all-packages.nix
··· 20127 20127 20128 20128 gap = callPackage ../applications/science/math/gap { }; 20129 20129 20130 + gap-minimal = lowPrio (gap.override { keepAllPackages = false; }); 20131 + 20130 20132 geogebra = callPackage ../applications/science/math/geogebra { }; 20131 20133 20132 20134 maxima = callPackage ../applications/science/math/maxima {