From bb173ec8e3e0b02a156fd4a405582312bf41a410 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Wed, 16 Jan 2019 23:42:15 +0100 Subject: [PATCH] gap: install libgap There are some starts of a `make install`, but nothing complete yet. Upstream now ships a `libgap` as a replacement of the custom one used by sagemath. --- pkgs/applications/science/math/gap/default.nix | 11 ++++++++++- pkgs/top-level/all-packages.nix | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/math/gap/default.nix b/pkgs/applications/science/math/gap/default.nix index a7105705f380..4b4a7035e867 100644 --- a/pkgs/applications/science/math/gap/default.nix +++ b/pkgs/applications/science/math/gap/default.nix @@ -107,7 +107,16 @@ stdenv.mkDerivation rec { popd ''; - installPhase = '' + installTargets = [ + "install-libgap" + "install-headers" + ]; + + # full `make install` is not yet implemented, just for libgap and headers + postInstall = '' + # Install config.h, which is not currently handled by `make install-headers` + cp gen/config.h "$out/include/gap" + mkdir -p "$out/bin" "$out/share/gap/" mkdir -p "$out/share/gap" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 90ea01bd6c8b..e6f44d9ab53f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10806,17 +10806,31 @@ in libgadu = callPackage ../development/libraries/libgadu { }; + # Deprecated since gap itself now ships with a library component. This is + # still necessary for sage 8.5 but will be removed once we switch to sage + # 8.6. gap-libgap-compatible = let version = "4r8p6"; pkgVer = "2016_11_12-14_25"; in - (gap.override { keepAllPackages = false; }).overrideAttrs (oldAttrs: { + (gap.override { packageSet = "minimal"; }).overrideAttrs (oldAttrs: { name = "libgap-${oldAttrs.pname}-${version}"; inherit version; src = fetchurl { url = "https://www.gap-system.org/pub/gap/gap48/tar.bz2/gap${version}_${pkgVer}.tar.bz2"; sha256 = "19n2p1mdg33s2x9rs51iak7rgndc1cwr56jyqnah0g1ydgg1yh6b"; }; + # libgap targets not yet available for 4r8p6 + installPhase = '' + mkdir -p "$out/bin" "$out/share/gap/" + + mkdir -p "$out/share/gap" + echo "Copying files to target directory" + cp -ar . "$out/share/gap/build-dir" + + makeWrapper "$out/share/gap/build-dir/bin/gap.sh" "$out/bin/gap" \ + --set GAP_DIR $out/share/gap/build-dir + ''; patches = [ # don't install any packages by default (needed for interop with libgap, probably obsolete with 4r10 (fetchpatch {