diff --git a/LICENSES/PSF-2.0.txt b/LICENSES/PSF-2.0.txt new file mode 100644 index 0000000..8a38e52 --- /dev/null +++ b/LICENSES/PSF-2.0.txt @@ -0,0 +1,47 @@ +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. diff --git a/sysa/SHA256SUMS.pkgs b/sysa/SHA256SUMS.pkgs index d02a04a..26cd514 100644 --- a/sysa/SHA256SUMS.pkgs +++ b/sysa/SHA256SUMS.pkgs @@ -1,5 +1,7 @@ dd761c6ab360b9ae66816b10fae38c3d547a146028188083295130f25dd03f5d Python-2.0.1_0.tar.bz2 d64800e5da112f1cbdc3d2799ebd264d07fe8f111dd41edc37ed2276b3acda41 Python-2.0.1_1.tar.bz2 +bc392178f552280ba1063123257bcf549fdea088e1f78f60c93e19c9e05fa3f6 Python-2.3.7_0.tar.bz2 +97acf5c85ebfb47192fc310805ab3c80cb56f9d614027d6bdee11ae5934c2ab9 Python-2.3.7_1.tar.bz2 2fde9f584a275efc5c8bf23adaa690e06ab6922ecbc35108731e87f565ddb2b6 autoconf-2.12_0.tar.bz2 40d88d4b1048ab70eaecf753fb77713dfcaa9c9c72252cd36459236034cdcdfd autoconf-2.13_0.tar.bz2 38f0de4c816088c514dbfb1536779f2204426a95bd6f57fa87b83bffefcaa390 autoconf-2.52_0.tar.bz2 diff --git a/sysc/Python-2.3.7/files/disable-unicode.patch b/sysc/Python-2.3.7/files/disable-unicode.patch new file mode 100644 index 0000000..0e419f0 --- /dev/null +++ b/sysc/Python-2.3.7/files/disable-unicode.patch @@ -0,0 +1,110 @@ +SPDX-FileCopyrightText: 2022 fosslinux + +SPDX-License-Identifier: PSF-2.0 + +This is a nearly-equivalent patch to Python 2.0.1, with nearly +identical reasoning. + +Python 2.3's unicode regeneration code is a bit too incompatible +with Python 2.0.1. + +--- Objects/unicodectype.c 2022-10-05 18:11:21.989603599 +1100 ++++ Objects/unicodectype.c 2022-10-05 18:14:57.335843857 +1100 +@@ -29,31 +29,12 @@ + const unsigned char digit; + } _PyUnicode_TypeRecord; + +-#include "unicodetype_db.h" +- +-static const _PyUnicode_TypeRecord * +-gettyperecord(Py_UNICODE code) +-{ +- int index; +- +- if (code >= 0x110000) +- index = 0; +- else { +- index = index1[(code>>SHIFT)]; +- index = index2[(index<flags & LINEBREAK_MASK) != 0; ++ return 0; + } + + /* Returns the titlecase Unicode characters corresponding to ch or just +@@ -61,18 +42,7 @@ + + Py_UNICODE _PyUnicode_ToTitlecase(register Py_UNICODE ch) + { +- const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); +- int delta; +- +- if (ctype->title) +- delta = ctype->title; +- else +- delta = ctype->upper; +- +- if (delta >= 32768) +- delta -= 65536; +- +- return ch + delta; ++ return ch; + } + + /* Returns 1 for Unicode characters having the category 'Lt', 0 +@@ -80,9 +50,7 @@ + + int _PyUnicode_IsTitlecase(Py_UNICODE ch) + { +- const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); +- +- return (ctype->flags & TITLE_MASK) != 0; ++ return 0; + } + + /* Returns the integer decimal (0-9) for Unicode characters having +@@ -90,9 +58,7 @@ + + int _PyUnicode_ToDecimalDigit(Py_UNICODE ch) + { +- const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); +- +- return (ctype->flags & DECIMAL_MASK) ? ctype->decimal : -1; ++ return -1; + } + + int _PyUnicode_IsDecimalDigit(Py_UNICODE ch) +@@ -107,9 +73,7 @@ + + int _PyUnicode_ToDigit(Py_UNICODE ch) + { +- const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); +- +- return (ctype->flags & DIGIT_MASK) ? ctype->digit : -1; ++ return -1; + } + + int _PyUnicode_IsDigit(Py_UNICODE ch) +--- Makefile.pre.in 2005-01-12 00:49:02.000000000 +1100 ++++ Makefile.pre.in 2022-10-05 18:35:05.979846971 +1100 +@@ -456,8 +456,7 @@ + Python/importdl.o: $(srcdir)/Python/importdl.c + $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c + +-Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \ +- $(srcdir)/Objects/unicodetype_db.h ++Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c + + ############################################################################ + # Header files diff --git a/sysc/Python-2.3.7/patches/posixmodule.patch b/sysc/Python-2.3.7/patches/posixmodule.patch new file mode 100644 index 0000000..47fad59 --- /dev/null +++ b/sysc/Python-2.3.7/patches/posixmodule.patch @@ -0,0 +1,33 @@ +SPDX-FileCopyrightText: 2022 fosslinux + +SPDX-License-Identifier: PSF-2.0 + +musl (correctly) implements the POSIX posix_close function, however +this was added after Python 2.3.7 was released. + +--- Modules/posixmodule.c 2022-10-05 18:38:46.718131893 +1100 ++++ Modules/posixmodule.c 2022-10-05 18:39:07.049250312 +1100 +@@ -5208,12 +5208,12 @@ + } + + +-PyDoc_STRVAR(posix_close__doc__, ++PyDoc_STRVAR(py_posix_close__doc__, + "close(fd)\n\n\ + Close a file descriptor (for low level IO)."); + + static PyObject * +-posix_close(PyObject *self, PyObject *args) ++py_posix_close(PyObject *self, PyObject *args) + { + int fd, res; + if (!PyArg_ParseTuple(args, "i:close", &fd)) +@@ -7371,7 +7371,7 @@ + {"tcsetpgrp", posix_tcsetpgrp, METH_VARARGS, posix_tcsetpgrp__doc__}, + #endif /* HAVE_TCSETPGRP */ + {"open", posix_open, METH_VARARGS, posix_open__doc__}, +- {"close", posix_close, METH_VARARGS, posix_close__doc__}, ++ {"close", py_posix_close, METH_VARARGS, py_posix_close__doc__}, + {"dup", posix_dup, METH_VARARGS, posix_dup__doc__}, + {"dup2", posix_dup2, METH_VARARGS, posix_dup2__doc__}, + {"lseek", posix_lseek, METH_VARARGS, posix_lseek__doc__}, diff --git a/sysc/Python-2.3.7/sources b/sysc/Python-2.3.7/sources new file mode 100644 index 0000000..9cb49dc --- /dev/null +++ b/sysc/Python-2.3.7/sources @@ -0,0 +1,3 @@ +https://www.python.org/ftp/python/2.3.7/Python-2.3.7.tgz 969a9891dce9f50b13e54f9890acaf2be66715a5895bf9b11111f320c205b90e +http://ftp.unicode.org/Public/3.2-Update/UnicodeData-3.2.0.txt 5e444028b6e76d96f9dc509609c5e3222bf609056f35e5fcde7e6fb8a58cd446 +http://ftp.unicode.org/Public/3.2-Update/CompositionExclusions-3.2.0.txt 1d3a450d0f39902710df4972ac4a60ec31fbcb54ffd4d53cd812fc1200c732cb diff --git a/sysc/Python-2.3.7/stage1.sh b/sysc/Python-2.3.7/stage1.sh new file mode 100755 index 0000000..e98caf7 --- /dev/null +++ b/sysc/Python-2.3.7/stage1.sh @@ -0,0 +1,69 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_prepare() { + default + + # Remove broken file + rm Lib/test/test_pep263.py + + # Delete generated files + rm Modules/glmodule.c + rm Modules/unicodedata_db.h Objects/unicodetype_db.h + rm Lib/stringprep.py + mv Lib/plat-generic . + rm -r Lib/plat-* + mv plat-generic Lib/ + grep generated -r . -l | grep encodings | xargs rm + + # Disable unicode + patch -Np0 -i disable-unicode.patch + + # Regenerate sre_constants.h + rm Modules/sre_constants.h + python Lib/sre_constants.py + + # Regen ast module + rm Lib/compiler/ast.py + pushd Tools/compiler + python astgen.py > ../../Lib/compiler/ast.py + popd + + # Regenerate autoconf + autoreconf-2.71 -fi +} + +src_configure() { + CFLAGS="-U__DATE__ -U__TIME__" \ + ./configure \ + --prefix="${PREFIX}" \ + --libdir="${PREFIX}/lib/musl" \ + --with-wctype-functions +} + +src_compile() { + # Build pgen + make Parser/pgen + # Regen graminit.c and graminit.h + make Include/graminit.h + + # Regenerate some Python scripts using the other regenerated files + # Must move them out to avoid using Lib/ module files which are + # incompatible with running version of Python + cp Lib/{symbol,keyword,token}.py . + python symbol.py + python keyword.py + python token.py + + # Now build the main program + make CFLAGS="-U__DATE__ -U__TIME__" +} + +src_install() { + default + + # Remove non-reproducible .pyc/o files + find "${DESTDIR}" -name "*.pyc" -delete + find "${DESTDIR}" -name "*.pyo" -delete +} diff --git a/sysc/Python-2.3.7/stage2.sh b/sysc/Python-2.3.7/stage2.sh new file mode 100755 index 0000000..045f462 --- /dev/null +++ b/sysc/Python-2.3.7/stage2.sh @@ -0,0 +1,70 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_prepare() { + default + + # Remove broken file + rm Lib/test/test_pep263.py + + # Delete generated files + rm Modules/glmodule.c + rm Lib/stringprep.py + mv Lib/plat-generic . + rm -r Lib/plat-* + mv plat-generic Lib/ + grep generated -r . -l | grep encodings | xargs rm + + # Regenerate unicode + rm Modules/unicodedata_db.h Modules/unicodename_db.h Objects/unicodetype_db.h + mv ../UnicodeData-3.2.0.txt UnicodeData.txt + mv ../CompositionExclusions-3.2.0.txt CompositionExclusions.txt + python Tools/unicode/makeunicodedata.py + + # Regenerate sre_constants.h + rm Modules/sre_constants.h + python Lib/sre_constants.py + + # Regen ast module + rm Lib/compiler/ast.py + pushd Tools/compiler + python astgen.py > ../../Lib/compiler/ast.py + popd + + # Regenerate autoconf + autoreconf-2.71 -fi +} + +src_configure() { + CFLAGS="-U__DATE__ -U__TIME__" \ + ./configure \ + --prefix="${PREFIX}" \ + --libdir="${PREFIX}/lib/musl" +} + +src_compile() { + # Build pgen + make Parser/pgen + # Regen graminit.c and graminit.h + make Include/graminit.h + + # Regenerate some Python scripts using the other regenerated files + # Must move them out to avoid using Lib/ module files which are + # incompatible with running version of Python + cp Lib/{symbol,keyword,token}.py . + python symbol.py + python keyword.py + python token.py + + # Now build the main program + make CFLAGS="-U__DATE__ -U__TIME__" +} + +src_install() { + default + + # Remove non-reproducible .pyc/o files + find "${DESTDIR}" -name "*.pyc" -delete + find "${DESTDIR}" -name "*.pyo" -delete +} diff --git a/sysc/run2.sh b/sysc/run2.sh index 410bdcb..8bf8165 100755 --- a/sysc/run2.sh +++ b/sysc/run2.sh @@ -107,6 +107,10 @@ build Python-2.0.1 stage1.sh build Python-2.0.1 stage2.sh +build Python-2.3.7 stage1.sh + +build Python-2.3.7 stage2.sh + if [ "$FORCE_TIMESTAMPS" = True ] ; then echo 'Forcing all files timestamps to be 0 unix time.' canonicalise_all_files_timestamp