Skip to content

Commit 1340607

Browse files
fabaffSuperSandro2000
authored andcommitted
gpgme: add patch for Python 3.10 support
1 parent 7cbe22d commit 1340607

2 files changed

Lines changed: 424 additions & 17 deletions

File tree

pkgs/development/libraries/gpgme/default.nix

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
{ lib, stdenv, fetchurl, fetchpatch
2-
, autoreconfHook, libgpg-error, gnupg, pkg-config, glib, pth, libassuan
3-
, file, which, ncurses
1+
{ lib
2+
, stdenv
3+
, fetchurl
4+
, fetchpatch
5+
, autoreconfHook
6+
, libgpg-error
7+
, gnupg
8+
, pkg-config
9+
, glib
10+
, pth
11+
, libassuan
12+
, file
13+
, which
14+
, ncurses
415
, texinfo
516
, buildPackages
617
, qtbase ? null
7-
, pythonSupport ? false, swig2 ? null, python ? null
18+
, pythonSupport ? false
19+
, swig2 ? null
20+
, python ? null
821
}:
9-
1022
let
1123
inherit (stdenv.hostPlatform) system;
1224
in
13-
1425
stdenv.mkDerivation rec {
1526
pname = "gpgme";
1627
version = "1.17.0";
@@ -29,22 +40,46 @@ stdenv.mkDerivation rec {
2940
url = "https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20200415/f7be62d1/attachment.obj";
3041
sha256 = "00d4sxq63601lzdp2ha1i8fvybh7dzih4531jh8bx07fab3sw65g";
3142
})
43+
# Support for Python 3.10, https://dev.gnupg.org/D545
44+
./support-python-310.patch
3245
# Disable python tests on Darwin as they use gpg (see configureFlags below)
3346
] ++ lib.optional stdenv.isDarwin ./disable-python-tests.patch
34-
# Fix _AC_UNDECLARED_WARNING for autoconf≥2.70. See https://lists.gnupg.org/pipermail/gnupg-devel/2020-November/034643.html
47+
# Fix _AC_UNDECLARED_WARNING for autoconf>=2.70
48+
# See https://lists.gnupg.org/pipermail/gnupg-devel/2020-November/034643.html
3549
++ lib.optional stdenv.cc.isClang ./fix-clang-autoconf-undeclared-warning.patch;
3650

3751
outputs = [ "out" "dev" "info" ];
52+
3853
outputBin = "dev"; # gpgme-config; not so sure about gpgme-tool
3954

40-
propagatedBuildInputs =
41-
[ libgpg-error glib libassuan pth ]
42-
++ lib.optional (qtbase != null) qtbase;
55+
nativeBuildInputs = [
56+
autoreconfHook
57+
gnupg
58+
pkg-config
59+
texinfo
60+
] ++ lib.optionals pythonSupport [
61+
ncurses
62+
python
63+
swig2
64+
which
65+
];
4366

44-
nativeBuildInputs = [ pkg-config gnupg texinfo autoreconfHook ]
45-
++ lib.optionals pythonSupport [ python swig2 which ncurses ];
67+
propagatedBuildInputs = [
68+
glib
69+
libassuan
70+
libgpg-error
71+
pth
72+
] ++ lib.optional (qtbase != null) [
73+
qtbase
74+
];
4675

47-
depsBuildBuild = [ buildPackages.stdenv.cc ];
76+
checkInputs = [
77+
which
78+
];
79+
80+
depsBuildBuild = [
81+
buildPackages.stdenv.cc
82+
];
4883

4984
dontWrapQtApps = true;
5085

@@ -57,16 +92,15 @@ stdenv.mkDerivation rec {
5792
# which has a path length limit. Nix on darwin is using a build directory
5893
# that already has quite a long path and the resulting socket path doesn't
5994
# fit in the limit. https://github.com/NixOS/nix/pull/1085
60-
++ lib.optionals stdenv.isDarwin [ "--disable-gpg-test" ];
95+
++ lib.optionals stdenv.isDarwin [ "--disable-gpg-test" ];
6196

6297
NIX_CFLAGS_COMPILE = toString (
6398
# qgpgme uses Q_ASSERT which retains build inputs at runtime unless
6499
# debugging is disabled
65100
lib.optional (qtbase != null) "-DQT_NO_DEBUG"
66101
# https://www.gnupg.org/documentation/manuals/gpgme/Largefile-Support-_0028LFS_0029.html
67-
++ lib.optional (system == "i686-linux") "-D_FILE_OFFSET_BITS=64");
68-
69-
checkInputs = [ which ];
102+
++ lib.optional (system == "i686-linux") "-D_FILE_OFFSET_BITS=64"
103+
);
70104

71105
doCheck = true;
72106

0 commit comments

Comments
 (0)