summaryrefslogtreecommitdiff
path: root/media-libs/libjxl
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2021-11-22 11:55:50 -0500
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2021-11-22 11:55:50 -0500
commita4adda0a54ba4826ac56b002893937c2ed593080 (patch)
tree4c174b523786a2dcf0746f99c00af7c5138ae9dd /media-libs/libjxl
parente341167ac5353386cd5c9b3c52514450bbb405ea (diff)
downloadgentoo-overlay-a4adda0a54ba4826ac56b002893937c2ed593080.tar.xz
gentoo-overlay-a4adda0a54ba4826ac56b002893937c2ed593080.zip
media-libs/libjxl: backport fixes to 0.6.1
Diffstat (limited to 'media-libs/libjxl')
-rw-r--r--media-libs/libjxl/files/system-lcms.patch47
-rw-r--r--media-libs/libjxl/libjxl-0.6.1-r1.ebuild (renamed from media-libs/libjxl/libjxl-0.6.1.ebuild)51
2 files changed, 27 insertions, 71 deletions
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.ebuild b/media-libs/libjxl/libjxl-0.6.1-r1.ebuild
index e7e590b..2c76afb 100644
--- a/media-libs/libjxl/libjxl-0.6.1.ebuild
+++ b/media-libs/libjxl/libjxl-0.6.1-r1.ebuild
@@ -4,7 +4,7 @@
EAPI=7
CMAKE_ECLASS=cmake
-inherit cmake-multilib java-pkg-opt-2
+inherit cmake-multilib java-pkg-opt-2 xdg-utils
DESCRIPTION="JPEG XL image format reference implementation"
HOMEPAGE="https://github.com/libjxl/libjxl"
@@ -12,33 +12,36 @@ 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)
+ EGIT_SUBMODULES=(third_party/lodepng third_party/skcms)
else
- LODEPNG_COMMIT="48e5364ef48ec2408f44c727657ac1b6703185f8"
+ 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/6"
+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 gif java +jpeg +man openexr qt5 static-libs test"
+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}]
- media-libs/lcms[${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:=[${MULTILIB_USEDEP}] )
+ openexr? ( media-libs/openexr:= )
qt5? (
dev-qt/qtwidgets
dev-qt/qtx11extras
@@ -55,7 +58,6 @@ DEPEND="${RDEPEND}
"
PATCHES=(
- "${FILESDIR}/system-lcms.patch"
"${FILESDIR}/roundtripanimationpatches-ifdef-gif.patch"
)
@@ -64,6 +66,8 @@ src_prepare() {
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
}
@@ -75,25 +79,20 @@ multilib_src_configure() {
-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_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=OFF
+ -DJPEGXL_ENABLE_SKCMS=ON
-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
+ -DJPEGXL_ENABLE_VIEWERS=$(multilib_native_usex qt5)
- $(cmake_use_find_package apng PNG)
- $(cmake_use_find_package apng ZLIB)
+ -DCMAKE_DISABLE_FIND_PACKAGE_PNG=$(multilib_native_usex png OFF ON)
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=$(multilib_native_usex doc OFF ON)
- $(cmake_use_find_package gif GIF)
- $(cmake_use_find_package jpeg JPEG)
+ -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
@@ -111,9 +110,13 @@ multilib_src_test() {
multilib_src_install() {
cmake_src_install
if ! use static-libs; then
- rm "${ED}"/usr/$(get_libdir)/libjxl{,_dec}.a || die
+ 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
+}