From 01bc8ce0c058cd799bcc5d2fb0730eb87eb8c59b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Miroslav=20=C5=A0ulc?= Date: Fri, 27 Dec 2019 11:52:29 +0100 Subject: [PATCH] media-libs/simage: fixed tests in 1.7.1-r1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 1) fixed building tests 2) organized deps Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Miroslav Å ulc --- .../simage-1.7.1-tests-conditional.patch | 52 +++++++++++++++++++ media-libs/simage/simage-1.7.1-r1.ebuild | 10 +++- 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 media-libs/simage/files/simage-1.7.1-tests-conditional.patch diff --git a/media-libs/simage/files/simage-1.7.1-tests-conditional.patch b/media-libs/simage/files/simage-1.7.1-tests-conditional.patch new file mode 100644 index 000000000000..ced49159ba69 --- /dev/null +++ b/media-libs/simage/files/simage-1.7.1-tests-conditional.patch @@ -0,0 +1,52 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5536922..b6de403 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -504,25 +504,28 @@ endforeach() + # Build tests + # ############################################################################ + +-enable_testing() +- +-add_executable(loaders tests/loaders.c) +-target_link_libraries(loaders simage) +-target_compile_definitions(loaders PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES) +-if(UNIX) +- target_link_libraries(loaders m) +-endif() +- +-add_test( +- loaders +- ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/loaders +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.gif +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.jpg +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.png +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.rgb +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.tga +- ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.tif +-) ++if(TESTS) ++ enable_testing() ++ ++ add_executable(loaders tests/loaders.c) ++ target_link_libraries(loaders simage) ++ target_compile_definitions(loaders PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES) ++ if(UNIX) ++ target_link_libraries(loaders m) ++ target_link_libraries(loaders sndfile) ++ endif() ++ ++ add_test( ++ loaders ++ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/loaders ++ ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.gif ++ ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.jpg ++ ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.png ++ ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.rgb ++ ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.tga ++ ${CMAKE_CURRENT_SOURCE_DIR}/tests/img.tif ++ ) ++endif() + + # Add a target to generate API documentation with Doxygen + if(SIMAGE_BUILD_DOCUMENTATION) diff --git a/media-libs/simage/simage-1.7.1-r1.ebuild b/media-libs/simage/simage-1.7.1-r1.ebuild index 5117be12735c..34859fa678e4 100644 --- a/media-libs/simage/simage-1.7.1-r1.ebuild +++ b/media-libs/simage/simage-1.7.1-r1.ebuild @@ -12,8 +12,12 @@ SRC_URI="https://bitbucket.org/Coin3D/simage/downloads/${P}-src.zip" LICENSE="public-domain mpeg2enc" KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" SLOT="0" -IUSE="debug gif jpeg png qt5 sndfile tiff vorbis" +IUSE="debug gif jpeg png qt5 sndfile test tiff vorbis" +RESTRICT="!test? ( test )" +BDEPEND=" + app-arch/unzip +" RDEPEND=" gif? ( media-libs/giflib ) jpeg? ( virtual/jpeg:0= ) @@ -31,7 +35,7 @@ RDEPEND=" " DEPEND=" ${RDEPEND} - app-arch/unzip + test? ( media-libs/libsndfile ) " S="${WORKDIR}/${PN}" @@ -42,6 +46,7 @@ PATCHES=( # 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}-tests-conditional.patch" "${FILESDIR}/${P}-disable-gif-quantize-buffer.patch" ) @@ -71,6 +76,7 @@ src_configure() { -DSIMAGE_RGB_SUPPORT=ON -DSIMAGE_TGA_SUPPORT=ON -DSIMAGE_XWD_SUPPORT=ON + -DTESTS=$(usex test) ) cmake-utils_src_configure -- 2.26.2