python2: copy stub library to output on cygwin

This commit is contained in:
David McFarland 2017-05-23 10:35:52 -03:00
parent f254af9c19
commit 087c32715b

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl { stdenv, hostPlatform, fetchurl
, bzip2 , bzip2
, gdbm , gdbm
, fetchpatch , fetchpatch
@ -69,7 +69,7 @@ let
./glibc-2.25-enosys.patch ./glibc-2.25-enosys.patch
] ++ optionals stdenv.isCygwin [ ] ++ optionals hostPlatform.isCygwin [
./2.5.2-ctypes-util-find_library.patch ./2.5.2-ctypes-util-find_library.patch
./2.5.2-tkinter-x11.patch ./2.5.2-tkinter-x11.patch
./2.6.2-ssl-threads.patch ./2.6.2-ssl-threads.patch
@ -110,7 +110,7 @@ let
"--enable-shared" "--enable-shared"
"--with-threads" "--with-threads"
"--enable-unicode=ucs4" "--enable-unicode=ucs4"
] ++ optionals stdenv.isCygwin [ ] ++ optionals hostPlatform.isCygwin [
"--with-system-ffi" "--with-system-ffi"
"--with-system-expat" "--with-system-expat"
"ac_cv_func_bind_textdomain_codeset=yes" "ac_cv_func_bind_textdomain_codeset=yes"
@ -118,14 +118,14 @@ let
"--disable-toolbox-glue" "--disable-toolbox-glue"
]; ];
postConfigure = if stdenv.isCygwin then '' postConfigure = if hostPlatform.isCygwin then ''
sed -i Makefile -e 's,PYTHONPATH="$(srcdir),PYTHONPATH="$(abs_srcdir),' sed -i Makefile -e 's,PYTHONPATH="$(srcdir),PYTHONPATH="$(abs_srcdir),'
'' else null; '' else null;
buildInputs = buildInputs =
optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++ optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
[ bzip2 openssl zlib ] [ bzip2 openssl zlib ]
++ optionals stdenv.isCygwin [ expat libffi ] ++ optionals hostPlatform.isCygwin [ expat libffi ]
++ [ db gdbm ncurses sqlite readline ] ++ [ db gdbm ncurses sqlite readline ]
++ optionals x11Support [ tcl tk xlibsWrapper libX11 ] ++ optionals x11Support [ tcl tk xlibsWrapper libX11 ]
++ optionals stdenv.isDarwin [ CF configd ]; ++ optionals stdenv.isDarwin [ CF configd ];
@ -190,6 +190,8 @@ in stdenv.mkDerivation {
find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i - find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i -
find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i - find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i -
find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i - find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i -
'' + optionalString hostPlatform.isCygwin ''
cp libpython2.7.dll.a $out/lib
''; '';
passthru = let passthru = let