From d579a46c16a14ba521b959d71f37954cbf990f67 Mon Sep 17 00:00:00 2001 From: Michael Raitza Date: Sun, 6 Dec 2020 18:03:17 +0100 Subject: [PATCH] factor-lang: Update derivation and build with clang --- default.nix | 2 +- factor-lang/default.nix | 30 +++++------------------------- factor-lang/scope.nix | 2 +- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/default.nix b/default.nix index 0d14a85..dfa268e 100644 --- a/default.nix +++ b/default.nix @@ -31,7 +31,7 @@ let # l3pp = callPackage ./l3pp { }; # mathsat = callPackage ./mathsat { }; - factor-lang = callPackage ./factor-lang/scope.nix { }; + factor-lang = callPackage ./factor-lang/scope.nix { stdenv = prev.clangStdenv; }; foxitreader = callPackage ./foxitreader.nix { openssl = prev.openssl_1_0_2; }; diff --git a/factor-lang/default.nix b/factor-lang/default.nix index 9de088f..aa8e503 100644 --- a/factor-lang/default.nix +++ b/factor-lang/default.nix @@ -75,34 +75,14 @@ stdenv.mkDerivation rec { configurePhase = "true"; + LD_LIBRARY_PATH = "/run/opengl-driver/lib:${runtimeLibPath}"; buildPhase = '' - make linux-x86-64 - + patchShebangs ./build.sh # Factor uses XDG_CACHE_HOME for cache during compilation. - # We can't have that. So set it to $TMPDIR/.cache + # We can't have that. So, set it to $TMPDIR/.cache export XDG_CACHE_HOME=$TMPDIR/.cache && mkdir -p $XDG_CACHE_HOME - - # The released image has library path info embedded, so we - # first have to recreate the boot image with Nix paths, and - # then use it to build the Nix release image. - cp boot.unix-x86.64.image factor.image - - # Expose libraries in LD_LIBRARY_PATH for factor - export LD_LIBRARY_PATH=${lib.makeLibraryPath runtimeLibs}:$LD_LIBRARY_PATH - - echo "=== Building first full image from boot image..." - - # build full factor image from boot image, saving the state for the next call - ./factor -script -e='"unix-x86.64" USING: system bootstrap.image memory ; make-image save 0 exit' - - echo "=== Building new boot image..." - # make a new bootstrap image - ./factor -script -e='"unix-x86.64" USING: system bootstrap.image ; make-image 0 exit' - - echo "=== Building final full image..." - # rebuild final full factor image to include all patched sources - ./factor -i=boot.unix-x86.64.image - + ./build.sh compile + ./build.sh bootstrap ''; doCheck = true; diff --git a/factor-lang/scope.nix b/factor-lang/scope.nix index b1fe0b0..8c0d8a0 100644 --- a/factor-lang/scope.nix +++ b/factor-lang/scope.nix @@ -6,7 +6,7 @@ let let callPackage = pkgs.newScope self ; in rec { recurseForDerivations = true; - interpreter = callPackage ./default.nix { inherit (gnome2) gtkglext; }; + interpreter = callPackage ./default.nix { inherit (gnome2) gtkglext; inherit stdenv; }; # Convenience access for using the returned attribute the same way as the interpreter derivation withLibs = self.interpreter.withLibs;