photoflow: fix build

This commit is contained in:
Weijia Wang 2022-08-01 12:33:25 +02:00
parent bfeefbc5fe
commit f167fb4c82
2 changed files with 95 additions and 12 deletions

View file

@ -3,6 +3,7 @@
, exiv2
, expat
, fetchFromGitHub
, fetchpatch
, fftw
, fftwFloat
, gettext
@ -22,9 +23,11 @@
, pcre
, pkg-config
, pugixml
, lib, stdenv
, lib
, stdenv
, swig
, vips
, gtk-mac-integration-gtk2
}:
stdenv.mkDerivation rec {
@ -38,7 +41,15 @@ stdenv.mkDerivation rec {
sha256 = "1bq4733hbh15nwpixpyhqfn3bwkg38amdj2xc0my0pii8l9ln793";
};
patches = [ ./CMakeLists.patch ];
patches = [
(fetchpatch {
name = "fix-compiler-flags.patch";
url = "https://sources.debian.org/data/main/p/photoflow/0.2.8%2Bgit20200114-3/debian/patches/ftbfs";
sha256 = "sha256-DG5yG6M4FsKOykE9Eh5TGd7Z5QURGTTVbO1pIxMAlhc=";
})
./CMakeLists.patch
./fix-build.patch
];
nativeBuildInputs = [
automake
@ -70,6 +81,8 @@ stdenv.mkDerivation rec {
pcre
pugixml
vips
] ++ lib.optionals stdenv.isDarwin [
gtk-mac-integration-gtk2
];
cmakeFlags = [
@ -82,13 +95,7 @@ stdenv.mkDerivation rec {
description = "A fully non-destructive photo retouching program providing a complete RAW image editing workflow";
homepage = "https://aferrero2707.github.io/PhotoFlow/";
license = licenses.gpl3Plus;
maintainers = [ maintainers.MtP ];
platforms = platforms.linux;
# sse3 is not supported on aarch64
badPlatforms = [ "aarch64-linux" ];
# added 2021-09-30
# upstream seems pretty dead
#/build/source/src/operations/denoise.cc:30:10: fatal error: vips/cimg_funcs.h: No such file or directory
broken = true;
maintainers = with maintainers; [ MtP wegank ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,76 @@
diff --git a/src/external/librtprocess/src/include/librtprocess.h b/src/external/librtprocess/src/include/librtprocess.h
index 47691a09..b1c63dbd 100644
--- a/src/external/librtprocess/src/include/librtprocess.h
+++ b/src/external/librtprocess/src/include/librtprocess.h
@@ -21,6 +21,7 @@
#define _LIBRTPROCESS_
#include <functional>
+#include <cstddef>
enum rpError {RP_NO_ERROR, RP_MEMORY_ERROR, RP_WRONG_CFA, RP_CACORRECT_ERROR};
diff --git a/src/operations/denoise.cc b/src/operations/denoise.cc
index 10050f70..16b340c1 100644
--- a/src/operations/denoise.cc
+++ b/src/operations/denoise.cc
@@ -27,7 +27,7 @@
*/
-#include <vips/cimg_funcs.h>
+//#include <vips/cimg_funcs.h>
#include "../base/new_operation.hh"
#include "convert_colorspace.hh"
diff --git a/src/operations/gmic/gmic.cc b/src/operations/gmic/gmic.cc
index 876e7c20..fc6a8505 100644
--- a/src/operations/gmic/gmic.cc
+++ b/src/operations/gmic/gmic.cc
@@ -28,13 +28,31 @@
*/
//#include <vips/cimg_funcs.h>
+#include <vips/vips.h>
#include "../../base/processor_imp.hh"
#include "../convertformat.hh"
#include "gmic.hh"
-int vips_gmic(VipsImage **in, VipsImage** out, int n, int padding, double x_scale, double y_scale, const char* command, ...);
-
+int vips_gmic(VipsImage **in, VipsImage** out, int n, int padding, double x_scale, double y_scale, const char* command, ...)
+{
+ VipsArrayImage *array;
+ va_list ap;
+ int result;
+
+#ifndef NDEBUG
+ printf("vips_gmic(): padding=%d\n", padding);
+#endif
+
+ array = vips_array_image_new( in, n );
+ va_start( ap, command );
+ result = vips_call_split( "gmic", ap, array, out,
+ padding, x_scale, y_scale, command );
+ va_end( ap );
+ vips_area_unref( VIPS_AREA( array ) );
+
+ return( result );
+}
PF::GMicPar::GMicPar():
OpParBase(),
diff --git a/src/vips/gmic/gmic/src/CImg.h b/src/vips/gmic/gmic/src/CImg.h
index 268b9e62..5a79640c 100644
--- a/src/vips/gmic/gmic/src/CImg.h
+++ b/src/vips/gmic/gmic/src/CImg.h
@@ -32843,7 +32843,7 @@ namespace cimg_library_suffixed {
\see deriche(), vanvliet().
**/
CImg<T>& blur_box(const float boxsize, const bool boundary_conditions=true) {
- const float nboxsize = boxsize>=0?boxsize:-boxsize*std::max(_width,_height,_depth)/100;
+ const float nboxsize = boxsize>=0?boxsize:-boxsize*std::max({_width,_height,_depth})/100;
return blur_box(nboxsize,nboxsize,nboxsize,boundary_conditions);
}