summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authorBen Siraphob <bensiraphob@gmail.com>2022-03-12 16:08:59 -0800
committerGitHub <noreply@github.com>2022-03-12 16:08:59 -0800
commitb783c48432cdfc35224a39bd95666daa62fef126 (patch)
tree24a35e2fbd4452acab1a15700896303cdb26460a /pkgs/development/interpreters
parenta41ccc89664c478397ab321c240beced2aadca3e (diff)
parent4e9cfefb8a495b1dc8ab7793731aef2b5048efa0 (diff)
downloadnixpkgs-b783c48432cdfc35224a39bd95666daa62fef126.tar
nixpkgs-b783c48432cdfc35224a39bd95666daa62fef126.tar.gz
nixpkgs-b783c48432cdfc35224a39bd95666daa62fef126.tar.bz2
nixpkgs-b783c48432cdfc35224a39bd95666daa62fef126.tar.lz
nixpkgs-b783c48432cdfc35224a39bd95666daa62fef126.tar.xz
nixpkgs-b783c48432cdfc35224a39bd95666daa62fef126.tar.zst
nixpkgs-b783c48432cdfc35224a39bd95666daa62fef126.zip
Merge pull request #160051 from trofi/update-guile
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/guile/2.2.nix4
-rw-r--r--pkgs/development/interpreters/guile/3.0.nix28
2 files changed, 25 insertions, 7 deletions
diff --git a/pkgs/development/interpreters/guile/2.2.nix b/pkgs/development/interpreters/guile/2.2.nix
index 19ef0e60848..04c60e80e8f 100644
--- a/pkgs/development/interpreters/guile/2.2.nix
+++ b/pkgs/development/interpreters/guile/2.2.nix
@@ -83,9 +83,9 @@ builder rec {
   # Explicitly link against libgcc_s, to work around the infamous
   # "libgcc_s.so.1 must be installed for pthread_cancel to work".
 
-  # don't have "libgcc_s.so.1" on darwin
+  # don't have "libgcc_s.so.1" on clang
   LDFLAGS = lib.optionalString
-    (!stdenv.isDarwin && !stdenv.hostPlatform.isStatic) "-lgcc_s";
+    (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s";
 
   configureFlags = [
     "--with-libreadline-prefix=${lib.getDev readline}"
diff --git a/pkgs/development/interpreters/guile/3.0.nix b/pkgs/development/interpreters/guile/3.0.nix
index 76aa0c4404f..99f3f84829c 100644
--- a/pkgs/development/interpreters/guile/3.0.nix
+++ b/pkgs/development/interpreters/guile/3.0.nix
@@ -14,6 +14,7 @@
 , pkg-config
 , pkgsBuildBuild
 , readline
+, writeScript
 }:
 
 let
@@ -24,11 +25,11 @@ let
 in
 builder rec {
   pname = "guile";
-  version = "3.0.7";
+  version = "3.0.8";
 
   src = fetchurl {
     url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
-    sha256 = "sha256-9X2GxwYgJxv863qb4MgXRKAz8IrcfOuoMsmRerPmkbc=";
+    sha256 = "sha256-2qcGClbygE6bdMjX5/6L7tErQ6qyeJo4WFGD/MF7ihM=";
   };
 
   outputs = [ "out" "dev" "info" ];
@@ -81,9 +82,9 @@ builder rec {
   # Explicitly link against libgcc_s, to work around the infamous
   # "libgcc_s.so.1 must be installed for pthread_cancel to work".
 
-  # don't have "libgcc_s.so.1" on darwin
+  # don't have "libgcc_s.so.1" on clang
   LDFLAGS = lib.optionalString
-    (!stdenv.isDarwin && !stdenv.hostPlatform.isStatic) "-lgcc_s";
+    (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s";
 
   configureFlags = [
     "--with-libreadline-prefix=${lib.getDev readline}"
@@ -102,7 +103,10 @@ builder rec {
   ]
   # Disable JIT on Apple Silicon, as it is not yet supported
   # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44505";
-  ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) "--enable-jit=no";
+  ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) "--enable-jit=no"
+  # At least on x86_64-darwin '-flto' autodetection is not correct:
+  #  https://github.com/NixOS/nixpkgs/pull/160051#issuecomment-1046193028
+  ++ lib.optional (stdenv.isDarwin) "--disable-lto";
 
   postInstall = ''
     wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"
@@ -126,6 +130,20 @@ builder rec {
 
   setupHook = ./setup-hook-3.0.sh;
 
+  passthru = {
+    updateScript = writeScript "update-guile-3" ''
+      #!/usr/bin/env nix-shell
+      #!nix-shell -i bash -p curl pcre common-updater-scripts
+
+      set -eu -o pipefail
+
+      # Expect the text in format of '"https://ftp.gnu.org/gnu/guile/guile-3.0.8.tar.gz"'
+      new_version="$(curl -s https://www.gnu.org/software/guile/download/ |
+          pcregrep -o1 '"https://ftp.gnu.org/gnu/guile/guile-(3[.0-9]+).tar.gz"')"
+      update-source-version ${pname} "$new_version"
+    '';
+  };
+
   meta = with lib; {
     homepage = "https://www.gnu.org/software/guile/";
     description = "Embeddable Scheme implementation";