diff --git a/0330-Only-require-glib-2.40-when-tests-are-build-without-.patch b/0330-Only-require-glib-2.40-when-tests-are-build-without-.patch new file mode 100644 index 0000000..3b09d13 --- /dev/null +++ b/0330-Only-require-glib-2.40-when-tests-are-build-without-.patch @@ -0,0 +1,38 @@ +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 + 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 + diff --git a/0525-Use-database-in-source-directory-while-running-tests.patch b/0525-Use-database-in-source-directory-while-running-tests.patch new file mode 100644 index 0000000..8d05226 --- /dev/null +++ b/0525-Use-database-in-source-directory-while-running-tests.patch @@ -0,0 +1,29 @@ +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 +@@ -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_coor + 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 +@@ -10,7 +10,7 @@ typedef struct { + void db_setup(lfFixture *lfFix, gconstpointer data) + { + lfFix->db = lf_db_new (); +- lfFix->db->Load(); ++ lfFix->db->LoadDirectory("data/db"); + } + + diff --git a/0527-Various-CMake-patches-from-the-mailing-list.patch b/0527-Various-CMake-patches-from-the-mailing-list.patch new file mode 100644 index 0000000..47516be --- /dev/null +++ b/0527-Various-CMake-patches-from-the-mailing-list.patch @@ -0,0 +1,85 @@ +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 + +- 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 + diff --git a/lensfun.spec b/lensfun.spec index 10da632..4ec84c5 100644 --- a/lensfun.spec +++ b/lensfun.spec @@ -1,11 +1,4 @@ -%global sse -DBUILD_FOR_SSE:BOOL=OFF -%global sse2 -DBUILD_FOR_SSE2:BOOL=OFF -%ifarch x86_64 -%global sse -DBUILD_FOR_SSE:BOOL=ON -%global sse2 -DBUILD_FOR_SSE2:BOOL=ON -%endif - Name: lensfun Version: 0.3.2 Summary: Library to rectify defects introduced by photographic lenses @@ -16,6 +9,9 @@ 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 ## upstreamable patches # install manpages only when INSTALL_HELPER_SCRIPTS=ON @@ -26,6 +22,7 @@ BuildRequires: doxygen BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(zlib) +BuildRequires: python3 python3-devel # for rst2man, if INSTALL_HELPER_SCRIPTS != OFF BuildRequires: python-docutils @@ -53,10 +50,20 @@ Requires: %{name}%{?_isa} = %{version}-%{release} This package contains tools to fetch lens database updates and manage lens adapters in lensfun. +%package -n python3-lensfun +Summary: Python3 lensfun bindings +Requires: %{name}%{?_isa} = %{version}-%{release} +%description -n python3-lensfun +%{summary}. + %prep %setup -q +%patch330 -p1 -b .0330 +%patch525 -p1 -b .0525 +%patch527 -p1 -b .0527 + %patch1 -p1 -b .INSTALL_HELPER_SCRIPTS @@ -67,7 +74,7 @@ pushd %{_target_platform} -DBUILD_DOC:BOOL=ON \ -DBUILD_TESTS:BOOL=ON \ -DCMAKE_BUILD_TYPE:STRING=Release \ - %{?sse} %{?sse2} + -DSETUP_PY_INSTALL_PREFIX:PATH=%{buildroot}%{_prefix} popd make %{?_smp_mflags} -C %{_target_platform} @@ -88,7 +95,7 @@ rm -fv %{buildroot}%{_bindir}/g-lensfun-update-data \ %check pushd %{_target_platform} export CTEST_OUTPUT_ON_FAILURE=1 -ctest -vv ||: +ctest -vv popd @@ -118,10 +125,16 @@ popd %{_mandir}/man1/lensfun-add-adapter.1* %{_mandir}/man1/lensfun-update-data.1* +%files -n python3-lensfun +%{python3_sitelib}/lensfun/ +%{python3_sitelib}/lensfun*.egg-info + %changelog * Thu Dec 01 2016 Rex Dieter - 0.3.2-4 -- drop BUILD_FOR_SSE on i686 (#1400481) +- support BUILD_FOR_SSE/SSE2 on %%ix86/x86_64 (#1400481) +- enable/fix python bindings +- pull in upstream fixes (tests, buildsys) * Tue Nov 15 2016 Germano Massullo - 0.3.2-3 - Rebuild