Pārlūkot izejas kodu

Provide gpgme-config on Ubuntu (#1487)

Jelmer Vernooij 1 mēnesi atpakaļ
vecāks
revīzija
6be41cf056

+ 23 - 0
.github/gpg-error-config

@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# gpg-error-config: simple replacement gpg-error-config that is a shim
+# for pkg-config.
+
+# Parse flags
+for arg in "$@"; do
+  case $arg in
+	--cflags)
+	  pkg-config --cflags gpg-error
+	  ;;
+	--libs)
+	  pkg-config --libs gpg-error
+	  ;;
+	--version)
+	  pkg-config --modversion gpg-error
+	  ;;
+	*)
+	  echo "Unknown option: $arg" >&2
+	  exit 1
+	  ;;
+  esac
+done

+ 29 - 0
.github/gpgme-config

@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Parse gpgme-config-like flags, then invoke `pkg-config gpgme`:
+# * Pass --cflags and --libs through
+# * Map --version to --modversion
+# * Ignore --thread=pthread
+
+# Parse flags
+for arg in "$@"; do
+  case "$arg" in
+	--cflags|--libs|--modversion)
+	  flags="$flags $arg"
+	  ;;
+	--version)
+	  flags="$flags --modversion"
+	  ;;
+	--thread=pthread)
+	  ;;
+	--prefix)
+	  flags="$flags --variable=prefix"
+	  ;;
+	*)
+	  echo "Unknown flag: $arg" >&2
+	  exit 1
+	  ;;
+  esac
+done
+
+exec pkg-config gpgme $flags

+ 3 - 1
.github/workflows/python-distributions.yml

@@ -129,7 +129,9 @@ jobs:
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          pip install twine
+          # Upgrade packging to avoid a bug in twine.
+          # See https://github.com/pypa/twine/issues/1216
+          pip install "twine>=6.1.0" "packaging>=24.2"
       - name: Download sdist
         uses: actions/download-artifact@v4
         with:

+ 7 - 0
.github/workflows/pythontest.yml

@@ -28,6 +28,13 @@ jobs:
       - name: Install native dependencies (Ubuntu)
         run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev
         if: "matrix.os == 'ubuntu-latest'"
+      - name: Provide gpgme-config and gpg-error-config
+        if: "matrix.os == 'ubuntu-latest'"
+        run: |
+          mkdir -p "$HOME/.local/bin"
+          cp .github/gpgme-config "$HOME/.local/bin/gpgme-config"
+          cp .github/gpg-error-config "$HOME/.local/bin/gpg-error-config"
+          echo "$HOME/.local/bin" >> $GITHUB_PATH
       - name: Install native dependencies (MacOS)
         run: brew install swig gpgme
         if: "matrix.os == 'macos-latest'"