about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gpgme/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-02-26 16:20:28 +0100
committerAlyssa Ross <hi@alyssa.is>2024-02-26 16:20:28 +0100
commit647438344bfc1f77791391e2b4f98eef865c63dc (patch)
treeef580867fc6cc413940e4330d939cf1afda082cb /nixpkgs/pkgs/development/libraries/gpgme/default.nix
parentb084c6a0fab7f32c904c5c8e8db8dddcefbe507f (diff)
parente3474e1d1e53b70e2b2af73ea26d6340e82f6b8b (diff)
downloadnixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar.gz
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar.bz2
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar.lz
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar.xz
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.tar.zst
nixlib-647438344bfc1f77791391e2b4f98eef865c63dc.zip
Merge commit 'e3474e1d1e53'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gpgme/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/gpgme/default.nix29
1 files changed, 18 insertions, 11 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gpgme/default.nix b/nixpkgs/pkgs/development/libraries/gpgme/default.nix
index ca359fcc912b..c712b5195dc5 100644
--- a/nixpkgs/pkgs/development/libraries/gpgme/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gpgme/default.nix
@@ -1,7 +1,6 @@
 { lib
 , stdenv
 , fetchurl
-, fetchpatch
 , autoreconfHook
 , libgpg-error
 , gnupg
@@ -9,7 +8,6 @@
 , glib
 , pth
 , libassuan
-, file
 , which
 , ncurses
 , texinfo
@@ -22,28 +20,34 @@
 , qt6Packages
 , python3
 }:
-let
-  inherit (stdenv.hostPlatform) system;
-in
+
 stdenv.mkDerivation rec {
   pname = "gpgme";
   version = "1.23.2";
+  pyproject = true;
+
+  outputs = [ "out" "dev" "info" ];
+
+  outputBin = "dev"; # gpgme-config; not so sure about gpgme-tool
 
   src = fetchurl {
-    url = "mirror://gnupg/gpgme/${pname}-${version}.tar.bz2";
+    url = "mirror://gnupg/gpgme/gpgme-${version}.tar.bz2";
     hash = "sha256-lJnosfM8zLaBVSehvBYEnTWmGYpsX64BhfK9VhvOUiQ=";
   };
 
   patches = [
-    # Support Python 3.10 version detection without distutils, https://dev.gnupg.org/D545
-    ./python-310-detection-without-distutils.patch
+    # Support Python 3.10-3.12, remove distutils, https://dev.gnupg.org/D545
+    ./python-310-312-remove-distutils.patch
     # Fix a test after disallowing compressed signatures in gpg (PR #180336)
     ./test_t-verify_double-plaintext.patch
   ];
 
-  outputs = [ "out" "dev" "info" ];
-
-  outputBin = "dev"; # gpgme-config; not so sure about gpgme-tool
+  postPatch = ''
+    # autoconf's beta detection requires a git repo to work
+    # and otherwise appends -unknown to the version number used in the python package which pip stumbles upon
+    substituteInPlace autogen.sh \
+      --replace-fail 'tmp="-unknown"' 'tmp=""'
+  '';
 
   nativeBuildInputs = [
     autoreconfHook
@@ -52,6 +56,9 @@ stdenv.mkDerivation rec {
     texinfo
   ] ++ lib.optionals pythonSupport [
     python3.pythonOnBuildForHost
+    python3.pkgs.pip
+    python3.pkgs.setuptools
+    python3.pkgs.wheel
     ncurses
     swig2
     which