treewide: Use *Platform.extensions

This commit is contained in:
John Ericson
2017-09-12 15:36:41 -04:00
parent 741839a687
commit 5aec3f96a2
17 changed files with 44 additions and 64 deletions

View File

@@ -1,9 +1,5 @@
{ stdenv, fetchFromGitHub, tcl }:
let
shlib = if stdenv.isDarwin then "dylib" else "so";
in
stdenv.mkDerivation rec {
name = "eggdrop-${version}";
version = "1.6.21-nix1";
@@ -29,7 +25,7 @@ stdenv.mkDerivation rec {
'';
configureFlags = [
"--with-tcllib=${tcl}/lib/lib${tcl.libPrefix}.${shlib}"
"--with-tcllib=${tcl}/lib/lib${tcl.libPrefix}${stdenv.hostPlatform.extensions.sharedLibrary}"
"--with-tclinc=${tcl}/include/tcl.h"
];

View File

@@ -17,20 +17,16 @@ stdenv.mkDerivation rec {
# FIXME: this is probably not the right way to make it work
# make[2]: *** No rule to make target 'libyara/.libs/libyara.a', needed by 'yara'. Stop.
dynamic_library_extension = ""
+ stdenv.lib.optionalString stdenv.isLinux "so"
+ stdenv.lib.optionalString stdenv.isDarwin "dylib"
;
prePatch = ''
cat >staticlibrary.patch <<EOF
--- a/Makefile.am 2015-11-01 11:39:12.000000000 +0100
+++ b/Makefile.am 2015-11-01 11:45:32.000000000 +0100
@@ -12 +12 @@
-yara_LDADD = libyara/.libs/libyara.a
+yara_LDADD = libyara/.libs/libyara.${dynamic_library_extension}
+yara_LDADD = libyara/.libs/libyara${stdenv.hostPlatform.extensions.sharedLibrary}
@@ -15 +15 @@
-yarac_LDADD = libyara/.libs/libyara.a
+yarac_LDADD = libyara/.libs/libyara.${dynamic_library_extension}
+yarac_LDADD = libyara/.libs/libyara${stdenv.hostPlatform.extensions.sharedLibrary}
EOF
'';
patches = [