diff --git a/.github/workflows/build-sqlean-py.yml b/.github/workflows/build-sqlean-py.yml new file mode 100644 index 000000000..9b3aa5122 --- /dev/null +++ b/.github/workflows/build-sqlean-py.yml @@ -0,0 +1,91 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# Based on the `wheels` job of +# https://github.com/nalgeon/sqlean.py/blob/3.50.4.5/.github/workflows/publish.yaml +name: Build sqlean-py wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'sqlean-py version/tag to build, e.g. 3.50.4.5' + required: true + default: '3.50.4.5' + pull_request: + paths: + - '.github/workflows/build-sqlean-py.yml' + +concurrency: + group: ${{ github.workflow }}-${{ inputs.version || '3.50.4.5' }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + SQLEAN_PY_VERSION: ${{ inputs.version || '3.50.4.5' }} + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + + build_wheels: + needs: [setup] + name: Build sqlean-py ${{ inputs.version || '3.50.4.5' }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + python: ["cp312", "cp313", "cp314", "cp314t"] + + steps: + - name: Checkout sqlean-py ${{ env.SQLEAN_PY_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: nalgeon/sqlean.py + ref: ${{ env.SQLEAN_PY_VERSION }} + persist-credentials: false + + - name: Checkout python-wheels + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: python-wheels + persist-credentials: false + + - name: Patch sqlean-py source + run: git apply python-wheels/patches/sqlean-py/${{ env.SQLEAN_PY_VERSION }}/00*.patch + + - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + env: + CIBW_ARCHS: riscv64 + CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # Mirrors upstream's `download-sources` job: sqlite/sqlean sources + # aren't checked in, they're fetched at build time (Makefile). + CIBW_BEFORE_BUILD: >- + dnf install -y unzip && + make prepare-src download-sqlite download-sqlean + CIBW_TEST_SOURCES: tests setup.py README.md + # tests/extensions.py imports setup.py (for SQLEAN_VERSION), which + # imports setuptools; the test venv doesn't have it otherwise. + CIBW_TEST_REQUIRES: setuptools + CIBW_TEST_COMMAND: python -m tests + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: sqlean-py-${{ env.SQLEAN_PY_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: ./wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish sqlean-py ${{ inputs.version || '3.50.4.5' }} + needs: [setup, build_wheels] + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + with: + artifact-pattern: sqlean-py-${{ inputs.version || '3.50.4.5' }}-*-manylinux_riscv64 diff --git a/patches/sqlean-py/3.50.4.5/0001-add-the-vendored-sqlean-and-PCRE2-licences-next-to-the-package-s-own.patch b/patches/sqlean-py/3.50.4.5/0001-add-the-vendored-sqlean-and-PCRE2-licences-next-to-the-package-s-own.patch new file mode 100644 index 000000000..4d32bef1d --- /dev/null +++ b/patches/sqlean-py/3.50.4.5/0001-add-the-vendored-sqlean-and-PCRE2-licences-next-to-the-package-s-own.patch @@ -0,0 +1,147 @@ +From 10475223f1730f651973f7dc365c742e7bedb474 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Mon, 7 Sep 2026 03:44:56 +0200 +Subject: [PATCH] add the vendored sqlean and PCRE2 licences next to the + package's own + +setup.py compiles the sqlean extensions (nalgeon/sqlean v0.27.4, MIT) and +their bundled PCRE2 regex engine (BSD-3-Clause) straight into the +sqlean._sqlite3 extension via the Makefile's download-sqlean target, but +neither source is checked into this repo (fetched at build time) so +neither licence ships. The wheel carries only the wrapper's own +zlib/libpng LICENSE: setuptools globs licence files from the project +root, and the vendored notices never land there. + +Add both licences at the root as LICENSE.sqlean and LICENSE.pcre2, which +the default LICEN[CS]E* glob picks up, so they land in +dist-info/licenses/ beside LICENSE with no packaging change. + +Upstream-Status: To upstream [blocked: this port may only touch riseproject-dev/python-wheels] + +Signed-off-by: Ludovic Henry +--- + LICENSE.pcre2 | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ + LICENSE.sqlean | 21 +++++++++++++ + 2 files changed, 104 insertions(+) + create mode 100644 LICENSE.pcre2 + create mode 100644 LICENSE.sqlean + +diff --git a/LICENSE.pcre2 b/LICENSE.pcre2 +new file mode 100644 +index 0000000..eddd38e +--- /dev/null ++++ b/LICENSE.pcre2 +@@ -0,0 +1,83 @@ ++## PCRE2 LICENCE ++ ++PCRE2 is a library of functions to support regular expressions whose syntax ++and semantics are as close as possible to those of the Perl 5 language. ++ ++Releases 10.00 and above of PCRE2 are distributed under the terms of the "BSD" ++licence, as specified below, with one exemption for certain binary ++redistributions. The documentation for PCRE2, supplied in the "doc" directory, ++is distributed under the same terms as the software itself. The data in the ++testdata directory is not copyrighted and is in the public domain. ++ ++The basic library functions are written in C and are freestanding. Also ++included in the distribution is a just-in-time compiler that can be used to ++optimize pattern matching. This is an optional feature that can be omitted when ++the library is built. ++ ++## THE BASIC LIBRARY FUNCTIONS ++ ++Written by: Philip Hazel ++Email local part: Philip.Hazel ++Email domain: gmail.com ++ ++Retired from University of Cambridge Computing Service, ++Cambridge, England. ++ ++Copyright (c) 1997-2022 University of Cambridge ++All rights reserved. ++ ++## PCRE2 JUST-IN-TIME COMPILATION SUPPORT ++ ++Written by: Zoltan Herczeg ++Email local part: hzmester ++Email domain: freemail.hu ++ ++Copyright(c) 2010-2022 Zoltan Herczeg ++All rights reserved. ++ ++## STACK-LESS JUST-IN-TIME COMPILER ++ ++Written by: Zoltan Herczeg ++Email local part: hzmester ++Email domain: freemail.hu ++ ++Copyright(c) 2009-2022 Zoltan Herczeg ++All rights reserved. ++ ++## THE "BSD" LICENCE ++ ++Redistribution and use in source and binary forms, with or without ++modification, are permitted provided that the following conditions are met: ++ ++ * Redistributions of source code must retain the above copyright notices, ++ this list of conditions and the following disclaimer. ++ ++ * Redistributions in binary form must reproduce the above copyright ++ notices, this list of conditions and the following disclaimer in the ++ documentation and/or other materials provided with the distribution. ++ ++ * Neither the name of the University of Cambridge nor the names of any ++ contributors may be used to endorse or promote products derived from this ++ software without specific prior written permission. ++ ++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++POSSIBILITY OF SUCH DAMAGE. ++ ++## EXEMPTION FOR BINARY LIBRARY-LIKE PACKAGES ++ ++The second condition in the BSD licence (covering binary redistributions) does ++not apply all the way down a chain of software. If binary package A includes ++PCRE2, it must respect the condition, but if package B is software that ++includes package A, the condition is not imposed on package B unless it uses ++PCRE2 independently. ++ ++End +diff --git a/LICENSE.sqlean b/LICENSE.sqlean +new file mode 100644 +index 0000000..a386b83 +--- /dev/null ++++ b/LICENSE.sqlean +@@ -0,0 +1,21 @@ ++MIT License ++ ++Copyright (c) 2021+ Anton Zhiyanov ++ ++Permission is hereby granted, free of charge, to any person obtaining a copy ++of this software and associated documentation files (the "Software"), to deal ++in the Software without restriction, including without limitation the rights ++to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ++copies of the Software, and to permit persons to whom the Software is ++furnished to do so, subject to the following conditions: ++ ++The above copyright notice and this permission notice shall be included in all ++copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++SOFTWARE. +-- +2.50.1 (Apple Git-155) +