diff --git a/dev-python/pyenet/patches/pyenet-20141025.patchset b/dev-python/pyenet/patches/pyenet-20141025.patchset deleted file mode 100644 index ff64c5b1a..000000000 --- a/dev-python/pyenet/patches/pyenet-20141025.patchset +++ /dev/null @@ -1,57 +0,0 @@ -From 0d76ac64d30acd2a26ef8d662a3a00940ba98a57 Mon Sep 17 00:00:00 2001 -From: Michael Lotz -Date: Sat, 24 Oct 2015 20:47:49 +0000 -Subject: [PATCH 1/2] Declare availability of get{addr|name}info(), link - libnetwork. - ---- - setup.py | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 95d55e8..7a2642f 100644 ---- a/setup.py -+++ b/setup.py -@@ -28,7 +28,11 @@ if sys.platform == 'win32': - define_macros.extend([('WIN32', None)]) - libraries.extend(['ws2_32', 'Winmm']) - --if sys.platform != 'darwin': -+if sys.platform == 'haiku1': -+ define_macros.extend([('HAS_GETADDRINFO', None), ('HAS_GETNAMEINFO', None)]) -+ libraries.extend(['network']) -+ -+elif sys.platform != 'darwin': - define_macros.extend([('HAS_GETHOSTBYNAME_R', None), ('HAS_GETHOSTBYADDR_R', None)]) - - ext_modules = [ --- -2.2.2 - - -From 224a284bb15f6a06b41a6743fd33d9d94140fe77 Mon Sep 17 00:00:00 2001 -From: Michael Lotz -Date: Sat, 24 Oct 2015 21:12:27 +0000 -Subject: [PATCH 2/2] Disable strict aliasing as the wrapper is not aliasing - clean. - ---- - setup.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 7a2642f..9521285 100644 ---- a/setup.py -+++ b/setup.py -@@ -38,7 +38,7 @@ elif sys.platform != 'darwin': - ext_modules = [ - Extension( - "enet", -- extra_compile_args=["-O3"], -+ extra_compile_args=['-O3', '-fno-strict-aliasing'], - sources=source_files, - include_dirs=["enet/include/"], - define_macros=define_macros, --- -2.2.2 - diff --git a/dev-python/pyenet/patches/pyenet-20221216.patchset b/dev-python/pyenet/patches/pyenet-20221216.patchset new file mode 100644 index 000000000..b829b3be4 --- /dev/null +++ b/dev-python/pyenet/patches/pyenet-20221216.patchset @@ -0,0 +1,94 @@ +From b541b5d8083442c80c51ce8da8b2556a312aac7d Mon Sep 17 00:00:00 2001 +From: Michael Lotz +Date: Sat, 24 Oct 2015 20:47:49 +0000 +Subject: Declare availability of get{addr|name}info(), link libnetwork. + + +diff --git a/setup.py b/setup.py +index 691917b..19e6fff 100644 +--- a/setup.py ++++ b/setup.py +@@ -28,7 +28,11 @@ if sys.platform == 'win32': + define_macros.extend([('WIN32', None)]) + libraries.extend(['ws2_32', 'Winmm']) + +-if sys.platform != 'darwin': ++if sys.platform == 'haiku1': ++ define_macros.extend([('HAS_GETADDRINFO', None), ('HAS_GETNAMEINFO', None)]) ++ libraries.extend(['network']) ++ ++elif sys.platform != 'darwin': + define_macros.extend([('HAS_GETHOSTBYNAME_R', None), ('HAS_GETHOSTBYADDR_R', None)]) + + ext_modules = [ +-- +2.37.3 + + +From bdedba029b7c3f03a02aab752142eb98573c0116 Mon Sep 17 00:00:00 2001 +From: Michael Lotz +Date: Sat, 24 Oct 2015 21:12:27 +0000 +Subject: Disable strict aliasing as the wrapper is not aliasing clean. + + +diff --git a/setup.py b/setup.py +index 19e6fff..e14de6f 100644 +--- a/setup.py ++++ b/setup.py +@@ -38,7 +38,7 @@ elif sys.platform != 'darwin': + ext_modules = [ + Extension( + "enet", +- extra_compile_args=["-O3"], ++ extra_compile_args=['-O3', '-fno-strict-aliasing'], + sources=source_files, + include_dirs=["enet/include/"], + define_macros=define_macros, +-- +2.37.3 + + +From edfe6d399e502d89ad1c6dd1bcc61a56ec31553f Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Sun, 2 Jul 2023 08:32:26 +0000 +Subject: Use system libenet + + +diff --git a/setup.py b/setup.py +index e14de6f..1329e91 100644 +--- a/setup.py ++++ b/setup.py +@@ -7,22 +7,22 @@ import sys + + source_files = ["enet.pyx"] + +-_enet_files = glob.glob("enet/*.c") ++# _enet_files = glob.glob("enet/*.c") + +-if not _enet_files: +- print("You need to download and extract the enet 1.3 source to enet/") +- print("Download the source from: http://enet.bespin.org/Downloads.html") +- print("See the README for more instructions") +- sys.exit(1) ++# if not _enet_files: ++# print("You need to download and extract the enet 1.3 source to enet/") ++# print("Download the source from: http://enet.bespin.org/Downloads.html") ++# print("See the README for more instructions") ++# sys.exit(1) + +-source_files.extend(_enet_files) ++# source_files.extend(_enet_files) + + define_macros = [('HAS_POLL', None), + ('HAS_FCNTL', None), + ('HAS_MSGHDR_FLAGS', None), + ('HAS_SOCKLEN_T', None) ] + +-libraries = [] ++libraries = ['enet'] + + if sys.platform == 'win32': + define_macros.extend([('WIN32', None)]) +-- +2.37.3 + diff --git a/dev-python/pyenet/pyenet-20141025.recipe b/dev-python/pyenet/pyenet-20141025.recipe deleted file mode 100644 index dd09578c2..000000000 --- a/dev-python/pyenet/pyenet-20141025.recipe +++ /dev/null @@ -1,55 +0,0 @@ -SUMMARY="A python wrapper for the ENet library" -DESCRIPTION="pyenet is a python wrapper for the ENet library by Lee Salzman, \ -http://enet.bespin.org.\ -It was originally written by Scott Robinson scott@tranzoa.com and is currently \ -maintained by Andrew Resch andrewresch@gmail.com." -HOMEPAGE="https://github.com/aresch/pyenet" - -SOURCE_URI="https://github.com/aresch/pyenet/archive/265b18eda4556c893f5851f6dcb1084bddc758a7.tar.gz" -CHECKSUM_SHA256="b29256914593af0ad606eccb92dc143ab89dc2e8c83ea7405b98459528639943" -SOURCE_DIR="pyenet-265b18eda4556c893f5851f6dcb1084bddc758a7" - -# Note that at the time of writing the latest stable release of enet does not -# contain getaddrinfo() support. The specific commit introducing this support -# (which is also currently the HEAD) is therefore used here. -SOURCE_URI_2="https://github.com/lsalzman/enet/archive/5f476546edabdf37509cd3448d1a616f5eca535d.tar.gz" -CHECKSUM_SHA256_2="1c49f074d611b3e00c79abd94cb1df8f1b4bb013ebd20e0d03015ddac955ff16" -SOURCE_DIR_2="enet-5f476546edabdf37509cd3448d1a616f5eca535d" - -LICENSE=" - BSD (3-clause) - MIT - " -COPYRIGHT="2003 Scott Robinson; 2009,2010 Andrew Resch" -REVISION="3" - -ARCHITECTURES="all" - -PATCHES="pyenet-$portVersion.patchset" - -PROVIDES=" - pyenet = $portVersion - " - -REQUIRES=" - haiku - cmd:python - " - -BUILD_PREREQUIRES=" - haiku_devel - cmd:cython2 - cmd:gcc - cmd:python - " - -BUILD() -{ - ln -sf $sourceDir2 enet - python setup.py build -} - -INSTALL() -{ - python setup.py install --prefix=$prefix -} diff --git a/dev-python/pyenet/pyenet-20221216.recipe b/dev-python/pyenet/pyenet-20221216.recipe new file mode 100644 index 000000000..fb1283fff --- /dev/null +++ b/dev-python/pyenet/pyenet-20221216.recipe @@ -0,0 +1,75 @@ +SUMMARY="A python wrapper for the ENet library" +DESCRIPTION="pyenet is a python wrapper for the ENet library by Lee Salzman, \ +http://enet.bespin.org.\ +It was originally written by Scott Robinson scott@tranzoa.com and is currently \ +maintained by Andrew Resch andrewresch@gmail.com." +HOMEPAGE="https://github.com/aresch/pyenet" +LICENSE="BSD (3-clause) + MIT" +COPYRIGHT="2003 Scott Robinson; 2009,2010 Andrew Resch" +REVISION="1" +srcGitRev="e2b7544ff7d57fe421bdf4563d958e0fcb496d9f" +SOURCE_URI="https://github.com/aresch/pyenet/archive/$srcGitRev.tar.gz" +CHECKSUM_SHA256="a23ec1a8f8373aabcbb68d32fff0a8088205eeb1ee3f945853c738927143cd7e" +SOURCE_DIR="pyenet-$srcGitRev" +PATCHES="pyenet-$portVersion.patchset" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + pyenet$secondaryArchSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + " + +PYTHON_PACKAGES=(python39 python310) +PYTHON_VERSIONS=(3.9 3.10) +for i in "${!PYTHON_PACKAGES[@]}"; do + pythonPackage=${PYTHON_PACKAGES[i]} + pythonVersion=${PYTHON_VERSIONS[$i]} + + eval "PROVIDES_$pythonPackage=\" + ${portName}_$pythonPackage = $portVersion + \"" + eval "REQUIRES_$pythonPackage=\" + haiku + cmd:python$pythonVersion + \"" + if [ "$targetArchitecture" = "x86_gcc2" ]; then + eval "PROVIDES_${pythonPackage}+=\" + pyenet_$pythonPackage = $portVersion + \"" + fi + BUILD_REQUIRES+=" + haiku${secondaryArchSuffix}_devel + devel:libenet$secondaryArchSuffix + " + BUILD_PREREQUIRES+=" + cmd:cython$pythonVersion + cmd:gcc$secondaryArchSuffix + cmd:python$pythonVersion + " +done + +INSTALL() +{ + for i in "${!PYTHON_PACKAGES[@]}"; do + pythonPackage=${PYTHON_PACKAGES[i]} + pythonVersion=${PYTHON_VERSIONS[$i]} + + python=python$pythonVersion + installLocation=$prefix/lib/$python/vendor-packages/ + export PYTHONPATH=$installLocation:$PYTHONPATH + + mkdir -p $installLocation + rm -rf build + + $python setup.py build install \ + --root=/ --prefix=$prefix + + packageEntries $pythonPackage \ + $prefix/lib/python* + done +}