diff --git a/.github/workflows/build-pkgconf.yml b/.github/workflows/build-pkgconf.yml new file mode 100644 index 000000000000..ea2bdf6c4070 --- /dev/null +++ b/.github/workflows/build-pkgconf.yml @@ -0,0 +1,115 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on the `wheels` job of +# https://github.com/pypackaging-native/pkgconf-pypi/blob/3.0.7-0/.github/workflows/build.yml +# and the `pytest` job of +# https://github.com/pypackaging-native/pkgconf-pypi/blob/3.0.7-0/.github/workflows/test.yml +name: Build pkgconf wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/pkgconf.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-pkgconf.yml' + - 'docs/packages/pkgconf.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-pkgconf.yml' + - 'docs/packages/pkgconf.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + MUSLLINUX_RISCV64_IMAGE: quay.io/pypa/musllinux_1_2_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: pkgconf + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + name: Build pkgconf ${{ matrix.version }} py3-none-riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + + env: + PKGCONF_VERSION: ${{ matrix.version }} + + steps: + # Upstream tags 3.0.7-0 for the wheel version 3.0.7.post0. + - id: tag + run: echo "ref=${PKGCONF_VERSION/.post/-}" >> "$GITHUB_OUTPUT" + + - name: Checkout pkgconf-pypi ${{ steps.tag.outputs.ref }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: pypackaging-native/pkgconf-pypi + ref: ${{ steps.tag.outputs.ref }} + submodules: true + persist-credentials: false + + - name: Checkout python-wheels + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: python-wheels + sparse-checkout: patches/pkgconf + persist-credentials: false + + - name: Patch pkgconf-pypi source + run: git apply python-wheels/patches/pkgconf/${{ env.PKGCONF_VERSION }}/00*.patch + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + env: + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} + # Upstream runs test.yml's suite from the checkout against `pip install .[test]`. + CIBW_TEST_EXTRAS: test + CIBW_TEST_COMMAND: cd {project} && python -m pytest --showlocals -vv + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: pkgconf-${{ env.PKGCONF_VERSION }}-py3-none-riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish pkgconf ${{ matrix.version }} + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + secrets: + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} + with: + artifact-pattern: pkgconf-${{ matrix.version }}-py3-none-riscv64 diff --git a/docs/packages/pkgconf.yaml b/docs/packages/pkgconf.yaml new file mode 100644 index 000000000000..8c0ff71d7301 --- /dev/null +++ b/docs/packages/pkgconf.yaml @@ -0,0 +1,6 @@ +package-name: pkgconf +source-code: https://github.com/pypackaging-native/pkgconf-pypi +license: MIT +versions: +- version: 3.0.7.post0 + patched: true diff --git a/patches/pkgconf/3.0.7.post0/0001-pyproject-ship-the-bundled-pkgconf-licence.patch b/patches/pkgconf/3.0.7.post0/0001-pyproject-ship-the-bundled-pkgconf-licence.patch new file mode 100644 index 000000000000..de2c65ba2b75 --- /dev/null +++ b/patches/pkgconf/3.0.7.post0/0001-pyproject-ship-the-bundled-pkgconf-licence.patch @@ -0,0 +1,36 @@ +From 5b03b1fb4ae4bb70283570180ccf18fa15149d7d Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Wed, 14 Oct 2026 11:42:49 +0000 +Subject: [PATCH] pyproject: ship the bundled pkgconf licence + +The wheel ships the `pkgconf` executable built from the +subprojects/pkgconf submodule, which is under the ISC licence. ISC +requires its copyright and permission notice to appear in all copies, +but `license-files = ['LICENSE']` only lists the wrapper's own MIT +licence, and meson-python implements no default licence glob, so +upstream's published wheels carry no pkgconf notice at all. + +List subprojects/pkgconf/COPYING as well; meson-python writes it to +dist-info/licenses/subprojects/pkgconf/COPYING. + +Upstream-Status: To upstream [not submitted from this automated port run; needs a pull request against pypackaging-native/pkgconf-pypi] +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index c1784ee..7f0c679 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -15,7 +15,7 @@ version = '3.0.7-0' + description = '`pkgconf` is a program which helps with discovering library dependencies and configuring compiler and linker flags.' + readme = 'README.md' + license = 'MIT' +-license-files = ['LICENSE'] ++license-files = ['LICENSE', 'subprojects/pkgconf/COPYING'] + authors = [ + {name = 'Ralf Gommers', email = 'ralf.gommers@gmail.com'}, + {name = 'Filipe LaĆ­ns', email = 'lains@riseup.net'} +-- +2.43.0 +