diff --git a/packages/ciphey/PKGBUILD b/packages/ciphey/PKGBUILD new file mode 100644 index 00000000000..a04128877b0 --- /dev/null +++ b/packages/ciphey/PKGBUILD @@ -0,0 +1,39 @@ +# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). +# See COPYING for license details. + +pkgname=ciphey +pkgver=5.14.0 +pkgrel=1 +pkgdesc='Automatically decrypt encryptions without knowing the key or cipher, decode encodings, and crack hashes.' +arch=('any') +groups=('blackarch' 'blackarch-cracker' 'blackarch-crypto') +url='https://github.com/Ciphey/Ciphey' +license=('MIT') +depends=('flake8' 'python' 'python37' 'python-appdirs' 'python-base58' 'python-base91' 'python-cipheycore' 'python-cipheydists' 'python-click' 'python-pylint' 'python-loguru' 'python-mock' 'python-pyyaml' 'python-pybase62' 'python-pywhat' 'python-rich' 'python-typing_inspect' 'python-xortool-ciphey') +makedepends=('python-poetry-core') +options=(!emptydirs) +source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz") +sha512sums=('3dee0b9812beab2ff2ceddf06e58531fd8bda36c8cc5f6615b4e9368ad86baccc95fe5dfb76e5cfb330265957107fb9b63fb09c43a43fb146567461a4a7cf490') + +build() { + cd "$pkgname-$pkgver" + + python -m build --wheel --outdir="$startdir/dist" +} + +package() { + cd "$pkgname-$pkgver" + + pip install \ + --verbose \ + --disable-pip-version-check \ + --no-warn-script-location \ + --ignore-installed \ + --no-compile \ + --no-deps \ + --root="$pkgdir" \ + --prefix=/usr \ + --no-index \ + --find-links="file://$startdir/dist" \ + "$pkgname" +} diff --git a/packages/python-base91/PKGBUILD b/packages/python-base91/PKGBUILD new file mode 100644 index 00000000000..1fd74a326af --- /dev/null +++ b/packages/python-base91/PKGBUILD @@ -0,0 +1,28 @@ +# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). +# See COPYING for license details. + +pkgname=python-base91 +_pkgname=${pkgname#python-} +pkgver=1.0.1 +pkgrel=1 +pkgdesc='A Python implementation of Base91.' +arch=('any') +url='http://base91.sourceforge.net' +license=('BSD') +depends=('python') +makedepends=('python-setuptools') +options=(!emptydirs) +source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz") +sha512sums=('86c6e0e6dc19533ec1212da8f05caa7fdbdee8f003b7d70f513c4c4f682cd94e7db327896bbcd94c157c5f13cd24fb3213bf41b1daa3ab19c528c9be1f1231c6') + +build() { + cd "$_pkgname-$pkgver" + + python setup.py build +} + +package() { + cd "$_pkgname-$pkgver" + + python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build +} diff --git a/packages/python-cipheycore/PKGBUILD b/packages/python-cipheycore/PKGBUILD new file mode 100644 index 00000000000..36c5de0a8c5 --- /dev/null +++ b/packages/python-cipheycore/PKGBUILD @@ -0,0 +1,56 @@ +# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). +# See COPYING for license details. + +pkgname=python-cipheycore +_pkgname=${pkgname#python-} +pkgver=v0.3.2.r2.g63cc5fa +pkgrel=1 +pkgdesc='Some cryptanalysis tidbits written in a proper language.' +arch=('any') +url='https://github.com/Ciphey/CipheyCore' +license=('MIT') +depends=('python') +makedepends=('boost' 'cmake' 'gcc' 'git' 'make' 'python-poetry' 'swig') +source=("git+https://github.com/Ciphey/$_pkgname.git") +sha512sums=('SKIP') + +pkgver() { + cd $_pkgname + + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + cd $_pkgname + + # https://github.com/Ciphey/CipheyCore/pull/22 + sed -i "4i #include " src/ciphers/xor_single.cpp +} + +build() { + cd $_pkgname + + mkdir -p build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Release -DCIPHEY_CORE_TEST=OFF + cmake --build . -t ciphey_core + cmake --build . -t ciphey_core_py --config Release + poetry build +} + +package() { + cd $_pkgname + + pip install \ + --verbose \ + --disable-pip-version-check \ + --no-warn-script-location \ + --ignore-installed \ + --no-compile \ + --no-deps \ + --root="$pkgdir" \ + --prefix=/usr \ + --no-index \ + --find-links="file://$srcdir/$_pkgname/build/dist" \ + "$_pkgname" +} diff --git a/packages/python-cipheydists/PKGBUILD b/packages/python-cipheydists/PKGBUILD new file mode 100644 index 00000000000..97d0a1302a8 --- /dev/null +++ b/packages/python-cipheydists/PKGBUILD @@ -0,0 +1,39 @@ +# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). +# See COPYING for license details. + +pkgname=python-cipheydists +_pkgname=${pkgname#python-} +pkgver=0.3.35 +pkgrel=1 +pkgdesc='Distributions for frequency analysis.' +arch=('any') +url='https://github.com/Ciphey/CipheyDists' +license=('custom:unlicense') +depends=('python') +makedepends=('python-build' 'python-pip') +options=(!emptydirs) +source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz") +sha512sums=('c67005bbf98cd8047649b897436e63f4f2d48621ca424c32691d4c42b6f66432a214bea5d0297749c795a30a705436c936bb5156daddd02fa1633bda6951070c') + +build() { + cd "$_pkgname-$pkgver" + + python -m build --wheel --outdir="$startdir/dist" +} + +package() { + cd "$_pkgname-$pkgver" + + pip install \ + --verbose \ + --disable-pip-version-check \ + --no-warn-script-location \ + --ignore-installed \ + --no-compile \ + --no-deps \ + --root="$pkgdir" \ + --prefix=/usr \ + --no-index \ + --find-links="file://$startdir/dist" \ + "$_pkgname" +} diff --git a/packages/python-pybase62/PKGBUILD b/packages/python-pybase62/PKGBUILD new file mode 100644 index 00000000000..a649d4038ea --- /dev/null +++ b/packages/python-pybase62/PKGBUILD @@ -0,0 +1,28 @@ +# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). +# See COPYING for license details. + +pkgname=python-pybase62 +_pkgname=${pkgname#python-} +pkgver=1.2.1 +pkgrel=1 +pkgdesc='A Python module for base62 encoding.' +arch=('any') +url='http://github.com/suminb/base62' +license=('BSD') +depends=('python') +makedepends=('python-build' 'python-pip') +options=(!emptydirs) +source=("$_pkgname::git+https://github.com/suminb/base62") +sha512sums=('SKIP') + +build() { + cd "$_pkgname" + + python setup.py build +} + +package() { + cd "$_pkgname" + + python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build +} diff --git a/packages/python-xortool-ciphey/PKGBUILD b/packages/python-xortool-ciphey/PKGBUILD new file mode 100644 index 00000000000..2a9a89ec0b7 --- /dev/null +++ b/packages/python-xortool-ciphey/PKGBUILD @@ -0,0 +1,39 @@ +# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). +# See COPYING for license details. + +pkgname=python-xortool-ciphey +_pkgname=xortool_ciphey +pkgver=0.1.16 +pkgrel=1 +pkgdesc='Multi-byte xor analysis for Ciphey.' +arch=('any') +url='https://pypi.org/project/xortool-ciphey' +license=('MIT') +depends=('python') +makedepends=('python-build' 'python-pip' 'python-poetry-core') +options=(!emptydirs) +source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz") +sha512sums=('6c19cdbccea52704179f69885559ab4d8a17e2f8dffa0a484bcb26db6152e7e6bace0ad1912e4e73b6bc1d73b3d7617a6802402c31703d345d5d1b4880e10d5f') + +build() { + cd "$_pkgname-$pkgver" + + python -m build --wheel --outdir="$startdir/dist" +} + +package() { + cd "$_pkgname-$pkgver" + + pip install \ + --verbose \ + --disable-pip-version-check \ + --no-warn-script-location \ + --ignore-installed \ + --no-compile \ + --no-deps \ + --root="$pkgdir" \ + --prefix=/usr \ + --no-index \ + --find-links="file://$startdir/dist" \ + "$_pkgname" +} diff --git a/packages/python37/0002-smaller-pgo-test-suite.patch b/packages/python37/0002-smaller-pgo-test-suite.patch new file mode 100644 index 00000000000..5e382c7f575 --- /dev/null +++ b/packages/python37/0002-smaller-pgo-test-suite.patch @@ -0,0 +1,232 @@ +From 16270bf2f945eea4c430000d372c30c877523b20 Mon Sep 17 00:00:00 2001 +From: Neil Schemenauer +Date: Mon, 22 Jul 2019 12:54:25 -0700 +Subject: [PATCH] bpo-36044: Reduce number of unit tests run for PGO build + (GH-14702) + +Reduce the number of unit tests run for the PGO generation task. This +speeds up the task by a factor of about 15x. Running the full unit test +suite is slow. This change may result in a slightly less optimized build +since not as many code branches will be executed. If you are willing to +wait for the much slower build, the old behavior can be restored using +'./configure [..] PROFILE_TASK="-m test --pgo-extended"'. We make no +guarantees as to which PGO task set produces a faster build. Users who +care should run their own relevant benchmarks as results can depend on +the environment, workload, and compiler tool chain. +(cherry picked from commit 4e16a4a3112161a5c6981c0588142d4a4673a934) + +Co-authored-by: Neil Schemenauer +--- + Lib/test/libregrtest/cmdline.py | 6 ++- + Lib/test/libregrtest/main.py | 4 ++ + Lib/test/libregrtest/pgo.py | 52 +++++++++++++++++++ + Makefile.pre.in | 7 +-- + .../2019-07-11-01-28-24.bpo-36044.gIgfiJ.rst | 9 ++++ + configure | 14 +++++ + configure.ac | 8 +++ + 7 files changed, 96 insertions(+), 4 deletions(-) + create mode 100644 Lib/test/libregrtest/pgo.py + create mode 100644 Misc/NEWS.d/next/Build/2019-07-11-01-28-24.bpo-36044.gIgfiJ.rst + +diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py +index 9f1bf6800824a..c8fedc7ad329b 100644 +--- a/Lib/test/libregrtest/cmdline.py ++++ b/Lib/test/libregrtest/cmdline.py +@@ -264,7 +264,9 @@ def _create_parser(): + help='only write the name of test cases that will be run' + ' , don\'t execute them') + group.add_argument('-P', '--pgo', dest='pgo', action='store_true', +- help='enable Profile Guided Optimization training') ++ help='enable Profile Guided Optimization (PGO) training') ++ group.add_argument('--pgo-extended', action='store_true', ++ help='enable extended PGO training (slower training)') + group.add_argument('--fail-env-changed', action='store_true', + help='if a test file alters the environment, mark ' + 'the test as failed') +@@ -344,6 +346,8 @@ def _parse_args(args, **kwargs): + parser.error("-G/--failfast needs either -v or -W") + if ns.pgo and (ns.verbose or ns.verbose2 or ns.verbose3): + parser.error("--pgo/-v don't go together!") ++ if ns.pgo_extended: ++ ns.pgo = True # pgo_extended implies pgo + + if ns.nowindows: + print("Warning: the --nowindows (-n) option is deprecated. " +diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py +index e2274254fdb89..78b6790685c9d 100644 +--- a/Lib/test/libregrtest/main.py ++++ b/Lib/test/libregrtest/main.py +@@ -17,6 +17,7 @@ + INTERRUPTED, CHILD_ERROR, TEST_DID_NOT_RUN, + PROGRESS_MIN_TIME, format_test_result, is_failed) + from test.libregrtest.setup import setup_tests ++from test.libregrtest.pgo import setup_pgo_tests + from test.libregrtest.utils import removepy, count, format_duration, printlist + from test import support + +@@ -214,6 +215,9 @@ def find_tests(self, tests): + + removepy(self.tests) + ++ # add default PGO tests if no tests are specified ++ setup_pgo_tests(self.ns) ++ + stdtests = STDTESTS[:] + nottests = NOTTESTS.copy() + if self.ns.exclude: +diff --git a/Lib/test/libregrtest/pgo.py b/Lib/test/libregrtest/pgo.py +new file mode 100644 +index 0000000000000..327f19374c3ff +--- /dev/null ++++ b/Lib/test/libregrtest/pgo.py +@@ -0,0 +1,52 @@ ++# Set of tests run by default if --pgo is specified. The tests below were ++# chosen based on the following criteria: either they exercise a commonly used ++# C extension module or type, or they run some relatively typical Python code. ++# Long running tests should be avoided because the PGO instrumented executable ++# runs slowly. ++PGO_TESTS = [ ++ 'test_array', ++ 'test_base64', ++ 'test_binascii', ++ 'test_binop', ++ 'test_bisect', ++ 'test_bytes', ++ 'test_cmath', ++ 'test_codecs', ++ 'test_collections', ++ 'test_complex', ++ 'test_dataclasses', ++ 'test_datetime', ++ 'test_decimal', ++ 'test_difflib', ++ 'test_embed', ++ 'test_float', ++ 'test_fstring', ++ 'test_functools', ++ 'test_generators', ++ 'test_hashlib', ++ 'test_heapq', ++ 'test_int', ++ 'test_itertools', ++ 'test_json', ++ 'test_long', ++ 'test_math', ++ 'test_memoryview', ++ 'test_operator', ++ 'test_ordered_dict', ++ 'test_pickle', ++ 'test_pprint', ++ 'test_re', ++ 'test_set', ++ 'test_statistics', ++ 'test_struct', ++ 'test_tabnanny', ++ 'test_time', ++ 'test_unicode', ++ 'test_xml_etree', ++ 'test_xml_etree_c', ++] ++ ++def setup_pgo_tests(ns): ++ if not ns.args and not ns.pgo_extended: ++ # run default set of tests for PGO training ++ ns.args = PGO_TESTS[:] +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 88abb563600d8..6a9f4b52704d2 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -255,9 +255,10 @@ TCLTK_INCLUDES= @TCLTK_INCLUDES@ + TCLTK_LIBS= @TCLTK_LIBS@ + + # The task to run while instrumented when building the profile-opt target. +-# We exclude unittests with -x that take a rediculious amount of time to +-# run in the instrumented training build or do not provide much value. +-PROFILE_TASK=-m test.regrtest --pgo ++# To speed up profile generation, we don't run the full unit test suite ++# by default. The default is "-m test --pgo". To run more tests, use ++# PROFILE_TASK="-m test --pgo-extended" ++PROFILE_TASK= @PROFILE_TASK@ + + # report files for gcov / lcov coverage report + COVERAGE_INFO= $(abs_builddir)/coverage.info +diff --git a/Misc/NEWS.d/next/Build/2019-07-11-01-28-24.bpo-36044.gIgfiJ.rst b/Misc/NEWS.d/next/Build/2019-07-11-01-28-24.bpo-36044.gIgfiJ.rst +new file mode 100644 +index 0000000000000..177c4cb6d17c7 +--- /dev/null ++++ b/Misc/NEWS.d/next/Build/2019-07-11-01-28-24.bpo-36044.gIgfiJ.rst +@@ -0,0 +1,9 @@ ++Reduce the number of unit tests run for the PGO generation task. This ++speeds up the task by a factor of about 15x. Running the full unit test ++suite is slow. This change may result in a slightly less optimized build ++since not as many code branches will be executed. If you are willing to ++wait for the much slower build, the old behavior can be restored using ++'./configure [..] PROFILE_TASK="-m test --pgo-extended"'. We make no ++guarantees as to which PGO task set produces a faster build. Users who ++care should run their own relevant benchmarks as results can depend on ++the environment, workload, and compiler tool chain. +diff --git a/configure b/configure +index 6e7f277bace9b..cb5f130d38e05 100755 +--- a/configure ++++ b/configure +@@ -686,6 +686,7 @@ target_vendor + target_cpu + target + LLVM_AR ++PROFILE_TASK + DEF_MAKE_RULE + DEF_MAKE_ALL_RULE + ABIFLAGS +@@ -856,6 +857,7 @@ LDFLAGS + LIBS + CPPFLAGS + CPP ++PROFILE_TASK + PKG_CONFIG + PKG_CONFIG_PATH + PKG_CONFIG_LIBDIR' +@@ -1559,6 +1561,8 @@ Some influential environment variables: + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor ++ PROFILE_TASK ++ Python args for PGO generation task + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path +@@ -6426,6 +6430,16 @@ else + DEF_MAKE_RULE="all" + fi + ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking PROFILE_TASK" >&5 ++$as_echo_n "checking PROFILE_TASK... " >&6; } ++if test -z "$PROFILE_TASK" ++then ++ PROFILE_TASK='-m test --pgo' ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROFILE_TASK" >&5 ++$as_echo "$PROFILE_TASK" >&6; } ++ + # Make llvm-relatec checks work on systems where llvm tools are not installed with their + # normal names in the default $PATH (ie: Ubuntu). They exist under the + # non-suffixed name in their versioned llvm directory. +diff --git a/configure.ac b/configure.ac +index 324ce0bd99a9c..b31ed242f1a81 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1293,6 +1293,14 @@ else + DEF_MAKE_RULE="all" + fi + ++AC_ARG_VAR(PROFILE_TASK, Python args for PGO generation task) ++AC_MSG_CHECKING(PROFILE_TASK) ++if test -z "$PROFILE_TASK" ++then ++ PROFILE_TASK='-m test --pgo' ++fi ++AC_MSG_RESULT($PROFILE_TASK) ++ + # Make llvm-relatec checks work on systems where llvm tools are not installed with their + # normal names in the default $PATH (ie: Ubuntu). They exist under the + # non-suffixed name in their versioned llvm directory. diff --git a/packages/python37/0003-enable-building-with-libmpdec.patch b/packages/python37/0003-enable-building-with-libmpdec.patch new file mode 100644 index 00000000000..fd85ec297b1 --- /dev/null +++ b/packages/python37/0003-enable-building-with-libmpdec.patch @@ -0,0 +1,30 @@ +From 16eea45fbd3b7c3d1b222b7eb7a5d7ee427f70bd Mon Sep 17 00:00:00 2001 +From: Felix Yan +Date: Thu, 16 Jul 2020 04:22:23 +0800 +Subject: [PATCH] [3.8] bpo-41302: Support system libmpdec 2.5 for Python 3.8 + (GH-21488) + +Define UNUSED only when mpdecimal.h doesn't define it. This would support +building with system libmpdec 2.5 while retaining compatibility with system +libmpdec 2.4 or the vendored copy. + +Tested to build fine with either system libmpdec or the vendored one. +--- +diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c +index df7c6e254bcf2..eb1f1a01feeca 100644 +--- a/Modules/_decimal/_decimal.c ++++ b/Modules/_decimal/_decimal.c +@@ -58,6 +58,13 @@ + + #define BOUNDS_CHECK(x, MIN, MAX) x = (x < MIN || MAX < x) ? MAX : x + ++#ifndef UNUSED ++#if defined(__GNUC__) && !defined(__INTEL_COMPILER) ++ #define UNUSED __attribute__((unused)) ++#else ++ #define UNUSED ++#endif ++#endif + + /* _Py_DEC_MINALLOC >= MPD_MINALLOC */ + #define _Py_DEC_MINALLOC 4 diff --git a/packages/python37/0004-mpdecimal-2.5.1.patch b/packages/python37/0004-mpdecimal-2.5.1.patch new file mode 100644 index 00000000000..47e427c62a9 --- /dev/null +++ b/packages/python37/0004-mpdecimal-2.5.1.patch @@ -0,0 +1,45 @@ +From dd436be488bdca2123d12d1e148d85cb6f98be5f Mon Sep 17 00:00:00 2001 +From: Stefan Krah +Date: Sun, 10 Jan 2021 16:35:48 +0100 +Subject: [PATCH] Portability fixes. + +--- + Modules/_decimal/_decimal.c | 4 ++-- + setup.py | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c +index 664d45a90481d..bbd540bc376e2 100644 +--- a/Modules/_decimal/_decimal.c ++++ b/Modules/_decimal/_decimal.c +@@ -3295,7 +3295,7 @@ dec_format(PyObject *dec, PyObject *args) + } + else { + size_t n = strlen(spec.dot); +- if (n > 1 || (n == 1 && !isascii((uchar)spec.dot[0]))) { ++ if (n > 1 || (n == 1 && !isascii((unsigned char)spec.dot[0]))) { + /* fix locale dependent non-ascii characters */ + dot = dotsep_as_utf8(spec.dot); + if (dot == NULL) { +@@ -3304,7 +3304,7 @@ dec_format(PyObject *dec, PyObject *args) + spec.dot = PyBytes_AS_STRING(dot); + } + n = strlen(spec.sep); +- if (n > 1 || (n == 1 && !isascii((uchar)spec.sep[0]))) { ++ if (n > 1 || (n == 1 && !isascii((unsigned char)spec.sep[0]))) { + /* fix locale dependent non-ascii characters */ + sep = dotsep_as_utf8(spec.sep); + if (sep == NULL) { +diff --git a/setup.py b/setup.py +index ddc0bd067d4e4..c547a68664e8c 100644 +--- a/setup.py ++++ b/setup.py +@@ -2199,7 +2199,7 @@ def detect_decimal(self): + undef_macros = [] + if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): + include_dirs = [] +- libraries = [':libmpdec.so.2'] ++ libraries = ['mpdec'] + sources = ['_decimal/_decimal.c'] + depends = ['_decimal/docstrings.h'] + else: diff --git a/packages/python37/PKGBUILD b/packages/python37/PKGBUILD new file mode 100644 index 00000000000..b5be6b28ea8 --- /dev/null +++ b/packages/python37/PKGBUILD @@ -0,0 +1,117 @@ +# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). +# See COPYING for license details. + +# This package has been retrieved from AUR +# Maintainer: Yoan Blanc +# Contributor: Whyme Lyu +# Contributor: Carlo De Pieri +# Contributor: Tobias Kunze +# Contributor: Angel Velasquez +# Contributor: Felix Yan +# Contributor: Stéphane Gaudreault +# Contributor: Allan McRae +# Contributor: Jason Chu + +pkgname=python37 +pkgver=3.7.17 +pkgrel=1 +_pybasever=${pkgver%.*} +_pymajver=3 +pkgdesc="Major release 3.7 of the Python high-level programming language" +arch=('x86_64') +license=('custom') +url="https://www.python.org/" +provides=("python=$pkgver") +depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib' 'libnsl' 'libxcrypt') +makedepends=('tk' 'sqlite' 'bluez-libs' 'mpdecimal') +optdepends=('sqlite' + 'mpdecimal: for decimal' + 'xz: for lzma' + 'tk: for tkinter') +source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz"{,.asc} + dont-make-libpython-readonly.patch + 0002-smaller-pgo-test-suite.patch + 0003-enable-building-with-libmpdec.patch + 0004-mpdecimal-2.5.1.patch + ) +sha512sums=('86ba1c953e7b4bce70445d1616cc0d428b50937f6a874811584df8bf23c3e2ba3e5d48dec00e629a47f4216f3ca50dc5389cd485fbc315f51000d8750403b5f0' + 'SKIP' + '2ef96708d5b13ae2a3d2cc62c87b4780e60ecfce914e190564492def3a11d5e56977659f41c7f9d12266e58050c766bce4e2b5d50b708eb792794fa8357920c4' + '10db463924402b6f1d9631424397495e8be0419bc7f9ca6cd7325216433b2dfe512b6f6669626ff05a8e05a6013613660abee59fcb86e5483558b014687bfaa1' + '991540591e2e024d02f2a6f85a98b43ee0e270d223c66572f2d700b32d89c8afa4faa61d45d41998e108c7b1633da20f7f43b37b2d846364431ebdab921dff17' + '58f683cbfdc6aa84c03d068c1bc2f1d8d2c17ba4f7b632c14ab1d529d8332e767354266c3815e239427497fff1a42ec2a37739ea312d24cb76a69dcf1c98c0ad') +validpgpkeys=('0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D') # Ned Deily (Python release signing key) + +prepare() { + cd Python-${pkgver} + + # FS#45809 + patch -p1 -i ../dont-make-libpython-readonly.patch + + # Backport https://bugs.python.org/issue36044 to 3.7 + patch -p1 -i ../0002-smaller-pgo-test-suite.patch + + # Backport https://bugs.python.org/issue41302 to 3.7 + patch -p1 -i ../0003-enable-building-with-libmpdec.patch + + # From Python38 AUR, + # https://bugs.python.org/issue41369 + patch -p1 -i ../0004-mpdecimal-2.5.1.patch + + # FS#23997 + sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python|" Lib/cgi.py + + # Speed up LTO + sed -i -e "s|-flto |-flto=4 |g" configure configure.ac + + # Ensure that we are using the system copy of various libraries (expat, libffi, and libmpdec), + # rather than copies shipped in the tarball + rm -r Modules/expat + rm -r Modules/_ctypes/{darwin,libffi}* + rm -r Modules/_decimal/libmpdec +} + +build() { + cd Python-${pkgver} + + CFLAGS=-DOPENSSL_NO_SSL2 ./configure --prefix=/usr \ + --enable-shared \ + --with-computed-gotos \ + --enable-optimizations \ + --with-lto \ + --enable-ipv6 \ + --with-system-expat \ + --with-dbmliborder=gdbm:ndbm \ + --with-system-ffi \ + --with-system-libmpdec \ + --enable-loadable-sqlite-extensions \ + --without-ensurepip + + make +} + +package() { + cd Python-${pkgver} + + # altinstall: /usr/bin/pythonX.Y but not /usr/bin/python or /usr/bin/pythonX + make DESTDIR="${pkgdir}" altinstall maninstall + + # Avoid conflicts with the main 'python' package. + rm "${pkgdir}/usr/lib/libpython${_pymajver}.so" + rm -f "${pkgdir}/usr/share/man/man1/python${_pymajver}.1" + + # Add missing pkgconfig stuff + ln -s "python${_pybasever}m-config" "${pkgdir}/usr/bin/python${_pybasever}-config" + + # Clean-up reference to build directory + sed -i "s|$srcdir/Python-${pkgver}:||" \ + "$pkgdir/usr/lib/python${_pybasever}/config-${_pybasever}m-${CARCH}-linux-gnu/Makefile" + + # some useful "stuff" FS#46146 + install -dm755 "${pkgdir}"/usr/lib/python${_pybasever}/Tools/{i18n,scripts} + install -m755 Tools/i18n/{msgfmt,pygettext}.py "${pkgdir}"/usr/lib/python${_pybasever}/Tools/i18n/ + install -m755 Tools/scripts/{README,*py} "${pkgdir}"/usr/lib/python${_pybasever}/Tools/scripts/ + + # License + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/packages/python37/dont-make-libpython-readonly.patch b/packages/python37/dont-make-libpython-readonly.patch new file mode 100644 index 00000000000..92308bfe97b --- /dev/null +++ b/packages/python37/dont-make-libpython-readonly.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index ce2c0aa..7d6dcf7 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -60,7 +60,7 @@ INSTALL_DATA= @INSTALL_DATA@ + # Shared libraries must be installed with executable mode on some systems; + # rather than figuring out exactly which, we always give them executable mode. + # Also, making them read-only seems to be a good idea... +-INSTALL_SHARED= ${INSTALL} -m 555 ++INSTALL_SHARED= ${INSTALL} -m 755 + + MKDIR_P= @MKDIR_P@ +