Browse Source

Provide gpgme-config on Ubuntu

Jelmer Vernooij 1 month ago
parent
commit
db70fb0025
2 changed files with 33 additions and 0 deletions
  1. 26 0
      .github/gpgme-config
  2. 7 0
      .github/workflows/pythontest.yml

+ 26 - 0
.github/gpgme-config

@@ -0,0 +1,26 @@
+#!/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)
+	  ;;
+	*)
+	  echo "Unknown flag: $arg" >&2
+	  exit 1
+	  ;;
+  esac
+done
+
+exec pkg-config gpgme $flags

+ 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 for gpgme
+        if: "matrix.os == 'ubuntu-latest'"
+        run: |
+          mkdir -p "$HOME/.local/bin"
+          cp .github/gpgme-config "$HOME/.local/bin/gpgme-config"
+          chmod +x "$HOME/.local/bin/gpgme-config"
+          echo "$HOME/.local/bin" >> $GITHUB_PATH
       - name: Install native dependencies (MacOS)
         run: brew install swig gpgme
         if: "matrix.os == 'macos-latest'"