]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
build: build libpq 14 for musllinux packages
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 13 Jun 2022 01:15:31 +0000 (03:15 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 14 Jun 2022 22:56:07 +0000 (00:56 +0200)
Currently Alpine ships with libpq 12, which wouldn't allow to use the
pipeline mode.

Use the system packages for the other libraries, for the moment.

docs/news.rst
tools/build/build_libpq.sh
tools/build/wheel_linux_before_all.sh

index 917c86e0a0d0728b41ce839d9755f1436a8d58b9..f8d43bf535a106a00b85e9dca451c2be8c858c5c 100644 (file)
@@ -38,6 +38,7 @@ Psycopg 3.0.15 (unreleased)
 - Restore the connection to usable state after an error in `~Cursor.stream()`.
 - Raise `DataError` instead of `OverflowError` loading binary intervals
   out-of-range.
+- Distribute ``manylinux2014`` wheel packages (:ticket:`#124`).
 
 
 Current release
index 06360117bdacd448413d0777ddd409037db2c9a6..5f3188150b4256ce1bccd990910e048a8996fb60 100755 (executable)
@@ -10,83 +10,109 @@ ldap_version="2.6.2"
 sasl_version="2.1.28"
 postgres_version="14.3"
 
-yum install -y zlib-devel krb5-devel pam-devel
+source /etc/os-release
+
+case "$ID" in
+    centos)
+        yum install -y zlib-devel krb5-devel pam-devel
+        ;;
+
+    alpine)
+        apk add --no-cache zlib-dev krb5-dev linux-pam-dev openldap-dev
+        ;;
+
+    *)
+        echo "$0: unexpected Linux distribution: '$ID'" >&2
+        exit 1
+        ;;
+esac
+
+if [ "$ID" == "centos" ]; then
+
+    # Build openssl if needed
+    openssl_tag="OpenSSL_${openssl_version//./_}"
+    openssl_dir="openssl-${openssl_tag}"
+    if [ ! -d "${openssl_dir}" ]; then curl -sL \
+            https://github.com/openssl/openssl/archive/${openssl_tag}.tar.gz \
+            | tar xzf -
+
+        cd "${openssl_dir}"
+
+        ./config --prefix=/usr/local/ --openssldir=/usr/local/ \
+            zlib -fPIC shared
+        make depend
+        make
+    else
+        cd "${openssl_dir}"
+    fi
 
+    # Install openssl
+    make install_sw
+    cd ..
 
-# Build openssl if needed
-openssl_tag="OpenSSL_${openssl_version//./_}"
-openssl_dir="openssl-${openssl_tag}"
-if [ ! -d "${openssl_dir}" ]; then curl -sL \
-        https://github.com/openssl/openssl/archive/${openssl_tag}.tar.gz \
-        | tar xzf -
+fi
 
-    cd "${openssl_dir}"
 
-    ./config --prefix=/usr/local/ --openssldir=/usr/local/ \
-        zlib -fPIC shared
-    make depend
-    make
-else
-    cd "${openssl_dir}"
-fi
+if [ "$ID" == "centos" ]; then
 
-# Install openssl
-make install_sw
-cd ..
+    # Build libsasl2 if needed
+    # The system package (cyrus-sasl-devel) causes an amazing error on i686:
+    # "unsupported version 0 of Verneed record"
+    # https://github.com/pypa/manylinux/issues/376
+    sasl_tag="cyrus-sasl-${sasl_version}"
+    sasl_dir="cyrus-sasl-${sasl_tag}"
+    if [ ! -d "${sasl_dir}" ]; then
+        curl -sL \
+            https://github.com/cyrusimap/cyrus-sasl/archive/${sasl_tag}.tar.gz \
+            | tar xzf -
 
+        cd "${sasl_dir}"
 
-# Build libsasl2 if needed
-# The system package (cyrus-sasl-devel) causes an amazing error on i686:
-# "unsupported version 0 of Verneed record"
-# https://github.com/pypa/manylinux/issues/376
-sasl_tag="cyrus-sasl-${sasl_version}"
-sasl_dir="cyrus-sasl-${sasl_tag}"
-if [ ! -d "${sasl_dir}" ]; then
-    curl -sL \
-        https://github.com/cyrusimap/cyrus-sasl/archive/${sasl_tag}.tar.gz \
-        | tar xzf -
+        autoreconf -i
+        ./configure
+        make
+    else
+        cd "${sasl_dir}"
+    fi
 
-    cd "${sasl_dir}"
+    # Install libsasl2
+    # requires missing nroff to build
+    touch saslauthd/saslauthd.8
+    make install
+    cd ..
 
-    autoreconf -i
-    ./configure
-    make
-else
-    cd "${sasl_dir}"
 fi
 
-# Install libsasl2
-# requires missing nroff to build
-touch saslauthd/saslauthd.8
-make install
-cd ..
 
+if [ "$ID" == "centos" ]; then
 
-# Build openldap if needed
-ldap_tag="${ldap_version}"
-ldap_dir="openldap-${ldap_tag}"
-if [ ! -d "${ldap_dir}" ]; then
-    curl -sL \
-        https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-${ldap_tag}.tgz \
-        | tar xzf -
+    # Build openldap if needed
+    ldap_tag="${ldap_version}"
+    ldap_dir="openldap-${ldap_tag}"
+    if [ ! -d "${ldap_dir}" ]; then
+        curl -sL \
+            https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-${ldap_tag}.tgz \
+            | tar xzf -
 
-    cd "${ldap_dir}"
+        cd "${ldap_dir}"
 
-    ./configure --enable-backends=no --enable-null
-    make depend
-    make -C libraries/liblutil/
-    make -C libraries/liblber/
-    make -C libraries/libldap/
-else
-    cd "${ldap_dir}"
-fi
+        ./configure --enable-backends=no --enable-null
+        make depend
+        make -C libraries/liblutil/
+        make -C libraries/liblber/
+        make -C libraries/libldap/
+    else
+        cd "${ldap_dir}"
+    fi
 
-# Install openldap
-make -C libraries/liblber/ install
-make -C libraries/libldap/ install
-make -C include/ install
-chmod +x /usr/local/lib/{libldap,liblber}*.so*
-cd ..
+    # Install openldap
+    make -C libraries/liblber/ install
+    make -C libraries/libldap/ install
+    make -C include/ install
+    chmod +x /usr/local/lib/{libldap,liblber}*.so*
+    cd ..
+
+fi
 
 
 # Build libpq if needed
@@ -106,7 +132,7 @@ if [ ! -d "${postgres_dir}" ]; then
         src/include/pg_config_manual.h
 
     # Without this, libpq ./configure fails on i686
-    if [[ "$(uname -m)" == "i686" ]]; then
+    if [[ "$(uname -m)" != "x86_64" ]]; then
         export LD_LIBRARY_PATH=/usr/local/lib
     fi
 
index 3426fa31f5c76ca6cfd2fb0e57880b5d6f2b4c6e..663e3efd81ceb53ad3c13d812ee13ba2796a311a 100755 (executable)
@@ -15,7 +15,8 @@ case "$ID" in
     alpine)
         # tzdata is required for datetime tests.
         apk update
-        apk add --no-cache postgresql-dev tzdata
+        apk add --no-cache tzdata
+        "${dir}/build_libpq.sh" > /dev/null
         ;;
 
     debian)