nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 glib,
7 zlib,
8 gnupg,
9 gpgme,
10 libidn2,
11 libunistring,
12 gobject-introspection,
13 vala,
14}:
15
16stdenv.mkDerivation rec {
17 version = "3.2.15";
18 pname = "gmime";
19
20 src = fetchurl {
21 # https://github.com/jstedfast/gmime/releases
22 url = "https://github.com/jstedfast/gmime/releases/download/${version}/gmime-${version}.tar.xz";
23 sha256 = "sha256-hM0qSBonlw7Dm1yV9y2wJnIpBKLM8/29V7KAzy0CtcQ=";
24 };
25
26 outputs = [
27 "out"
28 "dev"
29 ];
30
31 nativeBuildInputs = [
32 pkg-config
33 gobject-introspection
34 vala
35 ];
36 buildInputs = [
37 zlib
38 gpgme
39 libidn2
40 libunistring
41 vala # for share/vala/Makefile.vapigen
42 ];
43 propagatedBuildInputs = [ glib ];
44 configureFlags = [
45 "--enable-introspection=yes"
46 "--enable-vala=yes"
47 ]
48 ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ];
49
50 postPatch = ''
51 substituteInPlace tests/testsuite.c \
52 --replace /bin/rm rm
53 ''
54 + lib.optionalString stdenv.hostPlatform.isDarwin ''
55 # This specific test fails on darwin for some unknown reason
56 substituteInPlace tests/test-filters.c \
57 --replace-fail 'test_charset_conversion (datadir, "japanese", "utf-8", "iso-2022-jp");' ""
58 '';
59
60 preConfigure = ''
61 PKG_CONFIG_VAPIGEN_VAPIGEN="$(type -p vapigen)"
62 export PKG_CONFIG_VAPIGEN_VAPIGEN
63 ''
64 + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
65 cp ${
66 if stdenv.hostPlatform.isMusl then ./musl-iconv-detect.h else ./iconv-detect.h
67 } ./iconv-detect.h
68 '';
69
70 nativeCheckInputs = [ gnupg ];
71
72 doCheck = true;
73
74 enableParallelBuilding = true;
75
76 meta = {
77 homepage = "https://github.com/jstedfast/gmime/";
78 description = "C/C++ library for creating, editing and parsing MIME messages and structures";
79 license = lib.licenses.lgpl21Plus;
80 maintainers = [ ];
81 platforms = lib.platforms.unix;
82 };
83}