about summary refs log tree commit diff
path: root/pkgs/applications/graphics/nufraw
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-09-30 23:10:09 +0200
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-09-30 23:10:09 +0200
commit880b7a5f153a1411be8eb02e68bef75a96eb60e6 (patch)
treecc1c87a253b83c19bc61d7e0fa4b9115b81fe8be /pkgs/applications/graphics/nufraw
parentd90e8fdfb7ea4885907c1570877197160cff2d44 (diff)
nufraw: refactor, add patch for exiv2 0.28
Diffstat (limited to 'pkgs/applications/graphics/nufraw')
-rw-r--r--pkgs/applications/graphics/nufraw/default.nix27
-rw-r--r--pkgs/applications/graphics/nufraw/move-extern-c.patch21
2 files changed, 21 insertions, 27 deletions
diff --git a/pkgs/applications/graphics/nufraw/default.nix b/pkgs/applications/graphics/nufraw/default.nix
index f6031bea069d9..8b5966bbaf0a5 100644
--- a/pkgs/applications/graphics/nufraw/default.nix
+++ b/pkgs/applications/graphics/nufraw/default.nix
@@ -1,6 +1,7 @@
-{ stdenv
+{ lib
+, stdenv
 , fetchurl
-, lib
+, fetchpatch
 
 , autoreconfHook
 , bzip2
@@ -49,14 +50,28 @@ stdenv.mkDerivation rec {
     "--enable-dst-correction"
   ];
 
+  env.NIX_CFLAGS_COMPILE = "-Wno-narrowing";
+
   postInstall = lib.optionalString addThumbnailer ''
     mkdir -p $out/share/thumbnailers
     substituteAll ${./nufraw.thumbnailer} $out/share/thumbnailers/${pname}.thumbnailer
   '';
 
-  # Fixes an upstream issue where headers with templates were included in an extern-C scope
-  # which caused the build to fail
-  patches = [ ./move-extern-c.patch ];
+  patches = [
+    # Fixes an upstream issue where headers with templates were included in an extern-C scope
+    # which caused the build to fail
+    (fetchpatch {
+      name = "0001-nufraw-glib-2.70.patch";
+      url = "https://gitlab.archlinux.org/archlinux/packaging/packages/gimp-nufraw/-/raw/3405bc864752dbd04f2d182a21b4108d6cc3aa95/0001-nufraw-glib-2.70.patch";
+      hash = "sha256-XgzgjikWTcqymHa7bKmruNZaeb2/lpN19HXoRUt5rTk=";
+    })
+  ] ++ lib.optionals (lib.versionAtLeast exiv2.version "0.28") [
+    (fetchpatch {
+      name = "0002-exiv2-error.patch";
+      url = "https://gitlab.archlinux.org/archlinux/packaging/packages/gimp-nufraw/-/raw/3405bc864752dbd04f2d182a21b4108d6cc3aa95/0002-exiv2-error.patch";
+      hash = "sha256-40/Wwk1sWiaIWp077EYgP8jFO4k1cvf30heRDMYJw3M=";
+    })
+  ];
 
   meta = with lib; {
     homepage = "https://nufraw.sourceforge.io/";
@@ -70,6 +85,6 @@ stdenv.mkDerivation rec {
       '';
     license = licenses.gpl2Plus;
     maintainers = with maintainers; [ asbachb ];
-    platforms   = [ "x86_64-linux" "i686-linux" ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/nufraw/move-extern-c.patch b/pkgs/applications/graphics/nufraw/move-extern-c.patch
deleted file mode 100644
index 43a4942d3e62d..0000000000000
--- a/pkgs/applications/graphics/nufraw/move-extern-c.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/uf_glib.h b/uf_glib.h
-index c1a17bd..8a10800 100644
---- a/uf_glib.h
-+++ b/uf_glib.h
-@@ -13,13 +13,13 @@
- #ifndef _UF_GLIB_H
- #define _UF_GLIB_H
- 
-+#include <glib.h>
-+#include <glib/gstdio.h>
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
- 
--#include <glib.h>
--#include <glib/gstdio.h>
--
- // g_win32_locale_filename_from_utf8 is needed only on win32
- #ifdef _WIN32
- #define uf_win32_locale_filename_from_utf8(__some_string__) \