about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gmime
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gmime')
-rw-r--r--nixpkgs/pkgs/development/libraries/gmime/2.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gmime/3.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/gmime/iconv-detect.h6
-rw-r--r--nixpkgs/pkgs/development/libraries/gmime/musl-iconv-detect.h6
4 files changed, 37 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gmime/2.nix b/nixpkgs/pkgs/development/libraries/gmime/2.nix
index f5575bd20c8f..d6369227739b 100644
--- a/nixpkgs/pkgs/development/libraries/gmime/2.nix
+++ b/nixpkgs/pkgs/development/libraries/gmime/2.nix
@@ -13,7 +13,9 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config gobject-introspection ];
   propagatedBuildInputs = [ glib zlib libgpg-error ];
-  configureFlags = [ "--enable-introspection=yes" ];
+  configureFlags = [
+    "--enable-introspection=yes"
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ];
 
   postPatch = ''
     substituteInPlace tests/testsuite.c \
@@ -24,7 +26,11 @@ stdenv.mkDerivation rec {
       --replace /bin/mkdir mkdir
   '';
 
-  checkInputs = [ gnupg ];
+  preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
+    cp ${if stdenv.hostPlatform.isMusl then ./musl-iconv-detect.h else ./iconv-detect.h} ./iconv-detect.h
+  '';
+
+  nativeCheckInputs = [ gnupg ];
 
   enableParallelBuilding = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/gmime/3.nix b/nixpkgs/pkgs/development/libraries/gmime/3.nix
index 4ec99d2e18f3..e5a70f234872 100644
--- a/nixpkgs/pkgs/development/libraries/gmime/3.nix
+++ b/nixpkgs/pkgs/development/libraries/gmime/3.nix
@@ -12,20 +12,33 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  buildInputs = [ vala gobject-introspection zlib gpgme libidn2 libunistring ];
-  nativeBuildInputs = [ pkg-config ];
+  nativeBuildInputs = [ pkg-config gobject-introspection vala ];
+  buildInputs = [
+    zlib
+    gpgme
+    libidn2
+    libunistring
+    vala # for share/vala/Makefile.vapigen
+  ];
   propagatedBuildInputs = [ glib ];
   configureFlags = [
     "--enable-introspection=yes"
     "--enable-vala=yes"
-  ];
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ];
 
   postPatch = ''
     substituteInPlace tests/testsuite.c \
       --replace /bin/rm rm
   '';
 
-  checkInputs = [ gnupg ];
+  preConfigure = ''
+    PKG_CONFIG_VAPIGEN_VAPIGEN="$(type -p vapigen)"
+    export PKG_CONFIG_VAPIGEN_VAPIGEN
+  '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
+    cp ${if stdenv.hostPlatform.isMusl then ./musl-iconv-detect.h else ./iconv-detect.h} ./iconv-detect.h
+  '';
+
+  nativeCheckInputs = [ gnupg ];
 
   doCheck = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/gmime/iconv-detect.h b/nixpkgs/pkgs/development/libraries/gmime/iconv-detect.h
new file mode 100644
index 000000000000..6d9dd05b59e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmime/iconv-detect.h
@@ -0,0 +1,6 @@
+/* This is an auto-generated header, DO NOT EDIT! */
+
+#define ICONV_ISO_INT_FORMAT "iso-%u-%u"
+#define ICONV_ISO_STR_FORMAT "iso-%u-%s"
+#define ICONV_SHIFT_JIS "shift-jis"
+#define ICONV_10646 "iso-10646"
diff --git a/nixpkgs/pkgs/development/libraries/gmime/musl-iconv-detect.h b/nixpkgs/pkgs/development/libraries/gmime/musl-iconv-detect.h
new file mode 100644
index 000000000000..569da106b943
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmime/musl-iconv-detect.h
@@ -0,0 +1,6 @@
+/* This is an auto-generated header, DO NOT EDIT! */
+
+#define ICONV_ISO_INT_FORMAT "iso-%u-%u"
+#define ICONV_ISO_STR_FORMAT "iso-%u-%s"
+#define ICONV_SHIFT_JIS "shift-jis"
+#define ICONV_10646 "UCS-4BE"