diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..50e9ebb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI +on: [push, pull_request] +jobs: + build-test: + uses: cygporter/workflows/.github/workflows/build-test.yml@v2 + with: + cygport_file: python-pycurl.cygport + + github-release: + if: github.ref == format('refs/heads/v{0}', needs.build-test.outputs.cygport-pv) + needs: build-test + permissions: + contents: write + uses: cygporter/workflows/.github/workflows/github-release.yml@v2 + with: + tag_name: v${{ needs.build-test.outputs.cygport-pvr }} + + cygwin-release: + if: github.ref == format('refs/heads/v{0}', needs.build-test.outputs.cygport-pv) + needs: [build-test, github-release] + uses: cygporter/workflows/.github/workflows/cygwin-release.yml@v2 + with: + cygport_file: python-rfc6555.cygport + tag_name: v${{ needs.build-test.outputs.cygport-pvr }} + secrets: + maintainer_key: ${{ secrets.maintainer_key }} diff --git a/per-package-docs.patch b/per-package-docs.patch new file mode 100644 index 0000000..cc98ecd --- /dev/null +++ b/per-package-docs.patch @@ -0,0 +1,17 @@ +--- origsrc/pycurl-7.45.2/setup.py 2022-12-16 19:31:55.000000000 +0000 ++++ src/pycurl-7.45.2/setup.py 2023-11-16 14:04:45.487511800 +0000 +@@ -665,7 +665,7 @@ def get_data_files(): + if sys.platform == "win32": + datadir = os.path.join("doc", PACKAGE) + else: +- datadir = os.path.join("share", "doc", PACKAGE) ++ datadir = os.path.join("share", "doc", f"python{sys.version_info.major}{sys.version_info.minor}-{PACKAGE}") + # + files = ["AUTHORS", "ChangeLog", "COPYING-LGPL", "COPYING-MIT", + "INSTALL.rst", "README.rst", "RELEASE-NOTES.rst"] +@@ -972,4 +972,5 @@ if __name__ == "__main__": + + for o in ext.extra_objects: + assert os.path.isfile(o), o ++ from pprint import pprint; pprint(setup_args) + setup(**setup_args) diff --git a/python-pycurl.cygport b/python-pycurl.cygport new file mode 100644 index 0000000..68ae0f8 --- /dev/null +++ b/python-pycurl.cygport @@ -0,0 +1,57 @@ +inherit python-wheel + +NAME=python-pycurl +VERSION=7.45.2 +RELEASE=1 +CATEGORY=Python +SUMMARY='A Python interface to libcurl' +DESCRIPTION="PycURL is a Python interface to libcurl, the multiprotocol file +transfer library. Similarly to the urllib Python module, PycURL can be used to +fetch objects identified by a URL from a Python program. Beyond simple fetches +however PycURL exposes most of the functionality of libcurl." +HOMEPAGE=http://pycurl.io/ +LICENSE='LGPL-2.1-only OR curl' + +PATCH_URI=per-package-docs.patch + +BUILD_REQUIRES='libcurl-devel libssl-devel' + +add_to_space_sep_string () { + local -n var="$1" + shift + local val + for val; do + var="${var:+$var }$val" + done +} + +handle_python_versions () { + local version pkgversion + local -i majver minver + for version in ${PYTHON_WHEEL_VERSIONS//:/ }; do + pkgversion="${version/.}" + majver="${version%%.*}" + minver="${version#${majver}.}" + add_to_space_sep_string BUILD_REQUIRES \ + "python${pkgversion}-wheel" \ + "python${pkgversion}-devel" + # The below would only be required if we were capable of + # running the tests. + if ! :; then + if (( majver == 3 && minver < 11 )); then + add_to_space_sep_string BUILD_REQUIRES \ + "python${pkgversion}-exceptiongroup" + fi + fi + done +} + +handle_python_versions + +unset -f add_to_space_sep_string handle_python_versions + +src_test () { + # Tests currently fail because Cygwin doesn't have + # https://bottlepy.org/docs/stable/ + : +}