summaryrefslogtreecommitdiff
path: root/source/d/python2
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/python2')
-rw-r--r--source/d/python2/python.no-static-library.diff49
-rw-r--r--source/d/python2/python.readline.set_pre_input_hook.diff12
-rw-r--r--source/d/python2/python.url1
-rw-r--r--source/d/python2/python.x86_64.diff174
-rwxr-xr-xsource/d/python2/python2.SlackBuild183
-rw-r--r--source/d/python2/slack-desc19
6 files changed, 438 insertions, 0 deletions
diff --git a/source/d/python2/python.no-static-library.diff b/source/d/python2/python.no-static-library.diff
new file mode 100644
index 00000000..96209897
--- /dev/null
+++ b/source/d/python2/python.no-static-library.diff
@@ -0,0 +1,49 @@
+--- ./Makefile.pre.in.orig 2012-04-09 18:07:33.000000000 -0500
++++ ./Makefile.pre.in 2012-05-09 13:38:24.913226185 -0500
+@@ -396,7 +396,7 @@
+
+
+ # Build the interpreter
+-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
++$(BUILDPYTHON): Modules/python.o $(LDLIBRARY)
+ $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
+ Modules/python.o \
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+@@ -412,18 +412,6 @@
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ esac
+
+-# Build static library
+-# avoid long command lines, same as LIBRARY_OBJS
+-$(LIBRARY): $(LIBRARY_OBJS)
+- -rm -f $@
+- $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
+- $(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
+- $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
+- $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
+- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
+- $(AR) $(ARFLAGS) $@ $(MODOBJS)
+- $(RANLIB) $@
+-
+ libpython$(VERSION).so: $(LIBRARY_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+@@ -1008,18 +996,6 @@
+ else true; \
+ fi; \
+ done
+- @if test -d $(LIBRARY); then :; else \
+- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+- if test "$(SO)" = .dll; then \
+- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
+- else \
+- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+- fi; \
+- else \
+- echo Skip install of $(LIBRARY) - use make frameworkinstall; \
+- fi; \
+- fi
+ $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+ $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
+ $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff --git a/source/d/python2/python.readline.set_pre_input_hook.diff b/source/d/python2/python.readline.set_pre_input_hook.diff
new file mode 100644
index 00000000..8af4b4be
--- /dev/null
+++ b/source/d/python2/python.readline.set_pre_input_hook.diff
@@ -0,0 +1,12 @@
+--- ./Modules/readline.c.orig 2008-11-04 14:43:31.000000000 -0600
++++ ./Modules/readline.c 2009-06-09 14:23:16.000000000 -0500
+@@ -11,6 +11,9 @@
+ #include <errno.h>
+ #include <sys/time.h>
+
++/* This seems to be needed for set_pre_input_hook to work */
++#define HAVE_RL_PRE_INPUT_HOOK 1
++
+ #if defined(HAVE_SETLOCALE)
+ /* GNU readline() mistakenly sets the LC_CTYPE locale.
+ * This is evil. Only the user or the app's main() should do this!
diff --git a/source/d/python2/python.url b/source/d/python2/python.url
new file mode 100644
index 00000000..8738d0b1
--- /dev/null
+++ b/source/d/python2/python.url
@@ -0,0 +1 @@
+http://www.python.org/ftp/python/
diff --git a/source/d/python2/python.x86_64.diff b/source/d/python2/python.x86_64.diff
new file mode 100644
index 00000000..55cdf499
--- /dev/null
+++ b/source/d/python2/python.x86_64.diff
@@ -0,0 +1,174 @@
+--- ./Makefile.pre.in.orig 2016-12-17 14:05:06.000000000 -0600
++++ ./Makefile.pre.in 2016-12-28 13:17:09.089663880 -0600
+@@ -111,7 +111,7 @@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/lib64
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+--- ./Lib/sysconfig.py.orig 2016-12-17 14:05:06.000000000 -0600
++++ ./Lib/sysconfig.py 2016-12-28 13:17:09.086663880 -0600
+@@ -7,20 +7,20 @@
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{base}/lib/python{py_version_short}',
+- 'platstdlib': '{platbase}/lib/python{py_version_short}',
+- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
++ 'stdlib': '{base}/lib64/python{py_version_short}',
++ 'platstdlib': '{platbase}/lib64/python{py_version_short}',
++ 'purelib': '{base}/lib64/python{py_version_short}/site-packages',
++ 'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
+ 'include': '{base}/include/python{py_version_short}',
+ 'platinclude': '{platbase}/include/python{py_version_short}',
+ 'scripts': '{base}/bin',
+ 'data': '{base}',
+ },
+ 'posix_home': {
+- 'stdlib': '{base}/lib/python',
+- 'platstdlib': '{base}/lib/python',
+- 'purelib': '{base}/lib/python',
+- 'platlib': '{base}/lib/python',
++ 'stdlib': '{base}/lib64/python',
++ 'platstdlib': '{base}/lib64/python',
++ 'purelib': '{base}/lib64/python',
++ 'platlib': '{base}/lib64/python',
+ 'include': '{base}/include/python',
+ 'platinclude': '{base}/include/python',
+ 'scripts': '{base}/bin',
+@@ -65,10 +65,10 @@
+ 'data' : '{userbase}',
+ },
+ 'posix_user': {
+- 'stdlib': '{userbase}/lib/python{py_version_short}',
+- 'platstdlib': '{userbase}/lib/python{py_version_short}',
+- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'stdlib': '{userbase}/lib64/python{py_version_short}',
++ 'platstdlib': '{userbase}/lib64/python{py_version_short}',
++ 'purelib': '{userbase}/lib64/python{py_version_short}/site-packages',
++ 'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+ 'data' : '{userbase}',
+--- ./Lib/site.py.orig 2016-12-17 14:05:06.000000000 -0600
++++ ./Lib/site.py 2016-12-28 13:19:06.612662631 -0600
+@@ -288,13 +288,13 @@
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+ elif os.sep == '/':
+- sitepackages.append(os.path.join(prefix, "lib",
++ sitepackages.append(os.path.join(prefix, "lib64",
+ "python" + sys.version[:3],
+ "site-packages"))
+- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++ sitepackages.append(os.path.join(prefix, "lib64", "site-python"))
+ else:
+ sitepackages.append(prefix)
+- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++ sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
+ return sitepackages
+
+ def addsitepackages(known_paths):
+--- ./Lib/distutils/command/install.py.orig 2016-12-17 14:05:05.000000000 -0600
++++ ./Lib/distutils/command/install.py 2016-12-28 13:17:09.079663880 -0600
+@@ -41,15 +41,15 @@
+
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+- 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
++ 'purelib': '$base/lib64/python$py_version_short/site-packages',
++ 'platlib': '$platbase/lib64/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
+ 'unix_home': {
+- 'purelib': '$base/lib/python',
+- 'platlib': '$base/lib/python',
++ 'purelib': '$base/lib64/python',
++ 'platlib': '$base/lib64/python',
+ 'headers': '$base/include/python/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+--- ./Lib/distutils/sysconfig.py.orig 2016-12-17 14:05:05.000000000 -0600
++++ ./Lib/distutils/sysconfig.py 2016-12-28 13:17:09.081663880 -0600
+@@ -120,7 +120,7 @@
+
+ if os.name == "posix":
+ libpython = os.path.join(prefix,
+- "lib", "python" + get_python_version())
++ "lib64", "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+--- ./Modules/getpath.c.orig 2016-12-17 14:05:07.000000000 -0600
++++ ./Modules/getpath.c 2016-12-28 13:17:09.093663880 -0600
+@@ -108,7 +108,7 @@
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = "lib64/python" VERSION;
+
+ static void
+ reduce(char *dir)
+@@ -520,7 +520,7 @@
+ }
+ else
+ strncpy(zip_path, PREFIX, MAXPATHLEN);
+- joinpath(zip_path, "lib/python00.zip");
++ joinpath(zip_path, "lib64/python00.zip");
+ bufsz = strlen(zip_path); /* Replace "00" with version */
+ zip_path[bufsz - 6] = VERSION[0];
+ zip_path[bufsz - 5] = VERSION[2];
+@@ -530,7 +530,7 @@
+ fprintf(stderr,
+ "Could not find platform dependent libraries <exec_prefix>\n");
+ strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
+- joinpath(exec_prefix, "lib/lib-dynload");
++ joinpath(exec_prefix, "lib64/lib-dynload");
+ }
+ /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
+
+--- ./setup.py.orig 2016-12-17 14:05:07.000000000 -0600
++++ ./setup.py 2016-12-28 13:17:09.097663880 -0600
+@@ -456,7 +456,7 @@
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+ if not cross_compiling:
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ if cross_compiling:
+ self.add_gcc_paths()
+@@ -782,11 +782,11 @@
+ elif curses_library:
+ readline_libs.append(curses_library)
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/lib64/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/lib64/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
+@@ -821,8 +821,8 @@
+ if krb5_h:
+ ssl_incs += krb5_h
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
+- '/usr/contrib/ssl/lib/'
++ ['/usr/local/ssl/lib64',
++ '/usr/contrib/ssl/lib64/'
+ ] )
+
+ if (ssl_incs is not None and
diff --git a/source/d/python2/python2.SlackBuild b/source/d/python2/python2.SlackBuild
new file mode 100755
index 00000000..b4698415
--- /dev/null
+++ b/source/d/python2/python2.SlackBuild
@@ -0,0 +1,183 @@
+#!/bin/bash
+
+# Copyright 2008, 2009, 2012, 2013, 2016, 2018, 2020 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=python2
+SRCNAM=Python
+VERSION=$(echo $SRCNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)
+BRANCH_VERSION=$(echo $VERSION | cut -f 1,2 -d . )
+BUILD=${BUILD:-1}
+
+NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i586 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+# Don't set any SLKCFLAGS here, or OPT="$SLKCFLAGS" before the ./configure.
+# Python gets the compile options right without any help.
+if [ "$ARCH" = "i586" ]; then
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "arm" ]; then
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "armel" ]; then
+ LIBDIRSUFFIX=""
+fi
+
+# Location for Python site-packages:
+SITEPK=$PKG/usr/lib${LIBDIRSUFFIX}/python${BRANCH_VERSION}/site-packages
+# same as above without $PKG
+TOOLSDIR=/usr/lib${LIBDIRSUFFIX}/python${BRANCH_VERSION}/site-packages
+
+cd $TMP
+rm -rf $SRCNAM-$VERSION
+tar xf $CWD/$SRCNAM-$VERSION.tar.xz || exit 1
+cd $SRCNAM-$VERSION || exit 1
+
+zcat $CWD/python.readline.set_pre_input_hook.diff.gz | patch -p1 --verbose || exit 1
+# We don't want a large libpython*.a:
+zcat $CWD/python.no-static-library.diff.gz | patch -p1 --verbose || exit 1
+
+if [ "$ARCH" = "x86_64" ]; then
+ # Install to lib64 instead of lib and
+ # Python must report /usr/lib64/python2.7/site-packages as python_lib_dir:
+ zcat $CWD/python.x86_64.diff.gz | patch -p1 --verbose || exit 1
+fi
+
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \+ -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \+
+
+# Enable built-in SQLite module to load extensions
+sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py
+
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/python2-$VERSION \
+ --with-threads \
+ --enable-ipv6 \
+ --enable-shared \
+ --enable-unicode=ucs4 \
+ --with-system-expat \
+ --with-system-ffi \
+ --without-ensurepip \
+ --build=$ARCH-slackware-linux || exit 1
+
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Install some python-demo files:
+mkdir -p $PKG/usr/doc/python2-$VERSION
+cp -a Demo $PKG/usr/doc/python2-$VERSION
+
+# We'll install the python-tools under site-packages:
+mkdir -p $SITEPK
+cp -a Tools/* $SITEPK
+
+mkdir -p $PKG/usr/doc/python2-$VERSION
+mv $SITEPK/README $PKG/usr/doc/python2-$VERSION/README.python-tools
+( cd $PKG/usr/doc/python2-$VERSION
+ ln -sf $TOOLSDIR Tools
+)
+
+# Make a few useful symlinks:
+mkdir -p $PKG/usr/bin
+( cd $PKG/usr/bin
+ ln -sf $TOOLSDIR/pynche/pynche pynche
+ ln -sf $TOOLSDIR/i18n/msgfmt.py .
+ ln -sf $TOOLSDIR/i18n/pygettext.py .
+)
+
+# Install docs:
+mkdir -p $PKG/usr/doc/python2-$VERSION/Documentation
+cp -a README LICENSE $PKG/usr/doc/python2-$VERSION
+cp -a Misc $PKG/usr/doc/python2-$VERSION
+tar xf $CWD/python-$VERSION-docs-text.tar.?z*
+mv python-${VERSION}-docs-text/* $PKG/usr/doc/python2-$VERSION/Documentation
+chown -R root:root $PKG/usr/doc/python2-$VERSION
+
+# Fix possible incorrect permissions:
+( cd $PKG
+ find . -type d -exec chmod 755 "{}" \+
+ find . -perm 640 -exec chmod 644 "{}" \+
+ find . -perm 750 -exec chmod 755 "{}" \+
+)
+
+
+( cd $PKG/usr/bin
+ rm -f python
+ ln -sf python${BRANCH_VERSION} python
+)
+
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+)
+
+( cd $PKG/usr/man
+ find . -type f -exec gzip -9 {} \+
+ for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
+)
+
+( cd $PKG/usr/man
+ if [ -r python${BRANCH_VERSION}.1.gz ] ; then
+ ln -sf python${BRANCH_VERSION}.1.gz python.1.gz
+ fi
+)
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/python2-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/source/d/python2/slack-desc b/source/d/python2/slack-desc
new file mode 100644
index 00000000..05d05ac1
--- /dev/null
+++ b/source/d/python2/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+python2: python2 (object-oriented interpreted programming language, v2)
+python2:
+python2: Python is an interpreted, interactive, object-oriented programming
+python2: language that combines remarkable power with very clear syntax.
+python2: Python's basic power can be extended with your own modules written in
+python2: C or C++. Python is also adaptable as an extension language for
+python2: existing applications.
+python2:
+python2: Homepage: http://www.python.org
+python2:
+python2: