media-libs/simage-1.7.1-r1: fixed examples linking
authorMiroslav Šulc <fordfrog@gentoo.org>
Mon, 16 Dec 2019 09:33:50 +0000 (10:33 +0100)
committerMiroslav Šulc <fordfrog@gentoo.org>
Mon, 16 Dec 2019 09:34:06 +0000 (10:34 +0100)
examples need to link against libsndfile unconditionally so either we could
make the dep unconditional or not build the examples. i chose the latter way.
btw, examples are not installed anyway, they are just compiled.

Closes: https://bugs.gentoo.org/701030
Package-Manager: Portage-2.3.82, Repoman-2.3.20
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
media-libs/simage/files/simage-1.7.1-disable-examples.patch [new file with mode: 0644]
media-libs/simage/files/simage-1.7.1-fix-examples-linking.patch [deleted file]
media-libs/simage/simage-1.7.1-r1.ebuild

diff --git a/media-libs/simage/files/simage-1.7.1-disable-examples.patch b/media-libs/simage/files/simage-1.7.1-disable-examples.patch
new file mode 100644 (file)
index 0000000..9e43e07
--- /dev/null
@@ -0,0 +1,44 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5536922..07df95a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -482,23 +482,23 @@ endif()
+ # Build examples\r
+ # ############################################################################\r
\r
+-set(SIMAGE_EXAMPLE_SOURCE\r
+-  ${CMAKE_CURRENT_SOURCE_DIR}/examples/audio2raw.c\r
+-  ${CMAKE_CURRENT_SOURCE_DIR}/examples/img2avi.c\r
++#set(SIMAGE_EXAMPLE_SOURCE\r
++#  ${CMAKE_CURRENT_SOURCE_DIR}/examples/audio2raw.c\r
++#  ${CMAKE_CURRENT_SOURCE_DIR}/examples/img2avi.c\r
+ #  ${CMAKE_CURRENT_SOURCE_DIR}/examples/mpeg2enc.cpp # requires Coin to build\r
+-  ${CMAKE_CURRENT_SOURCE_DIR}/examples/simage-convert.c\r
+-  ${CMAKE_CURRENT_SOURCE_DIR}/examples/simage-read-line-test.c\r
+-)\r
+-\r
+-foreach(_source ${SIMAGE_EXAMPLE_SOURCE})\r
+-  get_filename_component(_example ${_source} NAME_WE)\r
+-  add_executable(${_example} ${_source})\r
+-  target_compile_definitions(${_example} PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES)\r
+-  target_link_libraries(${_example} simage)\r
+-  if(UNIX)\r
+-    target_link_libraries(${_example} m)\r
+-  endif()\r
+-endforeach()\r
++#  ${CMAKE_CURRENT_SOURCE_DIR}/examples/simage-convert.c\r
++#  ${CMAKE_CURRENT_SOURCE_DIR}/examples/simage-read-line-test.c\r
++#)\r
++\r
++#foreach(_source ${SIMAGE_EXAMPLE_SOURCE})\r
++#  get_filename_component(_example ${_source} NAME_WE)\r
++#  add_executable(${_example} ${_source})\r
++#  target_compile_definitions(${_example} PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES)\r
++#  target_link_libraries(${_example} simage)\r
++#  if(UNIX)\r
++#    target_link_libraries(${_example} m)\r
++#  endif()\r
++#endforeach()\r
\r
+ # ############################################################################\r
+ # Build tests\r
diff --git a/media-libs/simage/files/simage-1.7.1-fix-examples-linking.patch b/media-libs/simage/files/simage-1.7.1-fix-examples-linking.patch
deleted file mode 100644 (file)
index 756ddea..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 8225dc4..de89fd0 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -494,7 +494,7 @@ foreach(_source ${SIMAGE_EXAMPLE_SOURCE})
-   get_filename_component(_example ${_source} NAME_WE)\r
-   add_executable(${_example} ${_source})\r
-   target_compile_definitions(${_example} PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES)\r
--  target_link_libraries(${_example} simage)\r
-+  target_link_libraries(${_example} simage sndfile)\r
-   if(UNIX)\r
-     target_link_libraries(${_example} m)\r
-   endif()\r
-@@ -507,7 +507,7 @@ endforeach()
- enable_testing()\r
\r
- add_executable(loaders tests/loaders.c)\r
--target_link_libraries(loaders simage)\r
-+target_link_libraries(loaders simage sndfile)\r
- target_compile_definitions(loaders PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES)\r
- if(UNIX)\r
-   target_link_libraries(loaders m)\r
index e6405b2179abd1803ffc0beb094dad4e96272f65..5117be12735c7d9b3d955b9b1d347b75c6832348 100644 (file)
@@ -38,7 +38,10 @@ S="${WORKDIR}/${PN}"
 
 PATCHES=(
        "${FILESDIR}/${P}-cmake-automagic-deps.patch"
-       "${FILESDIR}/${P}-fix-examples-linking.patch"
+       # examples need to link against libsndfile unconditionally so either we could
+       # make the dep unconditional or not build the examples. i chose the latter way.
+       # btw, examples are not installed anyway, they are just compiled.
+       "${FILESDIR}/${P}-disable-examples.patch"
        "${FILESDIR}/${P}-disable-gif-quantize-buffer.patch"
 )