python2*: fix detecting C libs, no header references
This commit is contained in:
parent
4b1392fb07
commit
4101db0bec
2 changed files with 23 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, includeModules ? false
|
{ stdenv, fetchurl, pkgconfig, zlib ? null, zlibSupport ? true, bzip2, includeModules ? false
|
||||||
, sqlite, tcl, tk, x11, openssl, readline, db, ncurses, gdbm, self, callPackage }:
|
, sqlite, tcl, tk, x11, openssl, readline, db, ncurses, gdbm, self, callPackage }:
|
||||||
|
|
||||||
assert zlibSupport -> zlib != null;
|
assert zlibSupport -> zlib != null;
|
||||||
|
@ -48,9 +48,13 @@ let
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
|
optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
|
||||||
[ bzip2 openssl ]++ optionals includeModules [ db openssl ncurses gdbm readline x11 tcl tk sqlite ]
|
[ pkgconfig bzip2 openssl ]++ optionals includeModules [ db openssl ncurses gdbm readline x11 tcl tk sqlite ]
|
||||||
++ optional zlibSupport zlib;
|
++ optional zlibSupport zlib;
|
||||||
|
|
||||||
|
mkPaths = paths: {
|
||||||
|
C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p.dev or p}/include") buildInputs);
|
||||||
|
LIBRARY_PATH = concatStringsSep ":" (map (p: "${p.lib or (p.out or p)}/lib") buildInputs);
|
||||||
|
};
|
||||||
|
|
||||||
# Build the basic Python interpreter without modules that have
|
# Build the basic Python interpreter without modules that have
|
||||||
# external dependencies.
|
# external dependencies.
|
||||||
|
@ -60,8 +64,7 @@ let
|
||||||
|
|
||||||
inherit majorVersion version src patches buildInputs preConfigure;
|
inherit majorVersion version src patches buildInputs preConfigure;
|
||||||
|
|
||||||
C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs);
|
inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH;
|
||||||
LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs);
|
|
||||||
|
|
||||||
configureFlags = "--enable-shared --with-threads --enable-unicode";
|
configureFlags = "--enable-shared --with-threads --enable-unicode";
|
||||||
|
|
||||||
|
@ -83,10 +86,12 @@ let
|
||||||
ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb${majorVersion}
|
ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb${majorVersion}
|
||||||
mv $out/share/man/man1/{python.1,python2.6.1}
|
mv $out/share/man/man1/{python.1,python2.6.1}
|
||||||
ln -s $out/share/man/man1/{python2.6.1,python.1}
|
ln -s $out/share/man/man1/{python2.6.1,python.1}
|
||||||
|
|
||||||
paxmark E $out/bin/python${majorVersion}
|
paxmark E $out/bin/python${majorVersion}
|
||||||
|
|
||||||
${ optionalString includeModules "$out/bin/python ./setup.py build_ext"}
|
${ optionalString includeModules "$out/bin/python ./setup.py build_ext"}
|
||||||
|
|
||||||
|
rm "$out/lib/python2.7/plat-linux2/regen" # refers to glibc.dev
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = rec {
|
passthru = rec {
|
||||||
|
@ -135,8 +140,7 @@ let
|
||||||
|
|
||||||
buildInputs = [ python ] ++ deps;
|
buildInputs = [ python ] ++ deps;
|
||||||
|
|
||||||
C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs);
|
inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH;
|
||||||
LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs);
|
|
||||||
|
|
||||||
buildPhase =
|
buildPhase =
|
||||||
''
|
''
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchurl, self, callPackage
|
{ stdenv, fetchurl, pkgconfig, self, callPackage
|
||||||
, bzip2, openssl
|
, bzip2, openssl
|
||||||
|
|
||||||
, includeModules ? false
|
, includeModules ? false
|
||||||
|
@ -60,13 +60,18 @@ let
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
|
optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
|
||||||
[ bzip2 openssl ]
|
[ pkgconfig bzip2 openssl ]
|
||||||
++ optionals includeModules (
|
++ optionals includeModules (
|
||||||
[ db gdbm ncurses sqlite readline
|
[ db gdbm ncurses sqlite readline
|
||||||
] ++ optionals x11Support [ tcl tk x11 libX11 ]
|
] ++ optionals x11Support [ tcl tk x11 libX11 ]
|
||||||
)
|
)
|
||||||
++ optional zlibSupport zlib;
|
++ optional zlibSupport zlib;
|
||||||
|
|
||||||
|
mkPaths = paths: {
|
||||||
|
C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p.dev or p}/include") buildInputs);
|
||||||
|
LIBRARY_PATH = concatStringsSep ":" (map (p: "${p.lib or (p.out or p)}/lib") buildInputs);
|
||||||
|
};
|
||||||
|
|
||||||
# Build the basic Python interpreter without modules that have
|
# Build the basic Python interpreter without modules that have
|
||||||
# external dependencies.
|
# external dependencies.
|
||||||
python = stdenv.mkDerivation {
|
python = stdenv.mkDerivation {
|
||||||
|
@ -76,8 +81,7 @@ let
|
||||||
inherit majorVersion version src patches buildInputs preConfigure;
|
inherit majorVersion version src patches buildInputs preConfigure;
|
||||||
|
|
||||||
LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
|
LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
|
||||||
C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs);
|
inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH;
|
||||||
LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs);
|
|
||||||
|
|
||||||
configureFlags = "--enable-shared --with-threads --enable-unicode";
|
configureFlags = "--enable-shared --with-threads --enable-unicode";
|
||||||
|
|
||||||
|
@ -105,6 +109,8 @@ let
|
||||||
paxmark E $out/bin/python${majorVersion}
|
paxmark E $out/bin/python${majorVersion}
|
||||||
|
|
||||||
${ optionalString includeModules "$out/bin/python ./setup.py build_ext"}
|
${ optionalString includeModules "$out/bin/python ./setup.py build_ext"}
|
||||||
|
|
||||||
|
rm "$out/lib/python2.7/plat-linux2/regen" # refers to glibc.dev
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = rec {
|
passthru = rec {
|
||||||
|
@ -153,8 +159,7 @@ let
|
||||||
|
|
||||||
buildInputs = [ python ] ++ deps;
|
buildInputs = [ python ] ++ deps;
|
||||||
|
|
||||||
C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs);
|
inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH;
|
||||||
LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs);
|
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
substituteInPlace setup.py --replace 'self.extensions = extensions' \
|
substituteInPlace setup.py --replace 'self.extensions = extensions' \
|
||||||
|
|
Loading…
Reference in a new issue