Merge pull request #147192 from risicle/ris-pyeclib-darwin
This commit is contained in:
commit
a141e6eab6
1 changed files with 9 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ lib, buildPythonPackage, fetchPypi, liberasurecode, six }:
|
{ lib, stdenv, buildPythonPackage, fetchPypi, liberasurecode, six }:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "pyeclib";
|
pname = "pyeclib";
|
||||||
|
@ -13,11 +13,16 @@ buildPythonPackage rec {
|
||||||
# patch dlopen call
|
# patch dlopen call
|
||||||
substituteInPlace src/c/pyeclib_c/pyeclib_c.c \
|
substituteInPlace src/c/pyeclib_c/pyeclib_c.c \
|
||||||
--replace "liberasurecode.so" "${liberasurecode}/lib/liberasurecode.so"
|
--replace "liberasurecode.so" "${liberasurecode}/lib/liberasurecode.so"
|
||||||
|
# python's platform.platform() doesn't return "Darwin" (anymore?)
|
||||||
|
substituteInPlace setup.py \
|
||||||
|
--replace '"Darwin"' '"macOS"'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preBuild = ''
|
preBuild = let
|
||||||
# required for the custom find_library function in setup.py
|
ldLibraryPathEnvName = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
|
||||||
export LD_LIBRARY_PATH="${lib.makeLibraryPath [ liberasurecode ]}"
|
in ''
|
||||||
|
# required for the custom _find_library function in setup.py
|
||||||
|
export ${ldLibraryPathEnvName}="${lib.makeLibraryPath [ liberasurecode ]}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [ liberasurecode ];
|
buildInputs = [ liberasurecode ];
|
||||||
|
|
Loading…
Reference in a new issue