treewide: Use *Platform.extensions
This commit is contained in:
parent
741839a687
commit
5aec3f96a2
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
mavenRepo = import ./mesos-deps.nix { inherit stdenv curl; };
|
mavenRepo = import ./mesos-deps.nix { inherit stdenv curl; };
|
||||||
soext = if stdenv.system == "x86_64-darwin" then "dylib" else "so";
|
|
||||||
# `tar -z` requires gzip on $PATH, so wrap tar.
|
# `tar -z` requires gzip on $PATH, so wrap tar.
|
||||||
# At some point, we should try to patch mesos so we add gzip to the PATH when
|
# At some point, we should try to patch mesos so we add gzip to the PATH when
|
||||||
# tar is invoked. I think that only needs to be done here:
|
# tar is invoked. I think that only needs to be done here:
|
||||||
|
@ -193,7 +192,7 @@ in stdenv.mkDerivation rec {
|
||||||
mkdir -p $out/share/java
|
mkdir -p $out/share/java
|
||||||
cp src/java/target/mesos-*.jar $out/share/java
|
cp src/java/target/mesos-*.jar $out/share/java
|
||||||
|
|
||||||
MESOS_NATIVE_JAVA_LIBRARY=$out/lib/libmesos.${soext}
|
MESOS_NATIVE_JAVA_LIBRARY=$out/lib/libmesos${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||||
|
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
touch $out/nix-support/setup-hook
|
touch $out/nix-support/setup-hook
|
||||||
|
|
|
@ -26,7 +26,6 @@ assert (hostPlatform != buildPlatform) -> !enableSharedLibraries;
|
||||||
|
|
||||||
let
|
let
|
||||||
src = fetch "llvm" "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z";
|
src = fetch "llvm" "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z";
|
||||||
shlib = if stdenv.isDarwin then "dylib" else "so";
|
|
||||||
|
|
||||||
# Used when creating a version-suffixed symlink of libLLVM.dylib
|
# Used when creating a version-suffixed symlink of libLLVM.dylib
|
||||||
shortVersion = with stdenv.lib;
|
shortVersion = with stdenv.lib;
|
||||||
|
@ -124,7 +123,7 @@ in stdenv.mkDerivation rec {
|
||||||
postInstall = ""
|
postInstall = ""
|
||||||
+ stdenv.lib.optionalString (enableSharedLibraries) ''
|
+ stdenv.lib.optionalString (enableSharedLibraries) ''
|
||||||
moveToOutput "lib/libLLVM-*" "$lib"
|
moveToOutput "lib/libLLVM-*" "$lib"
|
||||||
moveToOutput "lib/libLLVM.${shlib}" "$lib"
|
moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
|
||||||
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-release.cmake" \
|
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-release.cmake" \
|
||||||
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
|
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
|
||||||
''
|
''
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
src = fetch "llvm" "0l9bf7kdwhlj0kq1hawpyxhna1062z3h7qcz2y8nfl9dz2qksy6s";
|
src = fetch "llvm" "0l9bf7kdwhlj0kq1hawpyxhna1062z3h7qcz2y8nfl9dz2qksy6s";
|
||||||
shlib = if stdenv.isDarwin then "dylib" else "so";
|
|
||||||
|
|
||||||
# Used when creating a version-suffixed symlink of libLLVM.dylib
|
# Used when creating a version-suffixed symlink of libLLVM.dylib
|
||||||
shortVersion = with stdenv.lib;
|
shortVersion = with stdenv.lib;
|
||||||
|
@ -115,7 +114,7 @@ in stdenv.mkDerivation rec {
|
||||||
''
|
''
|
||||||
+ stdenv.lib.optionalString enableSharedLibraries ''
|
+ stdenv.lib.optionalString enableSharedLibraries ''
|
||||||
moveToOutput "lib/libLLVM-*" "$lib"
|
moveToOutput "lib/libLLVM-*" "$lib"
|
||||||
moveToOutput "lib/libLLVM.${shlib}" "$lib"
|
moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
|
||||||
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
|
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
|
||||||
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
|
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
|
||||||
''
|
''
|
||||||
|
|
|
@ -12,10 +12,8 @@ stdenv.mkDerivation rec {
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
buildInputs = [ openblasCompat superlu hdf5 ];
|
buildInputs = [ openblasCompat superlu hdf5 ];
|
||||||
|
|
||||||
cmakeFlags = let
|
cmakeFlags = [
|
||||||
libSuff = if stdenv.isDarwin then "dylib" else "so";
|
"-DLAPACK_LIBRARY=${openblasCompat}/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
in [
|
|
||||||
"-DLAPACK_LIBRARY=${openblasCompat}/lib/libopenblas.${libSuff}"
|
|
||||||
"-DDETECT_HDF5=ON"
|
"-DDETECT_HDF5=ON"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,9 @@ stdenv.mkDerivation {
|
||||||
substituteInPlace Makefile --replace "-arch i386" ""
|
substituteInPlace Makefile --replace "-arch i386" ""
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = let
|
installPhase = ''
|
||||||
libSuff = if stdenv.isDarwin then "dylib" else "so";
|
|
||||||
in ''
|
|
||||||
mkdir -p $out/{bin,lib,include/hdhomerun}
|
mkdir -p $out/{bin,lib,include/hdhomerun}
|
||||||
install -Dm444 libhdhomerun.${libSuff} $out/lib
|
install -Dm444 libhdhomerun${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib
|
||||||
install -Dm555 hdhomerun_config $out/bin
|
install -Dm555 hdhomerun_config $out/bin
|
||||||
cp *.h $out/include/hdhomerun
|
cp *.h $out/include/hdhomerun
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -15,11 +15,11 @@ stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = let
|
installPhase = let
|
||||||
libSuff = if stdenv.isDarwin then "dylib" else "so";
|
libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||||
in ''
|
in ''
|
||||||
mkdir -p $out/lib $out/bin $out/include;
|
mkdir -p $out/lib $out/bin $out/include;
|
||||||
cp libsvm.so.2 $out/lib/libsvm.2.${libSuff};
|
cp libsvm.so.2 $out/lib/libsvm.2${libSuff};
|
||||||
ln -s $out/lib/libsvm.2.${libSuff} $out/lib/libsvm.${libSuff};
|
ln -s $out/lib/libsvm.2${libSuff} $out/lib/libsvm${libSuff};
|
||||||
cp svm-scale svm-train svm-predict $out/bin;
|
cp svm-scale svm-train svm-predict $out/bin;
|
||||||
cp svm.h $out/include;
|
cp svm.h $out/include;
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -7,7 +7,7 @@ let
|
||||||
name = "suitesparse-${version}";
|
name = "suitesparse-${version}";
|
||||||
|
|
||||||
int_t = if openblas.blas64 then "int64_t" else "int32_t";
|
int_t = if openblas.blas64 then "int64_t" else "int32_t";
|
||||||
SHLIB_EXT = if stdenv.isDarwin then "dylib" else "so";
|
SHLIB_EXT = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
inherit name;
|
inherit name;
|
||||||
|
@ -64,10 +64,10 @@ stdenv.mkDerivation {
|
||||||
for i in "$out"/lib/lib*.a; do
|
for i in "$out"/lib/lib*.a; do
|
||||||
ar -x $i
|
ar -x $i
|
||||||
done
|
done
|
||||||
${if enableCuda then cudatoolkit else stdenv.cc.outPath}/bin/${if enableCuda then "nvcc" else "cc"} *.o ${if stdenv.isDarwin then "-dynamiclib" else "--shared"} -o "$out/lib/libsuitesparse.${SHLIB_EXT}" -lopenblas ${stdenv.lib.optionalString enableCuda "-lcublas"}
|
${if enableCuda then cudatoolkit else stdenv.cc.outPath}/bin/${if enableCuda then "nvcc" else "cc"} *.o ${if stdenv.isDarwin then "-dynamiclib" else "--shared"} -o "$out/lib/libsuitesparse${SHLIB_EXT}" -lopenblas ${stdenv.lib.optionalString enableCuda "-lcublas"}
|
||||||
)
|
)
|
||||||
for i in umfpack cholmod amd camd colamd spqr; do
|
for i in umfpack cholmod amd camd colamd spqr; do
|
||||||
ln -s libsuitesparse.${SHLIB_EXT} "$out"/lib/lib$i.${SHLIB_EXT}
|
ln -s libsuitesparse${SHLIB_EXT} "$out"/lib/lib$i${SHLIB_EXT}
|
||||||
done
|
done
|
||||||
|
|
||||||
# Install documentation
|
# Install documentation
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
{ stdenv, fetchurl }:
|
{ stdenv, fetchurl }:
|
||||||
|
|
||||||
let
|
|
||||||
SHLIB_EXT = if stdenv.isDarwin then "dylib" else "so";
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "tbb-4.4-u2";
|
name = "tbb-4.4-u2";
|
||||||
|
|
||||||
|
@ -16,7 +13,7 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/{lib,share/doc}
|
mkdir -p $out/{lib,share/doc}
|
||||||
cp "build/"*release*"/"*${SHLIB_EXT}* $out/lib/
|
cp "build/"*release*"/"*${stdenv.hostPlatform.extensions.sharedLibrary}* $out/lib/
|
||||||
mv include $out/
|
mv include $out/
|
||||||
rm $out/include/index.html
|
rm $out/include/index.html
|
||||||
mv doc/html $out/share/doc/tbb
|
mv doc/html $out/share/doc/tbb
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "2.6.2";
|
version = "2.6.2";
|
||||||
SHLIB_EXT = if stdenv.isDarwin then "dylib" else "so";
|
SHLIB_EXT = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "tinyxml-${version}";
|
name = "tinyxml-${version}";
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ in stdenv.mkDerivation {
|
||||||
# build the lib as a shared library
|
# build the lib as a shared library
|
||||||
''${CXX} -Wall -O2 -shared -fpic tinyxml.cpp \
|
''${CXX} -Wall -O2 -shared -fpic tinyxml.cpp \
|
||||||
tinyxmlerror.cpp tinyxmlparser.cpp \
|
tinyxmlerror.cpp tinyxmlparser.cpp \
|
||||||
tinystr.cpp -o libtinyxml.${SHLIB_EXT}
|
tinystr.cpp -o libtinyxml${SHLIB_EXT}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
@ -55,7 +55,7 @@ in stdenv.mkDerivation {
|
||||||
mkdir -pv $out/lib/pkgconfig/
|
mkdir -pv $out/lib/pkgconfig/
|
||||||
mkdir -pv $out/share/doc/tinyxml/
|
mkdir -pv $out/share/doc/tinyxml/
|
||||||
|
|
||||||
cp -v libtinyxml.${SHLIB_EXT} $out/lib/
|
cp -v libtinyxml${SHLIB_EXT} $out/lib/
|
||||||
cp -v *.h $out/include/
|
cp -v *.h $out/include/
|
||||||
|
|
||||||
substituteInPlace tinyxml.pc --replace "@out@" "$out"
|
substituteInPlace tinyxml.pc --replace "@out@" "$out"
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
, psutil
|
, psutil
|
||||||
, memory_profiler
|
, memory_profiler
|
||||||
, pytest_xdist
|
, pytest_xdist
|
||||||
, sharedLibraryExtension
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
magick_wand_library = "${imagemagick}/lib/libMagickWand-6.Q16${sharedLibraryExtension}";
|
soext = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||||
imagemagick_library = "${imagemagick}/lib/libMagickCore-6.Q16${sharedLibraryExtension}";
|
magick_wand_library = "${imagemagick}/lib/libMagickWand-6.Q16${soext}";
|
||||||
|
imagemagick_library = "${imagemagick}/lib/libMagickCore-6.Q16${soext}";
|
||||||
in buildPythonPackage rec {
|
in buildPythonPackage rec {
|
||||||
pname = "Wand";
|
pname = "Wand";
|
||||||
version = "0.4.4";
|
version = "0.4.4";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, buildPythonPackage, fetchPypi
|
{ stdenv, buildPythonPackage, fetchPypi
|
||||||
, geos, glibcLocales, pytest, cython, sharedLibraryExtension
|
, geos, glibcLocales, pytest, cython
|
||||||
, numpy
|
, numpy
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ buildPythonPackage rec {
|
||||||
patchPhase = let
|
patchPhase = let
|
||||||
libc = if stdenv.isDarwin then "libc.dylib" else "libc.so.6";
|
libc = if stdenv.isDarwin then "libc.dylib" else "libc.so.6";
|
||||||
in ''
|
in ''
|
||||||
sed -i "s|_lgeos = load_dll('geos_c', fallbacks=.*)|_lgeos = load_dll('geos_c', fallbacks=['${geos}/lib/libgeos_c${sharedLibraryExtension}'])|" shapely/geos.py
|
sed -i "s|_lgeos = load_dll('geos_c', fallbacks=.*)|_lgeos = load_dll('geos_c', fallbacks=['${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}'])|" shapely/geos.py
|
||||||
sed -i "s|free = load_dll('c').free|free = load_dll('c', fallbacks=['${stdenv.cc.libc}/lib/${stdenv.cc.libc}']).free|" shapely/geos.py
|
sed -i "s|free = load_dll('c').free|free = load_dll('c', fallbacks=['${stdenv.cc.libc}/lib/${stdenv.cc.libc}']).free|" shapely/geos.py
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ in
|
||||||
rbnacl = spec: {
|
rbnacl = spec: {
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
sed -i $(cat $out/nix-support/gem-meta/install-path)/lib/rbnacl.rb -e "2a \
|
sed -i $(cat $out/nix-support/gem-meta/install-path)/lib/rbnacl.rb -e "2a \
|
||||||
RBNACL_LIBSODIUM_GEM_LIB_PATH = '${libsodium.out}/lib/libsodium.${if stdenv.isDarwin then "dylib" else "so"}'
|
RBNACL_LIBSODIUM_GEM_LIB_PATH = '${libsodium.out}/lib/libsodium${stdenv.hostPlatform.extensions.sharedLibrary}'
|
||||||
"
|
"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
{ stdenv }:
|
{ stdenv }:
|
||||||
|
|
||||||
let
|
|
||||||
shlib = if stdenv.isDarwin then "dylib" else "so";
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "cc-wrapper-test";
|
name = "cc-wrapper-test";
|
||||||
|
|
||||||
|
@ -34,7 +30,12 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
printf "checking whether compiler uses NIX_LDFLAGS... " >&2
|
printf "checking whether compiler uses NIX_LDFLAGS... " >&2
|
||||||
mkdir -p foo/lib
|
mkdir -p foo/lib
|
||||||
$CC -shared ${stdenv.lib.optionalString stdenv.isDarwin "-Wl,-install_name,@rpath/libfoo.dylib"} -DVALUE=42 -o foo/lib/libfoo.${shlib} ${./foo.c}
|
$CC -shared \
|
||||||
|
${stdenv.lib.optionalString stdenv.isDarwin "-Wl,-install_name,@rpath/libfoo.dylib"} \
|
||||||
|
-DVALUE=42 \
|
||||||
|
-o foo/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \
|
||||||
|
${./foo.c}
|
||||||
|
|
||||||
NIX_LDFLAGS="-L$NIX_BUILD_TOP/foo/lib -rpath $NIX_BUILD_TOP/foo/lib" $CC -lfoo -o ldflags-check ${./ldflags-main.c}
|
NIX_LDFLAGS="-L$NIX_BUILD_TOP/foo/lib -rpath $NIX_BUILD_TOP/foo/lib" $CC -lfoo -o ldflags-check ${./ldflags-main.c}
|
||||||
./ldflags-check
|
./ldflags-check
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
{ stdenv }:
|
{ stdenv }:
|
||||||
|
|
||||||
let
|
let
|
||||||
shlib = if stdenv.isDarwin then "dylib" else "so";
|
|
||||||
|
|
||||||
foo = stdenv.mkDerivation {
|
foo = stdenv.mkDerivation {
|
||||||
name = "foo-test";
|
name = "foo-test";
|
||||||
|
|
||||||
|
@ -13,7 +11,10 @@ let
|
||||||
$CC -o $out/bin/foo ${./cc-main.c}
|
$CC -o $out/bin/foo ${./cc-main.c}
|
||||||
chmod +x $out/bin/foo
|
chmod +x $out/bin/foo
|
||||||
cp ${./foo.c} $out/include/foo.h
|
cp ${./foo.c} $out/include/foo.h
|
||||||
$CC -shared ${stdenv.lib.optionalString stdenv.isDarwin "-Wl,-install_name,$out/lib/libfoo.dylib"} -o $out/lib/libfoo.${shlib} ${./foo.c}
|
$CC -shared \
|
||||||
|
${stdenv.lib.optionalString stdenv.isDarwin "-Wl,-install_name,$out/lib/libfoo.dylib"} \
|
||||||
|
-o $out/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \
|
||||||
|
${./foo.c}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -28,7 +29,10 @@ let
|
||||||
$CC -o $out/bin/bar ${./cc-main.c}
|
$CC -o $out/bin/bar ${./cc-main.c}
|
||||||
chmod +x $out/bin/bar
|
chmod +x $out/bin/bar
|
||||||
cp ${./bar.c} $dev/include/bar.h
|
cp ${./bar.c} $dev/include/bar.h
|
||||||
$CC -shared ${stdenv.lib.optionalString stdenv.isDarwin "-Wl,-install_name,$dev/lib/libbar.dylib"} -o $dev/lib/libbar.${shlib} ${./bar.c}
|
$CC -shared \
|
||||||
|
${stdenv.lib.optionalString stdenv.isDarwin "-Wl,-install_name,$dev/lib/libbar.dylib"} \
|
||||||
|
-o $dev/lib/libbar${stdenv.hostPlatform.extensions.sharedLibrary} \
|
||||||
|
${./bar.c}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
{ stdenv, fetchFromGitHub, tcl }:
|
{ stdenv, fetchFromGitHub, tcl }:
|
||||||
|
|
||||||
let
|
|
||||||
shlib = if stdenv.isDarwin then "dylib" else "so";
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "eggdrop-${version}";
|
name = "eggdrop-${version}";
|
||||||
version = "1.6.21-nix1";
|
version = "1.6.21-nix1";
|
||||||
|
@ -29,7 +25,7 @@ stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configureFlags = [
|
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"
|
"--with-tclinc=${tcl}/include/tcl.h"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -17,20 +17,16 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
# FIXME: this is probably not the right way to make it work
|
# 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.
|
# 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 = ''
|
prePatch = ''
|
||||||
cat >staticlibrary.patch <<EOF
|
cat >staticlibrary.patch <<EOF
|
||||||
--- a/Makefile.am 2015-11-01 11:39:12.000000000 +0100
|
--- a/Makefile.am 2015-11-01 11:39:12.000000000 +0100
|
||||||
+++ b/Makefile.am 2015-11-01 11:45:32.000000000 +0100
|
+++ b/Makefile.am 2015-11-01 11:45:32.000000000 +0100
|
||||||
@@ -12 +12 @@
|
@@ -12 +12 @@
|
||||||
-yara_LDADD = libyara/.libs/libyara.a
|
-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 @@
|
@@ -15 +15 @@
|
||||||
-yarac_LDADD = libyara/.libs/libyara.a
|
-yarac_LDADD = libyara/.libs/libyara.a
|
||||||
+yarac_LDADD = libyara/.libs/libyara.${dynamic_library_extension}
|
+yarac_LDADD = libyara/.libs/libyara${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
patches = [
|
patches = [
|
||||||
|
|
|
@ -80,14 +80,10 @@ let
|
||||||
else throw "Unsupported kind ${kind}");
|
else throw "Unsupported kind ${kind}");
|
||||||
in fetcher (builtins.removeAttrs attrs ["format"]) );
|
in fetcher (builtins.removeAttrs attrs ["format"]) );
|
||||||
|
|
||||||
# This should become part of stdenv!
|
|
||||||
sharedLibraryExtension = if stdenv.isDarwin then ".dylib" else ".so";
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
inherit python bootstrapped-pip pythonAtLeast pythonOlder isPy26 isPy27 isPy33 isPy34 isPy35 isPy36 isPyPy isPy3k mkPythonDerivation buildPythonPackage buildPythonApplication;
|
inherit python bootstrapped-pip pythonAtLeast pythonOlder isPy26 isPy27 isPy33 isPy34 isPy35 isPy36 isPyPy isPy3k mkPythonDerivation buildPythonPackage buildPythonApplication;
|
||||||
inherit fetchPypi callPackage;
|
inherit fetchPypi callPackage;
|
||||||
inherit sharedLibraryExtension;
|
|
||||||
|
|
||||||
# helpers
|
# helpers
|
||||||
|
|
||||||
|
@ -11689,7 +11685,7 @@ in {
|
||||||
propagatedBuildInputs = with self; [ pkgs.file ];
|
propagatedBuildInputs = with self; [ pkgs.file ];
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
substituteInPlace magic.py --replace "ctypes.util.find_library('magic')" "'${pkgs.file}/lib/libmagic.${if stdenv.isDarwin then "dylib" else "so"}'"
|
substituteInPlace magic.py --replace "ctypes.util.find_library('magic')" "'${pkgs.file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
@ -11711,7 +11707,7 @@ in {
|
||||||
src = pkgs.file.src;
|
src = pkgs.file.src;
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
substituteInPlace python/magic.py --replace "find_library('magic')" "'${pkgs.file}/lib/libmagic.${if stdenv.isDarwin then "dylib" else "so"}'"
|
substituteInPlace python/magic.py --replace "find_library('magic')" "'${pkgs.file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = with self; [ pkgs.file ];
|
buildInputs = with self; [ pkgs.file ];
|
||||||
|
@ -24228,11 +24224,8 @@ EOF
|
||||||
|
|
||||||
# Fix the USB backend library lookup
|
# Fix the USB backend library lookup
|
||||||
postPatch =
|
postPatch =
|
||||||
let
|
''
|
||||||
# This should really be in the stdenv somewhere
|
libusb=${pkgs.libusb1.out}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||||
soext = if stdenv.isLinux then "so" else if stdenv.isDarwin then "dylib" else throw "Unsupported platform";
|
|
||||||
in ''
|
|
||||||
libusb=${pkgs.libusb1.out}/lib/libusb-1.0.${soext}
|
|
||||||
test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; }
|
test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; }
|
||||||
sed -i -e "s|find_library=None|find_library=lambda _:\"$libusb\"|" usb/backend/libusb1.py
|
sed -i -e "s|find_library=None|find_library=lambda _:\"$libusb\"|" usb/backend/libusb1.py
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue