Package init
This commit is contained in:
parent
d555a8f5b2
commit
ab7c90d509
42
Added-std-namespace-to-isnan.patch
Normal file
42
Added-std-namespace-to-isnan.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From f400d8bfb7ea754ea75128ba14d9c7a23eb0527b Mon Sep 17 00:00:00 2001
|
||||
From: Torsten Bronger <bronger@physik.rwth-aachen.de>
|
||||
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
|
||||
|
||||
38
Only-require-glib-2.40-when-tests-are-build-without-.patch
Normal file
38
Only-require-glib-2.40-when-tests-are-build-without-.patch
Normal file
@ -0,0 +1,38 @@
|
||||
From 75a845abfe4823837e3f07274911dc275150f5a4 Mon Sep 17 00:00:00 2001
|
||||
From: seebk <mail@sebastiankraft.net>
|
||||
Date: Sat, 21 Nov 2015 09:48:41 +0000
|
||||
Subject: [PATCH 001/113] Only require glib 2.40 when tests are build, without
|
||||
tests glib 2.26 is sufficient
|
||||
|
||||
---
|
||||
CMakeLists.txt | 14 ++++++++++----
|
||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index ceac8fc..21f082b 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -85,10 +85,16 @@ IF(WIN32)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
-# find dependencies
|
||||
-# NOTE: must be one of the macros listed in https://developer.gnome.org/glib/stable/glib-Version-Information.html
|
||||
-SET(LENSFUN_GLIB_REQUIREMENT_MACRO "GLIB_VERSION_2_40")
|
||||
-FIND_PACKAGE(GLIB2 REQUIRED 2.40)
|
||||
+
|
||||
+IF (BUILD_TESTS)
|
||||
+ # automatic tests need at least glib version 2.40
|
||||
+ # NOTE: must be one of the macros listed in https://developer.gnome.org/glib/stable/glib-Version-Information.html
|
||||
+ SET(LENSFUN_GLIB_REQUIREMENT_MACRO "GLIB_VERSION_2_40")
|
||||
+ FIND_PACKAGE(GLIB2 REQUIRED)
|
||||
+ELSE()
|
||||
+ SET(LENSFUN_GLIB_REQUIREMENT_MACRO "GLIB_VERSION_2_26")
|
||||
+ FIND_PACKAGE(GLIB2 REQUIRED)
|
||||
+ENDIF()
|
||||
|
||||
INCLUDE_DIRECTORIES(SYSTEM ${GLIB2_INCLUDE_DIRS})
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
263
Only-use-proper-C-new-and-delete-syntax-for-object-c.patch
Normal file
263
Only-use-proper-C-new-and-delete-syntax-for-object-c.patch
Normal file
@ -0,0 +1,263 @@
|
||||
From d2c6003ca5b0116fc18505b4fd34b211484e41ca Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Kraft <mail@sebastiankraft.net>
|
||||
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<T>(),
|
||||
@@ -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
|
||||
|
||||
24
Patch-47-respect-DESTDIR-when-installing-python-stuf.patch
Normal file
24
Patch-47-respect-DESTDIR-when-installing-python-stuf.patch
Normal file
@ -0,0 +1,24 @@
|
||||
From 9ec857bb403accc262a9b5a9c2921b5c064fc9c8 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Kraft <mail@sebastiankraft.net>
|
||||
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
|
||||
|
||||
26
Pull-isnan-into-std-namespace-include-cmath-not-math.patch
Normal file
26
Pull-isnan-into-std-namespace-include-cmath-not-math.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From 034ff1bfd7c97acd793132c8a50c099af656fb15 Mon Sep 17 00:00:00 2001
|
||||
From: Matthias Andree <matthias.andree@gmx.de>
|
||||
Date: Sat, 29 Oct 2016 13:38:27 +0200
|
||||
Subject: [PATCH 0866/1096] Pull isnan() into std:: namespace, #include
|
||||
<cmath>, not <math.h>.
|
||||
|
||||
---
|
||||
tests/test_modifier.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tests/test_modifier.cpp b/tests/test_modifier.cpp
|
||||
index 9c6def6..f087917 100644
|
||||
--- a/tests/test_modifier.cpp
|
||||
+++ b/tests/test_modifier.cpp
|
||||
@@ -3,7 +3,7 @@
|
||||
#ifdef _MSC_VER
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
-#include <math.h>
|
||||
+#include <cmath>
|
||||
#include "lensfun.h"
|
||||
|
||||
typedef struct {
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
45
Use-database-in-source-directory-while-running-tests.patch
Normal file
45
Use-database-in-source-directory-while-running-tests.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From 3f74b78e4ee9f1d400ebbf2b9093a0f9c48c6307 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Kraft <mail@sebastiankraft.net>
|
||||
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})
|
||||
-ADD_TEST(Database test_database)
|
||||
+ADD_TEST(NAME Database WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND test_database)
|
||||
|
||||
ADD_EXECUTABLE(test_modifier test_modifier.cpp)
|
||||
TARGET_LINK_LIBRARIES(test_modifier lensfun ${COMMON_LIBS})
|
||||
@@ -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 --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 = new lfDatabase ();
|
||||
- lfFix->db->Load();
|
||||
+ lfFix->db->LoadDirectory("data/db");
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
85
Various-CMake-patches-from-the-mailing-list.patch
Normal file
85
Various-CMake-patches-from-the-mailing-list.patch
Normal file
@ -0,0 +1,85 @@
|
||||
From bba9aa37c899999fca01101a8ed271a3aa9d82b7 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Kraft <mail@sebastiankraft.net>
|
||||
Date: Sat, 16 Jan 2016 15:42:57 +0100
|
||||
Subject: [PATCH 060/113] Various CMake patches from the mailing list
|
||||
|
||||
- Add GLIB2 libray path to link directories
|
||||
- Enable -msseX compiler switch for Clang
|
||||
- Set -mseeX switch only for files with SSE code
|
||||
- Do not enable SSE optimizations on non-x86 hardware by default
|
||||
---
|
||||
CMakeLists.txt | 19 +++++++++++++------
|
||||
libs/lensfun/CMakeLists.txt | 5 +++++
|
||||
2 files changed, 18 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 21f082b..b85656c 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -31,12 +31,18 @@ IF(NOT HAVE_REGEX_H)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libs/regex)
|
||||
ENDIF()
|
||||
|
||||
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES "[XxIi][0-9]?86|[Aa][Mm][Dd]64")
|
||||
+ SET(X86_ON ON)
|
||||
+else()
|
||||
+ SET(X86_ON OFF)
|
||||
+ENDIF()
|
||||
+
|
||||
# options controlling the build process
|
||||
OPTION(BUILD_STATIC "Build static library" OFF)
|
||||
OPTION(BUILD_TESTS "Build test suite" OFF)
|
||||
OPTION(BUILD_LENSTOOL "Build the lenstool (requires libpng)" OFF)
|
||||
-OPTION(BUILD_FOR_SSE "Build with support for SSE" ON)
|
||||
-OPTION(BUILD_FOR_SSE2 "Build with support for SSE2" ON)
|
||||
+OPTION(BUILD_FOR_SSE "Build with support for SSE" ${X86_ON})
|
||||
+OPTION(BUILD_FOR_SSE2 "Build with support for SSE2" ${X86_ON})
|
||||
OPTION(BUILD_DOC "Build documentation with doxygen" OFF)
|
||||
OPTION(INSTALL_HELPER_SCRIPTS "Install various helper scripts" ON)
|
||||
|
||||
@@ -62,14 +68,14 @@ ENDIF()
|
||||
|
||||
IF(BUILD_FOR_SSE)
|
||||
SET(VECTORIZATION_SSE 1)
|
||||
- IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
|
||||
+ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
+ SET(VECTORIZATION_SSE_FLAGS "-msse")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
IF(BUILD_FOR_SSE2)
|
||||
SET(VECTORIZATION_SSE2 1)
|
||||
- IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
|
||||
+ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
+ SET(VECTORIZATION_SSE2_FLAGS "-msse2")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
@@ -97,6 +103,7 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
INCLUDE_DIRECTORIES(SYSTEM ${GLIB2_INCLUDE_DIRS})
|
||||
+LINK_DIRECTORIES(${GLIB2_LIBRARY_DIRS})
|
||||
|
||||
|
||||
IF(BUILD_STATIC)
|
||||
diff --git a/libs/lensfun/CMakeLists.txt b/libs/lensfun/CMakeLists.txt
|
||||
index 6beadec..b0ca638 100644
|
||||
--- a/libs/lensfun/CMakeLists.txt
|
||||
+++ b/libs/lensfun/CMakeLists.txt
|
||||
@@ -9,6 +9,11 @@ IF(WIN32)
|
||||
LIST(APPEND LENSFUN_SRC windows/auxfun.cpp)
|
||||
ENDIF()
|
||||
|
||||
+SET_SOURCE_FILES_PROPERTIES(mod-color-sse.cpp mod-coord-sse.cpp
|
||||
+ PROPERTIES COMPILE_FLAGS "${VECTORIZATION_SSE_FLAGS}")
|
||||
+SET_SOURCE_FILES_PROPERTIES(mod-color-sse2.cpp
|
||||
+ PROPERTIES COMPILE_FLAGS "${VECTORIZATION_SSE2_FLAGS}")
|
||||
+
|
||||
IF(BUILD_STATIC)
|
||||
ADD_LIBRARY(lensfun STATIC ${LENSFUN_SRC})
|
||||
ELSE()
|
||||
--
|
||||
2.7.4
|
||||
|
||||
BIN
lensfun-0.3.2.tar.gz
Normal file
BIN
lensfun-0.3.2.tar.gz
Normal file
Binary file not shown.
118
lensfun.spec
Normal file
118
lensfun.spec
Normal file
@ -0,0 +1,118 @@
|
||||
Name: lensfun
|
||||
Version: 0.3.2
|
||||
Release: 19
|
||||
Summary: Library to correct defects introduced by photographic lenses
|
||||
License: LGPLv3 and CC-BY-SA
|
||||
URL: http://lensfun.sourceforge.net/
|
||||
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch0001: Only-require-glib-2.40-when-tests-are-build-without-.patch
|
||||
Patch0002: Only-use-proper-C-new-and-delete-syntax-for-object-c.patch
|
||||
Patch0003: Use-database-in-source-directory-while-running-tests.patch
|
||||
Patch0004: Patch-47-respect-DESTDIR-when-installing-python-stuf.patch
|
||||
Patch0005: Various-CMake-patches-from-the-mailing-list.patch
|
||||
Patch0006: Added-std-namespace-to-isnan.patch
|
||||
Patch0007: Pull-isnan-into-std-namespace-include-cmath-not-math.patch
|
||||
|
||||
BuildRequires: cmake >= 2.8 doxygen gcc-c++ pkgconfig(glib-2.0) pkgconfig(libpng)
|
||||
BuildRequires: python3-docutils pkgconfig(zlib) python3 python3-devel
|
||||
|
||||
%description
|
||||
The lensfun library provides an open source database of photographic lenses and
|
||||
their characteristics.
|
||||
|
||||
%package devel
|
||||
Summary: Development toolkit for lensfun
|
||||
License: LGPLv3
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%description devel
|
||||
This package contains the libraries and header files needed to build an application
|
||||
using lensfun.
|
||||
|
||||
%package tools
|
||||
Summary: Tools for managing lensfun data
|
||||
License: LGPLv3
|
||||
Requires: python3-lensfun = %{version}-%{release}
|
||||
%description tools
|
||||
This package contains tools for getting lens database updates and managing lenses
|
||||
adapter in lensfun.
|
||||
|
||||
%package -n python3-lensfun
|
||||
Summary: Python3 lensfun bindings
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%description -n python3-lensfun
|
||||
Library to correct defects introduced by photographic lenses.
|
||||
|
||||
%package help
|
||||
Summary: Documentation for lensfun
|
||||
|
||||
%description help
|
||||
This package provides documentation for lensfun.
|
||||
|
||||
%prep
|
||||
%autosetup -n lensfun-0.3.2 -p1
|
||||
|
||||
sed -i.shbang \
|
||||
-e "s|^#!/usr/bin/env python3$|#!%{__python3}|g" \
|
||||
apps/lensfun-add-adapter \
|
||||
apps/lensfun-update-data
|
||||
|
||||
%build
|
||||
mkdir %{_target_platform}
|
||||
cd %{_target_platform}
|
||||
%{cmake} .. \
|
||||
-DBUILD_DOC:BOOL=ON \
|
||||
-DBUILD_TESTS:BOOL=ON \
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release \
|
||||
-DCMAKE_INSTALL_DOCDIR:PATH=%{_pkgdocdir}
|
||||
cd -
|
||||
|
||||
%make_build -C %{_target_platform}
|
||||
make doc -C %{_target_platform}
|
||||
|
||||
%install
|
||||
%make_install/fast -C %{_target_platform}
|
||||
|
||||
install -d %{buildroot}/var/lib/lensfun-updates
|
||||
|
||||
rm -fv %{buildroot}%{_bindir}/g-lensfun-update-data \
|
||||
%{buildroot}%{_mandir}/man1/g-lensfun-update-data.*
|
||||
|
||||
%check
|
||||
cd %{_target_platform}
|
||||
export CTEST_OUTPUT_ON_FAILURE=1
|
||||
ctest -vv
|
||||
cd -
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
|
||||
%files
|
||||
%doc README.md
|
||||
%license docs/cc-by-sa-3.0.txt docs/lgpl-3.0.txt
|
||||
%{_datadir}/lensfun/
|
||||
%{_libdir}/{liblensfun.so.%{version},liblensfun.so.1*}
|
||||
%dir /var/lib/lensfun-updates/
|
||||
|
||||
%files devel
|
||||
%{_pkgdocdir}/{*.html,*.png,*.css,*.js}
|
||||
%{_includedir}/lensfun/
|
||||
%{_libdir}/liblensfun.so
|
||||
%{_libdir}/pkgconfig/lensfun.pc
|
||||
|
||||
%files -n python3-lensfun
|
||||
%{python3_sitelib}/lensfun/
|
||||
%{python3_sitelib}/lensfun*.egg-info
|
||||
|
||||
%files tools
|
||||
%{_bindir}/{lensfun-add-adapter,lensfun-update-data}
|
||||
|
||||
%files help
|
||||
%{_mandir}/man1/lensfun-add-adapter.1*
|
||||
%{_mandir}/man1/lensfun-update-data.1*
|
||||
|
||||
%changelog
|
||||
* Tue Feb 25 2020 fengbing <fengbing7@huawei.com> - 0.3.2-19
|
||||
- Package init
|
||||
Loading…
x
Reference in New Issue
Block a user