guile: move LDFLAGS into env for structuredAttrs

This commit is contained in:
Stefan Frijters
2026-01-07 21:36:50 +01:00
parent 44aa31bee7
commit e6865860d1
3 changed files with 19 additions and 17 deletions
+6 -8
View File
@@ -90,14 +90,6 @@ 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
LDFLAGS = lib.optionalString (
!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isMusl
) "-lgcc_s";
configureFlags = [
"--with-libreadline-prefix"
]
@@ -118,6 +110,12 @@ builder rec {
env = {
NIX_CFLAGS_COMPILE = "-std=gnu17";
}
// lib.optionalAttrs (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isMusl) {
# 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
LDFLAGS = "-lgcc_s";
};
postInstall = ''
+3 -1
View File
@@ -85,7 +85,9 @@ builder rec {
# "libgcc_s.so.1 must be installed for pthread_cancel to work".
# don't have "libgcc_s.so.1" on clang
LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s";
env = lib.optionalAttrs (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) {
LDFLAGS = "-lgcc_s";
};
configureFlags = [
"--with-libreadline-prefix=${lib.getDev readline}"
+10 -8
View File
@@ -100,11 +100,16 @@ builder rec {
sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207";
});
# 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 clang
LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s";
env = {
# Fix build with gcc15
NIX_CFLAGS_COMPILE = toString [ "-std=gnu17" ];
}
// lib.optionalAttrs (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) {
# 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 clang
LDFLAGS = "-lgcc_s";
};
configureFlags = [
"--with-libreadline-prefix=${lib.getDev readline}"
@@ -126,9 +131,6 @@ builder rec {
# https://github.com/NixOS/nixpkgs/pull/160051#issuecomment-1046193028
++ lib.optional (stdenv.hostPlatform.isDarwin) "--disable-lto";
# Fix build with gcc15
env.NIX_CFLAGS_COMPILE = toString [ "-std=gnu17" ];
postInstall = ''
wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"
''