]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Add Alpine support to `wheel_linux_before_all.sh` script 141/head
authorPeter Lithammer <peter.lithammer@gmail.com>
Mon, 8 Nov 2021 16:06:22 +0000 (17:06 +0100)
committerPeter Lithammer <peter.lithammer@gmail.com>
Tue, 9 Nov 2021 15:47:41 +0000 (16:47 +0100)
.github/workflows/packages.yml
tools/build/wheel_linux_before_all.sh

index 29cd0cbd5586f59ffe68bd58f09a80e6cc91e1eb..76fd3caa7aaa1ce2ce00e2ad9c8381784fbfe106 100644 (file)
@@ -93,6 +93,7 @@ jobs:
       matrix:
         arch: [x86_64, i686, ppc64le, aarch64]
         pyver: [cp36, cp37, cp38, cp39, cp310]
+        platform: [manylinux, musllinux]
 
     steps:
       - uses: actions/checkout@v2
@@ -112,7 +113,7 @@ jobs:
           CIBW_MANYLINUX_I686_IMAGE: manylinux_2_24
           CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_24
           CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux_2_24
-          CIBW_BUILD: ${{matrix.pyver}}-manylinux_${{matrix.arch}}
+          CIBW_BUILD: ${{matrix.pyver}}-${{matrix.platform}}_${{matrix.arch}}
           CIBW_ARCHS_LINUX: auto aarch64 ppc64le
           CIBW_BEFORE_ALL_LINUX: ./tools/build/wheel_linux_before_all.sh
           CIBW_REPAIR_WHEEL_COMMAND: >-
index f005bc8de2f63241b8361821f0675118d51139d8..cd5ee908b0425fec94cbb2ccdd5d319ea4e047cb 100755 (executable)
@@ -6,23 +6,33 @@
 set -euo pipefail
 set -x
 
-dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+. /etc/os-release
 
-# Install libpq
-# Note that the pgdg doesn't have an aarch64 repository so wheels are build
-# with the libpq packaged with Debian 9, which is 9.6.
-if [[ ! "$AUDITWHEEL_ARCH" = "aarch64" ]]; then
-    source /etc/os-release
-    echo "deb http://apt.postgresql.org/pub/repos/apt ${VERSION_CODENAME}-pgdg main" \
-        > /etc/apt/sources.list.d/pgdg.list
-    # TODO: on 2021-09-30 curl fails with
-    # curl: (60) SSL certificate problem: certificate has expired
-    # Test again later if -k can be removed.
-    curl -sk https://www.postgresql.org/media/keys/ACCC4CF8.asc \
-        | apt-key add -
-fi
-
-apt-get update
-
-# zip is required by strip_wheel.sh
-apt-get -y install libpq-dev zip
+# Install PostgreSQL development files.
+case "$ID" in
+    alpine)
+        # zip is required by strip_wheel.sh
+        # tzdata is required for datetime tests.
+        apk add --no-cache postgresql-dev tzdata zip
+        ;;
+    debian)
+        # Note that the pgdg doesn't have an aarch64 repository so wheels are
+        # build with the libpq packaged with Debian 9, which is 9.6.
+        if [ "$AUDITWHEEL_ARCH" != 'aarch64' ]; then
+            echo "deb http://apt.postgresql.org/pub/repos/apt $VERSION_CODENAME-pgdg main" \
+                > /etc/apt/sources.list.d/pgdg.list
+            # TODO: On 2021-11-09 curl fails on 'ppc64le' with:
+            #   curl: (60) SSL certificate problem: certificate has expired
+            # Test again later if -k can be removed.
+            curl -skf https://www.postgresql.org/media/keys/ACCC4CF8.asc \
+                > /etc/apt/trusted.gpg.d/postgresql.asc
+        fi
+        apt-get update
+        # zip is required by strip_wheel.sh
+        apt-get -y install libpq-dev zip
+        ;;
+    *)
+        echo "Unexpected Linux distribution: '$ID'" >&2
+        exit 1
+        ;;
+esac