pypy: fix build on darwin

This commit is contained in:
Mario Rodas 2019-10-26 04:20:00 -05:00
parent 9e9095c8e3
commit 0f8dc3cc2e
No known key found for this signature in database
GPG key ID: 4C4BEFD7B18DC5E8
3 changed files with 22 additions and 5 deletions

View file

@ -158,9 +158,11 @@ in {
};
sha256 = "0yq6ln1ic476sasp8zs4mg5i9524l1p96qwanp486rr1yza1grlg";
pythonVersion = "2.7";
db = db.override { dbmSupport = true; };
db = db.override { dbmSupport = !stdenv.isDarwin; };
python = python27;
inherit passthruFun;
inherit (darwin) libunwind;
inherit (darwin.apple_sdk.frameworks) Security;
};
pypy36 = callPackage ./pypy {
@ -172,9 +174,11 @@ in {
};
sha256 = "1hqvnran7d2dzj5555n7q680dyzhmbklz04pvkxgb5j604v7kkx1";
pythonVersion = "3.6";
db = db.override { dbmSupport = true; };
db = db.override { dbmSupport = !stdenv.isDarwin; };
python = python27;
inherit passthruFun;
inherit (darwin) libunwind;
inherit (darwin.apple_sdk.frameworks) Security;
};
pypy27_prebuilt = callPackage ./pypy/prebuilt.nix {

View file

@ -1,5 +1,5 @@
{ stdenv, substituteAll, fetchurl
, zlib ? null, zlibSupport ? true, bzip2, pkgconfig, libffi
, zlib ? null, zlibSupport ? true, bzip2, pkgconfig, libffi, libunwind, Security
, sqlite, openssl_1_0_2, ncurses, python, expat, tcl, tk, tix, xlibsWrapper, libX11
, self, gdbm, db, lzma
, python-setup-hook
@ -47,6 +47,8 @@ in with passthru; stdenv.mkDerivation rec {
stdenv.cc.libc
] ++ optionals zlibSupport [
zlib
] ++ optionals stdenv.isDarwin [
libunwind Security
];
hardeningDisable = optional stdenv.isi686 "pic";
@ -127,13 +129,17 @@ in with passthru; stdenv.mkDerivation rec {
mkdir -p $out/{bin,include,lib,${executable}-c}
cp -R {include,lib_pypy,lib-python,${executable}-c} $out/${executable}-c
cp lib${executable}-c.so $out/lib/
cp lib${executable}-c${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/
ln -s $out/${executable}-c/${executable}-c $out/bin/${executable}
# other packages expect to find stuff according to libPrefix
ln -s $out/${executable}/include $out/include/${libPrefix}
ln -s $out/${executable}-c/lib-python/${if isPy3k then "3" else pythonVersion} $out/lib/${libPrefix}
${stdenv.lib.optionalString stdenv.isDarwin ''
install_name_tool -change @rpath/libpypy${optionalString isPy3k "3"}-c.dylib $out/lib/libpypy${optionalString isPy3k "3"}-c.dylib $out/bin/${executable}
''}
# verify cffi modules
$out/bin/${executable} -c ${if isPy3k then "'import tkinter;import sqlite3;import curses;import lzma'" else "'import Tkinter;import sqlite3;import curses'"}

View file

@ -1,6 +1,13 @@
--- pypy-pypy-84a2f3e6a7f8.org/lib_pypy/_tkinter/tklib_build.py 2017-10-03 11:49:20.000000000 +0100
+++ pypy-pypy-84a2f3e6a7f8/lib_pypy/_tkinter/tklib_build.py 2017-11-21 13:20:51.398607530 +0000
@@ -24,11 +24,11 @@
@@ -17,18 +17,14 @@
incdirs = []
linklibs = ['tcl85', 'tk85']
libdirs = []
-elif sys.platform == 'darwin':
- incdirs = ['/System/Library/Frameworks/Tk.framework/Versions/Current/Headers/']
- linklibs = ['tcl', 'tk']
- libdirs = []
else:
# On some Linux distributions, the tcl and tk libraries are
# stored in /usr/include, so we must check this case also