1{ fetchurl, lib, stdenv, gettext, npth, libgpg-error, buildPackages, gitUpdater }:
2
3stdenv.mkDerivation rec {
4 pname = "libassuan";
5 version = "2.5.7";
6
7 src = fetchurl {
8 url = "mirror://gnupg/${pname}/${pname}-${version}.tar.bz2";
9 sha256 = "sha256-AQMIH/wng4ouUEeRU8oQXoc9PWXYqVkygunJTH5q+3Y=";
10 };
11
12 outputs = [ "out" "dev" "info" ];
13 outputBin = "dev"; # libassuan-config
14
15 depsBuildBuild = [ buildPackages.stdenv.cc ];
16 buildInputs = [ npth gettext ];
17
18 configureFlags = [
19 # Required for cross-compilation.
20 "--with-libgpg-error-prefix=${libgpg-error.dev}"
21 ];
22
23 doCheck = true;
24
25 # Make sure includes are fixed for callers who don't use libassuan-config
26 postInstall = ''
27 sed -i 's,#include <gpg-error.h>,#include "${libgpg-error.dev}/include/gpg-error.h",g' $dev/include/assuan.h
28 '';
29
30 passthru.updateScript = gitUpdater {
31 url = "https://dev.gnupg.org/source/libassuan.git";
32 rev-prefix = "libassuan-";
33 ignoredVersions = ".*-base";
34 };
35
36 meta = with lib; {
37 description = "IPC library used by GnuPG and related software";
38 mainProgram = "libassuan-config";
39 longDescription = ''
40 Libassuan is a small library implementing the so-called Assuan
41 protocol. This protocol is used for IPC between most newer
42 GnuPG components. Both, server and client side functions are
43 provided.
44 '';
45 homepage = "https://gnupg.org/software/libassuan/";
46 changelog = "https://dev.gnupg.org/source/libassuan/browse/master/NEWS;libassuan-${version}";
47 license = licenses.lgpl2Plus;
48 platforms = platforms.all;
49 maintainers = [ ];
50 };
51}