Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
me-and committed Nov 17, 2023
0 parents commit e5ce340
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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 }}
17 changes: 17 additions & 0 deletions per-package-docs.patch
Original file line number Diff line number Diff line change
@@ -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)
57 changes: 57 additions & 0 deletions python-pycurl.cygport
Original file line number Diff line number Diff line change
@@ -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/
:
}

0 comments on commit e5ce340

Please sign in to comment.