Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gmic for openSUSE:Factory checked in 
at 2021-11-08 17:24:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gmic (Old)
 and      /work/SRC/openSUSE:Factory/.gmic.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gmic"

Mon Nov  8 17:24:29 2021 rev:18 rq:930089 version:2.9.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/gmic/gmic.changes        2021-09-11 
22:25:15.155429314 +0200
+++ /work/SRC/openSUSE:Factory/.gmic.new.1890/gmic.changes      2021-11-08 
17:25:18.084737326 +0100
@@ -1,0 +2,7 @@
+Sun Nov  7 13:48:14 UTC 2021 - Andreas Schneider <[email protected]>
+
+- Enable Link Time Optimizations (LTO)
+- Fix building with optflags
+  * Added 0001-cmake-Set-target-compile-flags-correctly.patch
+
+-------------------------------------------------------------------

New:
----
  0001-cmake-Set-target-compile-flags-correctly.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gmic.spec ++++++
--- /var/tmp/diff_new_pack.PsvEQK/_old  2021-11-08 17:25:18.576737650 +0100
+++ /var/tmp/diff_new_pack.PsvEQK/_new  2021-11-08 17:25:18.580737653 +0100
@@ -16,15 +16,6 @@
 #
 
 
-# Disable LTO as it removes important symbols
-#
-# g++ use_libgmic.cpp -o use_gmic -L/tmp/local/gmic/lib64 -lgmic
-# use_libgmic.cpp:function main: error: undefined reference to 
'cimg_library::CImgList<float>::assign(unsigned int)'
-#
-# 
https://discuss.pixls.us/t/gmic-lookup-symbol-err-on-opensuse-darktable-master-build/15827
-#
-%define _lto_cflags %{nil}
-
 %global _gimpplugindir %(gimptool-2.0 --gimpplugindir)/plug-ins
 Name:           gmic
 Version:        2.9.9
@@ -35,9 +26,10 @@
 License:        CECILL-2.1
 Group:          Productivity/Graphics/Bitmap Editors
 URL:            https://gmic.eu
-# Git URL:      https://framagit.org/dtschump/gmic
+# Git URL:      https://github.com/dtschump/gmic
 Source0:        https://gmic.eu/files/source/gmic_%{version}.tar.gz
 Source1:        gmic_qt.png
+Patch0:         0001-cmake-Set-target-compile-flags-correctly.patch
 BuildRequires:  cmake >= 3.14.0
 BuildRequires:  fftw3-threads-devel
 BuildRequires:  pkgconfig

++++++ 0001-cmake-Set-target-compile-flags-correctly.patch ++++++
>From f05f07d501710c7e1609ac7348e9190f791f6127 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <[email protected]>
Date: Sun, 7 Nov 2021 19:58:24 +0100
Subject: [PATCH] cmake: Set target compile flags correctly

This will not overwrite what you set with CMAKE_CXX_FLAGS on the
command line. Currently flags set by distributions are ignored when
packaging gmic.
---
 CMakeLists.txt | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8c6c4101..63a783f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,15 +96,15 @@ endif()
 # compile flags
 set(CMAKE_POSITION_INDEPENDENT_CODE True)
 
-set(COMPILE_FLAGS "-Dgmic_build -Dcimg_use_vt100 -Dgmic_is_parallel 
-Dcimg_use_abort")
+set(GMIC_CXX_COMPILE_FLAGS "-Dgmic_build -Dcimg_use_vt100 -Dgmic_is_parallel 
-Dcimg_use_abort")
 if(APPLE)
-   set(COMPILE_FLAGS "${COMPILE_FLAGS} -mmacosx-version-min=10.8 
-stdlib=libc++ -Wno-error=c++11-narrowing -Wc++11-extensions -fpermissive")
+    list(APPEND GMIC_CXX_COMPILE_FLAGS -mmacosx-version-min=10.8 
-stdlib=libc++ -Wno-error=c++11-narrowing -Wc++11-extensions -fpermissive)
 else()
-  set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-error=narrowing -fno-ipa-sra 
-fpermissive")
+    list(APPEND GMIC_CXX_COMPILE_FLAGS -Wno-error=narrowing -fno-ipa-sra 
-fpermissive)
 endif()
 
 if(NOT "${PRERELEASE_TAG}" STREQUAL "")
-  set(COMPILE_FLAGS "${COMPILE_FLAGS} -Dgmic_prerelease=\"${PRERELEASE_TAG}\"")
+    list(APPEND GMIC_CXX_COMPILE_FLAGS 
"-Dgmic_prerelease=\"${PRERELEASE_TAG}\"")
 endif()
 
 if (ENABLE_LTO)
@@ -126,14 +126,20 @@ if(ENABLE_DYNAMIC_LINKING)
   set(CMAKE_SKIP_RPATH TRUE)
 endif()
 
-set(CMAKE_CXX_FLAGS_DEBUG "-g -ansi -Wall -Wextra -pedantic -Dcimg_verbosity=3 
${COMPILE_FLAGS}")
-set(CMAKE_CXX_FLAGS_RELEASE "${COMPILE_FLAGS}")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g ${COMPILE_FLAGS}")
+string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+if (${CMAKE_BUILD_TYPE_LOWER} STREQUAL "debug")
+    list(PREPEND GMIC_CXX_COMPILE_FLAGS -g -ansi -Wall -Wextra -pedantic 
-Dcimg_verbosity=3)
+endif()
+if (${CMAKE_BUILD_TYPE_LOWER} STREQUAL "relwithdebinfo")
+    list(PREPEND GMIC_CXX_COMPILE_FLAGS -g)
+endif()
 
-if(NOT CUSTOM_CFLAGS)
-  set(CMAKE_CXX_FLAGS_DEBUG "-Og ${CMAKE_CXX_FLAGS_DEBUG}")
-  set(CMAKE_CXX_FLAGS_RELEASE "-Ofast ${CMAKE_CXX_FLAGS_RELEASE}")
-  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Ofast 
${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+if (NOT CUSTOM_CFLAGS)
+    if (${CMAKE_BUILD_TYPE_LOWER} STREQUAL "debug")
+        list(PREPEND GMIC_CXX_COMPILE_FLAGS -Og)
+    else()
+        list(PREPEND GMIC_CXX_COMPILE_FLAGS -Ofast)
+    endif()
 endif()
 
 # source files
@@ -141,6 +147,7 @@ set(CLI_Sources src/gmic.cpp)
 
 if(BUILD_LIB)
   add_library(libgmic SHARED ${CLI_Sources})
+  target_compile_options(libgmic PRIVATE ${GMIC_CXX_COMPILE_FLAGS})
   set_target_properties(libgmic PROPERTIES SOVERSION "1" OUTPUT_NAME "gmic")
   target_link_libraries(libgmic
     CImg::CImg
@@ -164,6 +171,7 @@ endif()
 
 if(BUILD_LIB_STATIC)
   add_library(libgmicstatic STATIC ${CLI_Sources})
+  target_compile_options(libgmicstatic PRIVATE ${GMIC_CXX_COMPILE_FLAGS})
   set_target_properties(libgmicstatic PROPERTIES OUTPUT_NAME "gmic")
   target_link_libraries(libgmicstatic
     CImg::CImg
@@ -182,6 +190,7 @@ endif()
 
 if(BUILD_CLI)
   add_executable(gmic src/gmic_cli.cpp)
+  target_compile_options(gmic PRIVATE ${GMIC_CXX_COMPILE_FLAGS})
   if(ENABLE_DYNAMIC_LINKING)
     target_link_libraries(gmic libgmic)
   else()
-- 
2.33.1

Reply via email to