diff --git a/0330-Only-require-glib-2.40-when-tests-are-build-without-.patch b/0001-Only-require-glib-2.40-when-tests-are-build-without-.patch similarity index 94% rename from 0330-Only-require-glib-2.40-when-tests-are-build-without-.patch rename to 0001-Only-require-glib-2.40-when-tests-are-build-without-.patch index 3b09d13..2ae5f2e 100644 --- a/0330-Only-require-glib-2.40-when-tests-are-build-without-.patch +++ b/0001-Only-require-glib-2.40-when-tests-are-build-without-.patch @@ -1,7 +1,7 @@ From 75a845abfe4823837e3f07274911dc275150f5a4 Mon Sep 17 00:00:00 2001 From: seebk Date: Sat, 21 Nov 2015 09:48:41 +0000 -Subject: [PATCH 330/868] Only require glib 2.40 when tests are build, without +Subject: [PATCH 001/113] Only require glib 2.40 when tests are build, without tests glib 2.26 is sufficient --- diff --git a/0038-Only-use-proper-C-new-and-delete-syntax-for-object-c.patch b/0038-Only-use-proper-C-new-and-delete-syntax-for-object-c.patch new file mode 100644 index 0000000..c631b83 --- /dev/null +++ b/0038-Only-use-proper-C-new-and-delete-syntax-for-object-c.patch @@ -0,0 +1,263 @@ +From d2c6003ca5b0116fc18505b4fd34b211484e41ca Mon Sep 17 00:00:00 2001 +From: Sebastian Kraft +Date: Sat, 19 Dec 2015 20:08:24 +0100 +Subject: [PATCH 038/113] Only use proper C++ new and delete syntax for object + creation in tests and lenstool + +--- + apps/lenstool/lenstool.cpp | 16 ++++++++-------- + tests/test_database.cpp | 4 ++-- + tests/test_modifier.cpp | 8 +++++--- + tests/test_modifier_color.cpp | 4 ++-- + tests/test_modifier_coord_distortion.cpp | 4 ++-- + tests/test_modifier_coord_geometry.cpp | 4 ++-- + tests/test_modifier_coord_scale.cpp | 4 ++-- + tests/test_modifier_subpix.cpp | 4 ++-- + 8 files changed, 25 insertions(+), 23 deletions(-) + +diff --git a/apps/lenstool/lenstool.cpp b/apps/lenstool/lenstool.cpp +index 0aab056..399195e 100644 +--- a/apps/lenstool/lenstool.cpp ++++ b/apps/lenstool/lenstool.cpp +@@ -360,7 +360,7 @@ int main (int argc, char **argv) + lfDatabase *ldb = new lfDatabase (); + + if (ldb->Load () != LF_NO_ERROR) { +- ldb->Destroy(); ++ delete ldb; + g_print ("\rERROR: Database could not be loaded\n"); + return -1; + } +@@ -410,7 +410,7 @@ int main (int argc, char **argv) + + // nothing to process, so lets quit here + if (!opts.Input) { +- ldb->Destroy(); ++ delete ldb; + return 0; + } + +@@ -441,22 +441,22 @@ int main (int argc, char **argv) + if (!img->Open (opts.Input)) { + g_print ("\rERROR: failed to open file `%s'\n", opts.Input); + delete img; +- ldb->Destroy(); ++ delete ldb; + return -1; + } + if (!img->LoadPNG ()) { + g_print ("\rERROR: failed to parse PNG data from file `%s'\n", opts.Input); + delete img; +- ldb->Destroy(); ++ delete ldb; + return -1; + } + g_print ("done.\n~ Image size [%ux%u].\n", img->width, img->height); + +- lfModifier *mod = lfModifier::Create (lens, opts.Crop, img->width, img->height); ++ lfModifier *mod = new lfModifier (lens, opts.Crop, img->width, img->height); + if (!mod) { + g_print ("\rWarning: failed to create modifier\n"); + delete img; +- ldb->Destroy(); ++ delete ldb; + return -1; + } + int modflags = mod->Initialize ( +@@ -491,13 +491,13 @@ int main (int argc, char **argv) + clock_t et = clock (); + g_print ("done (%.3g secs)\n", double (et - st) / CLOCKS_PER_SEC); + +- mod->Destroy (); ++ delete mod; + + g_print ("~ Save output as `%s'...", opts.Output); + bool ok = img->SavePNG (opts.Output); + + delete img; +- ldb->Destroy (); ++ delete ldb; + + if (ok) { + g_print (" done\n"); +diff --git a/tests/test_database.cpp b/tests/test_database.cpp +index d64984a..45dc38f 100644 +--- a/tests/test_database.cpp ++++ b/tests/test_database.cpp +@@ -9,14 +9,14 @@ typedef struct { + + void db_setup(lfFixture *lfFix, gconstpointer data) + { +- lfFix->db = lf_db_new (); ++ lfFix->db = new lfDatabase (); + lfFix->db->Load(); + } + + + void db_teardown(lfFixture *lfFix, gconstpointer data) + { +- lfFix->db->Destroy(); ++ delete lfFix->db; + } + + +diff --git a/tests/test_modifier.cpp b/tests/test_modifier.cpp +index 3d091a4..f794638 100644 +--- a/tests/test_modifier.cpp ++++ b/tests/test_modifier.cpp +@@ -31,7 +31,6 @@ void mod_setup(lfFixture *lfFix, gconstpointer data) + + void mod_teardown(lfFixture *lfFix, gconstpointer data) + { +- lfFix->mod->Destroy(); + delete lfFix->lens; + } + +@@ -55,7 +54,7 @@ void test_mod_projection_center(lfFixture* lfFix, gconstpointer data) + if(g_test_verbose()) + g_print(" ~ Conversion from %s -> %s \n", geom_names[j], geom_names[i]); + +- lfFix->mod = lfModifier::Create (lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); ++ lfFix->mod = new lfModifier (lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); + lfFix->mod->Initialize ( + lfFix->lens, LF_PF_U8, 12.0f, + 6.7f, 2.0f, 1.0f, geom_types[i], +@@ -68,6 +67,8 @@ void test_mod_projection_center(lfFixture* lfFix, gconstpointer data) + g_assert_cmpfloat(in[0],==,res[0]); + g_assert_cmpfloat(in[1],==,res[1]); + } ++ ++ delete lfFix->mod; + i++; + } + j++; +@@ -94,7 +95,7 @@ void test_mod_projection_borders(lfFixture* lfFix, gconstpointer data) + if(g_test_verbose()) + g_print(" ~ Conversion from %s -> %s \n", geom_names[j], geom_names[i]); + +- lfFix->mod = lfModifier::Create (lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); ++ lfFix->mod = new lfModifier (lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); + lfFix->mod->Initialize ( + lfFix->lens, LF_PF_U8, 12.0f, + 6.7f, 2.0f, 1.0f, geom_types[i], +@@ -115,6 +116,7 @@ void test_mod_projection_borders(lfFixture* lfFix, gconstpointer data) + g_assert_false(isnan(res[1])); + } + ++ delete lfFix->mod; + i++; + } + j++; +diff --git a/tests/test_modifier_color.cpp b/tests/test_modifier_color.cpp +index 4c5e2dc..6327232 100644 +--- a/tests/test_modifier_color.cpp ++++ b/tests/test_modifier_color.cpp +@@ -107,7 +107,7 @@ void mod_setup(lfFixture *lfFix, gconstpointer data) + lfFix->img_height = 300; + lfFix->img_width = 300; + +- lfFix->mod = lfModifier::Create(lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); ++ lfFix->mod = new lfModifier(lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); + + lfFix->mod->Initialize( + lfFix->lens, cTypeToLfPixelFormat(), +@@ -134,7 +134,7 @@ void mod_teardown(lfFixture *lfFix, gconstpointer data) + else + lf_free_align(lfFix->image); + +- lfFix->mod->Destroy(); ++ delete lfFix->mod; + delete lfFix->lens; + } + +diff --git a/tests/test_modifier_coord_distortion.cpp b/tests/test_modifier_coord_distortion.cpp +index 6fd6773..f463350 100644 +--- a/tests/test_modifier_coord_distortion.cpp ++++ b/tests/test_modifier_coord_distortion.cpp +@@ -51,7 +51,7 @@ void mod_setup(lfFixture *lfFix, gconstpointer data) + lfFix->img_height = 300; + lfFix->img_width = 300; + +- lfFix->mod = lfModifier::Create(lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); ++ lfFix->mod = new lfModifier(lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); + + lfFix->mod->Initialize( + lfFix->lens, LF_PF_F32, +@@ -76,7 +76,7 @@ void mod_teardown(lfFixture *lfFix, gconstpointer data) + else + lf_free_align(lfFix->coordBuff); + +- lfFix->mod->Destroy(); ++ delete lfFix->mod; + delete lfFix->lens; + } + +diff --git a/tests/test_modifier_coord_geometry.cpp b/tests/test_modifier_coord_geometry.cpp +index 6805b7d..d626ba8 100644 +--- a/tests/test_modifier_coord_geometry.cpp ++++ b/tests/test_modifier_coord_geometry.cpp +@@ -51,7 +51,7 @@ void mod_setup(lfFixture *lfFix, gconstpointer data) + lfFix->img_height = 300; + lfFix->img_width = 300; + +- lfFix->mod = lfModifier::Create(lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); ++ lfFix->mod = new lfModifier(lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); + + lfFix->mod->Initialize( + lfFix->lens, LF_PF_F32, +@@ -76,7 +76,7 @@ void mod_teardown(lfFixture *lfFix, gconstpointer data) + else + lf_free_align(lfFix->coordBuff); + +- lfFix->mod->Destroy(); ++ delete lfFix->mod; + delete lfFix->lens; + } + +diff --git a/tests/test_modifier_coord_scale.cpp b/tests/test_modifier_coord_scale.cpp +index c155ff8..84a4286 100644 +--- a/tests/test_modifier_coord_scale.cpp ++++ b/tests/test_modifier_coord_scale.cpp +@@ -48,7 +48,7 @@ void mod_setup(lfFixture *lfFix, gconstpointer data) + lfFix->img_height = 300; + lfFix->img_width = 300; + +- lfFix->mod = lfModifier::Create(lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); ++ lfFix->mod = new lfModifier(lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); + + lfFix->mod->Initialize( + lfFix->lens, LF_PF_F32, +@@ -73,7 +73,7 @@ void mod_teardown(lfFixture *lfFix, gconstpointer data) + else + lf_free_align(lfFix->coordBuff); + +- lfFix->mod->Destroy(); ++ delete lfFix->mod; + delete lfFix->lens; + } + +diff --git a/tests/test_modifier_subpix.cpp b/tests/test_modifier_subpix.cpp +index d04f36d..fa29cf6 100644 +--- a/tests/test_modifier_subpix.cpp ++++ b/tests/test_modifier_subpix.cpp +@@ -51,7 +51,7 @@ void mod_setup(lfFixture *lfFix, gconstpointer data) + lfFix->img_height = 300; + lfFix->img_width = 300; + +- lfFix->mod = lfModifier::Create(lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); ++ lfFix->mod = new lfModifier(lfFix->lens, 1.0f, lfFix->img_width, lfFix->img_height); + + lfFix->mod->Initialize( + lfFix->lens, LF_PF_F32, +@@ -76,7 +76,7 @@ void mod_teardown(lfFixture *lfFix, gconstpointer data) + else + lf_free_align(lfFix->coordBuff); + +- lfFix->mod->Destroy(); ++ delete lfFix->mod; + delete lfFix->lens; + } + +-- +2.7.4 + diff --git a/0525-Use-database-in-source-directory-while-running-tests.patch b/0058-Use-database-in-source-directory-while-running-tests.patch similarity index 53% rename from 0525-Use-database-in-source-directory-while-running-tests.patch rename to 0058-Use-database-in-source-directory-while-running-tests.patch index 8d05226..b4fe05c 100644 --- a/0525-Use-database-in-source-directory-while-running-tests.patch +++ b/0058-Use-database-in-source-directory-while-running-tests.patch @@ -1,6 +1,18 @@ -diff -up lensfun-0.3.2/tests/CMakeLists.txt.0525 lensfun-0.3.2/tests/CMakeLists.txt ---- lensfun-0.3.2/tests/CMakeLists.txt.0525 2015-11-15 11:07:26.000000000 -0600 -+++ lensfun-0.3.2/tests/CMakeLists.txt 2016-12-01 06:33:04.868398080 -0600 +From 3f74b78e4ee9f1d400ebbf2b9093a0f9c48c6307 Mon Sep 17 00:00:00 2001 +From: Sebastian Kraft +Date: Sat, 9 Jan 2016 20:48:16 +0100 +Subject: [PATCH 058/113] Use database in source directory while running tests. + Fixes bug #46. + +--- + tests/CMakeLists.txt | 4 ++-- + tests/test_database.cpp | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index b79fda6..4056072 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt @@ -1,6 +1,6 @@ ADD_EXECUTABLE(test_database test_database.cpp) TARGET_LINK_LIBRARIES(test_database lensfun ${COMMON_LIBS}) @@ -9,21 +21,25 @@ diff -up lensfun-0.3.2/tests/CMakeLists.txt.0525 lensfun-0.3.2/tests/CMakeLists. ADD_EXECUTABLE(test_modifier test_modifier.cpp) TARGET_LINK_LIBRARIES(test_modifier lensfun ${COMMON_LIBS}) -@@ -30,4 +30,4 @@ TARGET_LINK_LIBRARIES(test_modifier_coor +@@ -30,4 +30,4 @@ TARGET_LINK_LIBRARIES(test_modifier_coord_geometry lensfun ${COMMON_LIBS}) ADD_TEST(Modifier_coord_geometry test_modifier_coord_geometry) FIND_PACKAGE(PythonInterp REQUIRED) -ADD_TEST(NAME Database_integrity COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/check_database/check_database.py ../../data/db) +ADD_TEST(NAME Database_integrity COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/check_database/check_database.py ${CMAKE_SOURCE_DIR}/data/db) -diff -up lensfun-0.3.2/tests/test_database.cpp.0525 lensfun-0.3.2/tests/test_database.cpp ---- lensfun-0.3.2/tests/test_database.cpp.0525 2016-12-01 06:33:04.869398085 -0600 -+++ lensfun-0.3.2/tests/test_database.cpp 2016-12-01 06:33:32.530537014 -0600 +diff --git a/tests/test_database.cpp b/tests/test_database.cpp +index 45dc38f..49a2644 100644 +--- a/tests/test_database.cpp ++++ b/tests/test_database.cpp @@ -10,7 +10,7 @@ typedef struct { void db_setup(lfFixture *lfFix, gconstpointer data) { - lfFix->db = lf_db_new (); + lfFix->db = new lfDatabase (); - lfFix->db->Load(); + lfFix->db->LoadDirectory("data/db"); } +-- +2.7.4 + diff --git a/0059-Patch-47-respect-DESTDIR-when-installing-python-stuf.patch b/0059-Patch-47-respect-DESTDIR-when-installing-python-stuf.patch new file mode 100644 index 0000000..7e0c63d --- /dev/null +++ b/0059-Patch-47-respect-DESTDIR-when-installing-python-stuf.patch @@ -0,0 +1,24 @@ +From 9ec857bb403accc262a9b5a9c2921b5c064fc9c8 Mon Sep 17 00:00:00 2001 +From: Sebastian Kraft +Date: Sat, 9 Jan 2016 20:55:21 +0100 +Subject: [PATCH 059/113] Patch #47: respect DESTDIR when installing python + stuff + +--- + apps/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt +index 70c77fd..2f6f8f1 100644 +--- a/apps/CMakeLists.txt ++++ b/apps/CMakeLists.txt +@@ -42,5 +42,5 @@ IF(PYTHON) + IF(NOT DEFINED SETUP_PY_INSTALL_PREFIX) + SET(SETUP_PY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + ENDIF() +- INSTALL(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install --prefix=${SETUP_PY_INSTALL_PREFIX})") ++ INSTALL(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install --prefix=\$ENV{DESTDIR}${SETUP_PY_INSTALL_PREFIX})") + ENDIF(PYTHON) +-- +2.7.4 + diff --git a/0527-Various-CMake-patches-from-the-mailing-list.patch b/0060-Various-CMake-patches-from-the-mailing-list.patch similarity index 97% rename from 0527-Various-CMake-patches-from-the-mailing-list.patch rename to 0060-Various-CMake-patches-from-the-mailing-list.patch index 47516be..312b540 100644 --- a/0527-Various-CMake-patches-from-the-mailing-list.patch +++ b/0060-Various-CMake-patches-from-the-mailing-list.patch @@ -1,7 +1,7 @@ From bba9aa37c899999fca01101a8ed271a3aa9d82b7 Mon Sep 17 00:00:00 2001 From: Sebastian Kraft Date: Sat, 16 Jan 2016 15:42:57 +0100 -Subject: [PATCH 527/868] Various CMake patches from the mailing list +Subject: [PATCH 060/113] Various CMake patches from the mailing list - Add GLIB2 libray path to link directories - Enable -msseX compiler switch for Clang diff --git a/0113-Added-std-namespace-to-isnan.patch b/0113-Added-std-namespace-to-isnan.patch new file mode 100644 index 0000000..b9aaea8 --- /dev/null +++ b/0113-Added-std-namespace-to-isnan.patch @@ -0,0 +1,42 @@ +From f400d8bfb7ea754ea75128ba14d9c7a23eb0527b Mon Sep 17 00:00:00 2001 +From: Torsten Bronger +Date: Sat, 15 Oct 2016 15:02:04 +0200 +Subject: [PATCH 113/113] Added "std" namespace to "isnan". + +Fixes bug #68. +--- + tests/test_modifier.cpp | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tests/test_modifier.cpp b/tests/test_modifier.cpp +index f794638..5a2ed0d 100644 +--- a/tests/test_modifier.cpp ++++ b/tests/test_modifier.cpp +@@ -102,18 +102,18 @@ void test_mod_projection_borders(lfFixture* lfFix, gconstpointer data) + LF_MODIFY_GEOMETRY, false); + + if (lfFix->mod->ApplyGeometryDistortion(0,0,1,1,res)) { +- g_assert_false(isnan(res[0])); +- g_assert_false(isnan(res[1])); ++ g_assert_false(std::isnan(res[0])); ++ g_assert_false(std::isnan(res[1])); + } + + if (lfFix->mod->ApplyGeometryDistortion(in[0],in[1],1,1,res)) { +- g_assert_false(isnan(res[0])); +- g_assert_false(isnan(res[1])); ++ g_assert_false(std::isnan(res[0])); ++ g_assert_false(std::isnan(res[1])); + } + + if (lfFix->mod->ApplyGeometryDistortion(in2[0],in2[1],1,1,res)) { +- g_assert_false(isnan(res[0])); +- g_assert_false(isnan(res[1])); ++ g_assert_false(std::isnan(res[0])); ++ g_assert_false(std::isnan(res[1])); + } + + delete lfFix->mod; +-- +2.7.4 + diff --git a/lensfun.spec b/lensfun.spec index 4ec84c5..5f12dbf 100644 --- a/lensfun.spec +++ b/lensfun.spec @@ -2,20 +2,23 @@ Name: lensfun Version: 0.3.2 Summary: Library to rectify defects introduced by photographic lenses -Release: 4%{?dist} +Release: 5%{?dist} License: LGPLv3 and CC-BY-SA URL: http://lensfun.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz ## upstream patches -Patch330: 0330-Only-require-glib-2.40-when-tests-are-build-without-.patch -Patch525: 0525-Use-database-in-source-directory-while-running-tests.patch -Patch527: 0527-Various-CMake-patches-from-the-mailing-list.patch +Patch1: 0001-Only-require-glib-2.40-when-tests-are-build-without-.patch +Patch38: 0038-Only-use-proper-C-new-and-delete-syntax-for-object-c.patch +Patch58: 0058-Use-database-in-source-directory-while-running-tests.patch +Patch59: 0059-Patch-47-respect-DESTDIR-when-installing-python-stuf.patch +Patch60: 0060-Various-CMake-patches-from-the-mailing-list.patch +Patch113: 0113-Added-std-namespace-to-isnan.patch ## upstreamable patches # install manpages only when INSTALL_HELPER_SCRIPTS=ON -Patch1: lensfun-0.3.2-INSTALL_HELPER_SCRIPTS.patch +Patch200: lensfun-0.3.2-INSTALL_HELPER_SCRIPTS.patch BuildRequires: cmake >= 2.8 BuildRequires: doxygen @@ -60,11 +63,14 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %prep %setup -q -%patch330 -p1 -b .0330 -%patch525 -p1 -b .0525 -%patch527 -p1 -b .0527 +%patch1 -p1 -b .0001 +%patch38 -p1 -b .0038 +%patch58 -p1 -b .0058 +%patch59 -p1 -b .0059 +%patch60 -p1 -b .0060 +%patch113 -p1 -b .0113 -%patch1 -p1 -b .INSTALL_HELPER_SCRIPTS +%patch200 -p1 -b .INSTALL_HELPER_SCRIPTS %build @@ -73,8 +79,7 @@ pushd %{_target_platform} %{cmake} .. \ -DBUILD_DOC:BOOL=ON \ -DBUILD_TESTS:BOOL=ON \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DSETUP_PY_INSTALL_PREFIX:PATH=%{buildroot}%{_prefix} + -DCMAKE_BUILD_TYPE:STRING=Release popd make %{?_smp_mflags} -C %{_target_platform} @@ -131,6 +136,9 @@ popd %changelog +* Thu Dec 01 2016 Rex Dieter - 0.3.2-5 +- more upstream fixes... from the right branch (0.3) + * Thu Dec 01 2016 Rex Dieter - 0.3.2-4 - support BUILD_FOR_SSE/SSE2 on %%ix86/x86_64 (#1400481) - enable/fix python bindings