Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r97952:05b20def3304
Date: 2019-11-04 12:55 -0500
http://bitbucket.org/pypy/pypy/changeset/05b20def3304/
Log: merge default into py3.6
diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py
--- a/lib_pypy/_curses_build.py
+++ b/lib_pypy/_curses_build.py
@@ -1,4 +1,4 @@
-from cffi import FFI
+from cffi import FFI, VerificationError
import os
version_str = '''
@@ -6,13 +6,18 @@
static const int NCURSES_VERSION_MINOR;
'''
+version = (0, 0)
def find_library(options):
+ global version
for library in options:
ffi = FFI()
ffi.cdef(version_str)
ffi.set_source("_curses_cffi_check", version_str, libraries=[library])
try:
- lib = ffi.compile()
+ ffi.compile()
+ import _curses_cffi_check
+ lib = _curses_cffi_check.lib
+ version = (lib.NCURSES_VERSION_MAJOR, lib.NCURSES_VERSION_MINOR)
except VerificationError as e:
e_last = e
continue
@@ -82,9 +87,6 @@
find_library(['panel', 'panelw'])],
include_dirs=find_curses_include_dirs())
-import _curses_cffi_check
-lib = _curses_cffi_check.lib
-version = (lib.NCURSES_VERSION_MAJOR, lib.NCURSES_VERSION_MINOR)
ffi.cdef("""
typedef ... WINDOW;
@@ -167,11 +169,11 @@
int setupterm(char *, int, int *);
-WINDOW *stdscr;
-int COLORS;
-int COLOR_PAIRS;
-int COLS;
-int LINES;
+extern WINDOW *stdscr;
+extern int COLORS;
+extern int COLOR_PAIRS;
+extern int COLS;
+extern int LINES;
int baudrate(void);
int beep(void);
@@ -347,7 +349,7 @@
#define _m_NetBSD ...
int _m_ispad(WINDOW *);
-chtype acs_map[];
+extern chtype acs_map[];
// For _curses_panel:
diff --git a/pypy/tool/release/make_portable.py
b/pypy/tool/release/make_portable.py
--- a/pypy/tool/release/make_portable.py
+++ b/pypy/tool/release/make_portable.py
@@ -73,7 +73,7 @@
def make_portable():
binaries = glob('bin/libpypy*.so')
if not binaries:
- raise ValueError('Could not find bin/libpypy*.so')
+ raise ValueError('Could not find bin/libpypy*.so in "%s"' %
os.getcwd())
binaries.extend(glob('lib_pypy/*_cffi.pypy*.so'))
binaries.extend(glob('lib_pypy/_pypy_openssl*.so'))
binaries.extend(glob('lib_pypy/_tkinter/*_cffi.pypy*.so'))
diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py
--- a/pypy/tool/release/package.py
+++ b/pypy/tool/release/package.py
@@ -248,7 +248,11 @@
# make the package portable by adding rpath=$ORIGIN/..lib,
# bundling dependencies
if options.make_portable:
+ os.chdir(str(name))
+ if not os.path.exists('lib'):
+ os.mkdir('lib')
make_portable()
+ os.chdir(str(builddir))
if USE_ZIPFILE_MODULE:
import zipfile
archive = str(builddir.join(name + '.zip'))
@@ -332,11 +336,10 @@
default=(sys.platform == 'darwin'),
help='whether to embed dependencies in CFFI modules '
'(default on OS X)')
- parser.add_argument('--make-portable', '--no-make-portable',
+ parser.add_argument('--make-portable',
dest='make_portable',
- action=NegateAction,
- default=(platform.linux_distribution() in ('CentOS',)),
- help='whether to make the package portable by shipping
'
+ action='store_true',
+ help='make the package portable by shipping '
'dependent shared objects and mangling RPATH')
options = parser.parse_args(args)
@@ -349,9 +352,7 @@
elif os.environ.has_key("PYPY_NO_EMBED_DEPENDENCIES"):
options.embed_dependencies = False
if os.environ.has_key("PYPY_MAKE_PORTABLE"):
- options.embed_dependencies = True
- elif os.environ.has_key("PYPY_NO_MAKE_PORTABLE"):
- options.embed_dependencies = False
+ options.make_portable = True
if not options.builddir:
# The import actually creates the udir directory
from rpython.tool.udir import udir
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit