From a4adda0a54ba4826ac56b002893937c2ed593080 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Mon, 22 Nov 2021 11:55:50 -0500 Subject: media-libs/libjxl: backport fixes to 0.6.1 --- media-libs/libjxl/files/system-lcms.patch | 47 ------------ media-libs/libjxl/libjxl-0.6.1-r1.ebuild | 122 ++++++++++++++++++++++++++++++ media-libs/libjxl/libjxl-0.6.1.ebuild | 119 ----------------------------- 3 files changed, 122 insertions(+), 166 deletions(-) delete mode 100644 media-libs/libjxl/files/system-lcms.patch create mode 100644 media-libs/libjxl/libjxl-0.6.1-r1.ebuild delete mode 100644 media-libs/libjxl/libjxl-0.6.1.ebuild (limited to 'media-libs') diff --git a/media-libs/libjxl/files/system-lcms.patch b/media-libs/libjxl/files/system-lcms.patch deleted file mode 100644 index 537e02c..0000000 --- a/media-libs/libjxl/files/system-lcms.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 280d4af..c9186df 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -127,6 +127,8 @@ set(JPEGXL_FORCE_SYSTEM_BROTLI false CACHE BOOL - "Force using system installed brotli instead of third_party/brotli source.") - set(JPEGXL_FORCE_SYSTEM_HWY false CACHE BOOL - "Force using system installed highway (libhwy-dev) instead of third_party/highway source.") -+set(JPEGXL_FORCE_SYSTEM_LCMS false CACHE BOOL -+ "Force using system installed lcms instead of third_party/lcms source.") - - # Check minimum compiler versions. Older compilers are not supported and fail - # with hard to understand errors. -diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt -index b5e1899..887d31d 100644 ---- a/third_party/CMakeLists.txt -+++ b/third_party/CMakeLists.txt -@@ -201,13 +201,23 @@ if (JPEGXL_ENABLE_SKCMS OR JPEGXL_ENABLE_PLUGINS) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/skcms/LICENSE" - ${PROJECT_BINARY_DIR}/LICENSE.skcms COPYONLY) - endif () --if (JPEGXL_ENABLE_VIEWERS OR NOT JPEGXL_ENABLE_SKCMS) -- if( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lcms/.git" ) -- message(SEND_ERROR "Please run git submodule update --init") -+if ((JPEGXL_ENABLE_VIEWERS OR NOT JPEGXL_ENABLE_SKCMS)) -+ if(JPEGXL_FORCE_SYSTEM_LCMS) -+ pkg_check_modules(LCMS REQUIRED IMPORTED_TARGET lcms2) -+ add_library(lcms2 INTERFACE IMPORTED GLOBAL) -+ target_link_libraries(lcms2 INTERFACE PkgConfig::LCMS) -+ else() -+ if(JPEGXL_DEP_LICENSE_DIR) -+ configure_file("${JPEGXL_DEP_LICENSE_DIR}/libhwy-dev/copyright" -+ ${PROJECT_BINARY_DIR}/LICENSE.highway COPYONLY) -+ endif() # JPEGXL_DEP_LICENSE_DIR -+ if( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lcms/.git" ) -+ message(SEND_ERROR "Please run git submodule update --init") -+ endif() -+ include(lcms2.cmake) -+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lcms/COPYING" -+ ${PROJECT_BINARY_DIR}/LICENSE.lcms COPYONLY) - endif() -- include(lcms2.cmake) -- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lcms/COPYING" -- ${PROJECT_BINARY_DIR}/LICENSE.lcms COPYONLY) - endif() - - # sjpeg diff --git a/media-libs/libjxl/libjxl-0.6.1-r1.ebuild b/media-libs/libjxl/libjxl-0.6.1-r1.ebuild new file mode 100644 index 0000000..2c76afb --- /dev/null +++ b/media-libs/libjxl/libjxl-0.6.1-r1.ebuild @@ -0,0 +1,122 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +CMAKE_ECLASS=cmake +inherit cmake-multilib java-pkg-opt-2 xdg-utils + +DESCRIPTION="JPEG XL image format reference implementation" +HOMEPAGE="https://github.com/libjxl/libjxl" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/libjxl/libjxl.git" + EGIT_SUBMODULES=(third_party/lodepng third_party/skcms) +else + LODEPNG_COMMIT="8c6a9e30576f07bf470ad6f09458a2dcd7a6a84a" + SKCMS_COMMIT="64374756e03700d649f897dbd98c95e78c30c7da" + SRC_URI=" + https://github.com/libjxl/libjxl/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + https://github.com/lvandeve/lodepng/archive/${LODEPNG_COMMIT}.tar.gz -> lodepng-${LODEPNG_COMMIT}.tar.gz + https://skia.googlesource.com/skcms/+archive/${SKCMS_COMMIT}.tar.gz + " +fi + +LICENSE="Apache-2.0" +SLOT="0/7" +if [[ ${PV} != 9999 ]]; then + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux" +fi +IUSE="apng doc gdk-pixbuf gif gimp java +jpeg +man openexr qt5 static-libs test +tools" + +RDEPEND="app-arch/brotli[${MULTILIB_USEDEP}] + dev-cpp/highway[${MULTILIB_USEDEP}] + apng? ( + media-libs/libpng[${MULTILIB_USEDEP}] + sys-libs/zlib[${MULTILIB_USEDEP}] + ) + gdk-pixbuf? ( x11-libs/gdk-pixbuf ) + gif? ( media-libs/giflib[${MULTILIB_USEDEP}] ) + gimp? ( media-gfx/gimp:0/2 ) + java? ( >=virtual/jre-1.8:* ) + jpeg? ( virtual/jpeg[${MULTILIB_USEDEP}] ) + openexr? ( media-libs/openexr:= ) + qt5? ( + dev-qt/qtwidgets + dev-qt/qtx11extras + ) +" +BDEPEND=" + doc? ( app-doc/doxygen ) + man? ( app-text/asciidoc ) + qt5? ( kde-frameworks/extra-cmake-modules ) +" +DEPEND="${RDEPEND} + test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] ) + java? ( >=virtual/jdk-1.8:* ) +" + +PATCHES=( + "${FILESDIR}/roundtripanimationpatches-ifdef-gif.patch" +) + +src_prepare() { + if [[ ${PV} != 9999 ]]; then + rmdir third_party/lodepng + ln -sv ../../lodepng-${LODEPNG_COMMIT} third_party/lodepng || die + fi + use gdk-pixbuf || sed -i -e '/(gdk-pixbuf)/s/^/#/' plugins/CMakeLists.txt || die + use gimp || sed -i -e '/(gimp)/s/^/#/' plugins/CMakeLists.txt || die + cmake_src_prepare + java-pkg-opt-2_src_prepare +} + +multilib_src_configure() { + local mycmakeargs=( + -DBUILD_TESTING=$(usex test ON OFF) + -DJPEGXL_ENABLE_BENCHMARK=OFF + -DJPEGXL_ENABLE_COVERAGE=OFF + -DJPEGXL_ENABLE_EXAMPLES=OFF + -DJPEGXL_ENABLE_FUZZERS=OFF + -DJPEGXL_ENABLE_TOOLS=$(multilib_native_usex tools) + -DJPEGXL_ENABLE_JNI=$(multilib_native_usex java) + -DJPEGXL_ENABLE_MANPAGES=$(multilib_native_usex man) + -DJPEGXL_ENABLE_OPENEXR=$(multilib_native_usex openexr) + -DJPEGXL_ENABLE_PLUGINS=$(multilib_is_native_abi && echo ON || echo OFF) # USE=gdk-pixbuf, USE=gimp handled in src_prepare + -DJPEGXL_ENABLE_SJPEG=OFF + -DJPEGXL_ENABLE_SKCMS=ON + -DJPEGXL_ENABLE_TCMALLOC=OFF + -DJPEGXL_ENABLE_VIEWERS=$(multilib_native_usex qt5) + + -DCMAKE_DISABLE_FIND_PACKAGE_PNG=$(multilib_native_usex png OFF ON) + -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=$(multilib_native_usex doc OFF ON) + -DCMAKE_DISABLE_FIND_PACKAGE_GIF=$(multilib_native_usex gif OFF ON) + -DCMAKE_DISABLE_FIND_PACKAGE_JPEG=$(multilib_native_usex jpeg OFF ON) + ) + + cmake_src_configure +} + +multilib_src_test() { + # DecodeTest.PixelTestWithICCProfileLossy: https://github.com/libjxl/libjxl/issues/500 + # RobustStatisticsTest: https://github.com/libjxl/libjxl/issues/698 + local myctestargs=( + -E '^DecodeTest\.PixelTestWithICCProfileLossy$|^RobustStatisticsTest\.' + ) + cmake_src_test +} + +multilib_src_install() { + cmake_src_install + if ! use static-libs; then + rm "${ED}"/usr/lib*/*.a || die + fi + if use java && multilib_is_native_abi; then + java-pkg_doso tools/libjxl_jni.so + fi +} + +pkg_postinst() { + xdg_mimeinfo_database_update +} diff --git a/media-libs/libjxl/libjxl-0.6.1.ebuild b/media-libs/libjxl/libjxl-0.6.1.ebuild deleted file mode 100644 index e7e590b..0000000 --- a/media-libs/libjxl/libjxl-0.6.1.ebuild +++ /dev/null @@ -1,119 +0,0 @@ -# Copyright 2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -CMAKE_ECLASS=cmake -inherit cmake-multilib java-pkg-opt-2 - -DESCRIPTION="JPEG XL image format reference implementation" -HOMEPAGE="https://github.com/libjxl/libjxl" - -if [[ ${PV} == 9999 ]]; then - inherit git-r3 - EGIT_REPO_URI="https://github.com/libjxl/libjxl.git" - EGIT_SUBMODULES=(third_party/lodepng) -else - LODEPNG_COMMIT="48e5364ef48ec2408f44c727657ac1b6703185f8" - SRC_URI=" - https://github.com/libjxl/libjxl/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz - https://github.com/lvandeve/lodepng/archive/${LODEPNG_COMMIT}.tar.gz -> lodepng-${LODEPNG_COMMIT}.tar.gz - " -fi - -LICENSE="Apache-2.0" -SLOT="0/6" -if [[ ${PV} != 9999 ]]; then - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux" -fi -IUSE="apng doc gif java +jpeg +man openexr qt5 static-libs test" - -RDEPEND="app-arch/brotli[${MULTILIB_USEDEP}] - dev-cpp/highway[${MULTILIB_USEDEP}] - media-libs/lcms[${MULTILIB_USEDEP}] - apng? ( - media-libs/libpng[${MULTILIB_USEDEP}] - sys-libs/zlib[${MULTILIB_USEDEP}] - ) - gif? ( media-libs/giflib[${MULTILIB_USEDEP}] ) - java? ( >=virtual/jre-1.8:* ) - jpeg? ( virtual/jpeg[${MULTILIB_USEDEP}] ) - openexr? ( media-libs/openexr:=[${MULTILIB_USEDEP}] ) - qt5? ( - dev-qt/qtwidgets - dev-qt/qtx11extras - ) -" -BDEPEND=" - doc? ( app-doc/doxygen ) - man? ( app-text/asciidoc ) - qt5? ( kde-frameworks/extra-cmake-modules ) -" -DEPEND="${RDEPEND} - test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] ) - java? ( >=virtual/jdk-1.8:* ) -" - -PATCHES=( - "${FILESDIR}/system-lcms.patch" - "${FILESDIR}/roundtripanimationpatches-ifdef-gif.patch" -) - -src_prepare() { - if [[ ${PV} != 9999 ]]; then - rmdir third_party/lodepng - ln -sv ../../lodepng-${LODEPNG_COMMIT} third_party/lodepng || die - fi - cmake_src_prepare - java-pkg-opt-2_src_prepare -} - -multilib_src_configure() { - local mycmakeargs=( - -DBUILD_TESTING=$(usex test ON OFF) - -DJPEGXL_ENABLE_BENCHMARK=OFF - -DJPEGXL_ENABLE_COVERAGE=OFF - -DJPEGXL_ENABLE_EXAMPLES=OFF - -DJPEGXL_ENABLE_FUZZERS=OFF - -DJPEGXL_ENABLE_JNI=$(multilib_native_usex java ON OFF) - -DJPEGXL_ENABLE_MANPAGES=$(multilib_native_usex man ON OFF) - -DJPEGXL_ENABLE_OPENEXR=$(usex openexr ON OFF) - -DJPEGXL_ENABLE_PLUGINS=OFF - -DJPEGXL_ENABLE_SJPEG=OFF - -DJPEGXL_ENABLE_SKCMS=OFF - -DJPEGXL_ENABLE_TCMALLOC=OFF - -DJPEGXL_ENABLE_VIEWERS=$(multilib_native_usex qt5 ON OFF) - -DJPEGXL_FORCE_SYSTEM_BROTLI=ON - -DJPEGXL_FORCE_SYSTEM_GTEST=ON - -DJPEGXL_FORCE_SYSTEM_HWY=ON - -DJPEGXL_FORCE_SYSTEM_LCMS=ON - -DJPEGXL_WARNINGS_AS_ERRORS=OFF - - $(cmake_use_find_package apng PNG) - $(cmake_use_find_package apng ZLIB) - -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=$(multilib_native_usex doc OFF ON) - $(cmake_use_find_package gif GIF) - $(cmake_use_find_package jpeg JPEG) - ) - - cmake_src_configure -} - -multilib_src_test() { - # DecodeTest.PixelTestWithICCProfileLossy: https://github.com/libjxl/libjxl/issues/500 - # RobustStatisticsTest: https://github.com/libjxl/libjxl/issues/698 - local myctestargs=( - -E '^DecodeTest\.PixelTestWithICCProfileLossy$|^RobustStatisticsTest\.' - ) - cmake_src_test -} - -multilib_src_install() { - cmake_src_install - if ! use static-libs; then - rm "${ED}"/usr/$(get_libdir)/libjxl{,_dec}.a || die - fi - if use java && multilib_is_native_abi; then - java-pkg_doso tools/libjxl_jni.so - fi -} -- cgit v1.2.3-70-g09d2