diff options
Diffstat (limited to 'media-libs/openjpeg')
-rw-r--r-- | media-libs/openjpeg/Manifest | 2 | ||||
-rw-r--r-- | media-libs/openjpeg/files/openjpeg-2.4.0-r2-fix-segfault.patch | 17 | ||||
-rw-r--r-- | media-libs/openjpeg/openjpeg-2.4.0-r2.ebuild | 140 |
3 files changed, 159 insertions, 0 deletions
diff --git a/media-libs/openjpeg/Manifest b/media-libs/openjpeg/Manifest index 2192b3956662..55a846866a83 100644 --- a/media-libs/openjpeg/Manifest +++ b/media-libs/openjpeg/Manifest @@ -1,7 +1,9 @@ AUX openjpeg-2.4.0-gnuinstalldirs.patch 15977 BLAKE2B d1036c329d2f1b829e0bc019d2c761acf2f09a061ccf60421797f89005d194279eb880096d151a379fe3ee7edc36a0d3bceeabae0e8c7d9546baed4b7218d800 SHA512 8563a50c86c10b4306e4fb4a2077094268a58e0e2a468702fdbbccbd5f6db59d2f5a67f772dae17066611c09da0c4baeb6980d3aeddfd0690108336d70f39670 AUX openjpeg-2.4.0-r1-gnuinstalldirs.patch 15897 BLAKE2B ee5b28985348d9da58d930782420aa43d284efd64574d8f8b250e6d115d6bbb6f4756de2ce6e17251f03c1b6b3dbde2c0fa71b2308724eb84354b15fad650ea2 SHA512 899a112fc8dc65d1c17ec68bf80dc0e892e619bfc67b97784e72c0878ed1a0dc44345b9f5b86e4453df27124b20444ab81511fc66f3e871475a93d8f1f7700bc +AUX openjpeg-2.4.0-r2-fix-segfault.patch 721 BLAKE2B b26eaa1de6fc64e21477dbf1baeffae5a7df5f78228be117ff48d1d330e58702b516bcb345eddff03e344338c46b0ce66b6ac64198a9bf8a065e036be1e6c19a SHA512 adda72abdf46b9bd2aa0ddf8a653726181271bf1e680cd8caaa28150ee4ef83437246b563f26607b64305a50d68e7f24da81ccba306ad7451375d71fb896c702 DIST openjpeg-2.4.0.tar.gz 2233229 BLAKE2B ab8907638ac041ce7dcbcbcd9624ea5e4b7542c9ec38a850e363c071c27c4bc8b16e207700b12e67d8d32bdd9b0838735bede27084090ce95105d32c539b09cf SHA512 55daab47d33823af94e32e5d345b52c251a5410f0c8e0a13b693f17899eedc8b2bb107489ddcba9ab78ef17dfd7cd80d3c5ec80c1e429189cb041124b67e07a8 DIST openjpeg-data_20201130.tar.gz 497969983 BLAKE2B 35ff1ee234e3bbf47a822151c97cdf2764f864094973fa60adc7962f8065b38318b0cc41338b5ba3fffd9bb00eac3eaf4153ecc398abd49a8047168414c1c85b SHA512 4c367c8262fe894f90a1e63fb59d87e974ae0d750d3cee89adfe4d765040f0a2049b491a17a34a5b3ba79e183a508c9d592376fe3c112df56c311bf3212f0c31 EBUILD openjpeg-2.4.0-r1.ebuild 4478 BLAKE2B 46a5f1d2ea203610cb86b081c34477f1e8ff10d3467cbdecb5c218870d0e74aeffafd0925c90de5650a775f1b6f417df6ec2afbda3591ad6e9d2b044a11fc315 SHA512 686fdd68d37aa2b40a712b1f51711f509653f553e0dc0d3ad232c721e58146150c23f4eb5ec8c61d4fd147b7a32210664c0990035b2027001cd84c2bfe81db12 +EBUILD openjpeg-2.4.0-r2.ebuild 4540 BLAKE2B 4687d9a0481facc18df6ca69fd4f6065186cae265b0dfd187faf312a4a6258dc5ba18c2cebd9bbf16c99b3942476983fa5a47ae3ed5a4242854b75e6fd178a31 SHA512 92c25bce2326243646e2c9d7cf95053dd64f4ca2727e4a4c38fe03c58b08840ce95e0ea52d21d850528e4b8732f63cf07c4003b46a4b93cd2f6eae5aebe98779 EBUILD openjpeg-2.4.0.ebuild 4467 BLAKE2B c1940c9c26d9e010fee76fe1c5c894a0fbffa5be2bc8eba8bb6d1d74b28e37f3a1e1eaad6a9bab60e58ce82942019a7fe796b2672c518c7c519b5cd05d2778fb SHA512 40d63968fb5f16b086ed154ef407a02f1cac452e82ce4fbd853f05ec76ef336db75be867dd1767c2845019eab72e3a6142d0de526b870b1b9f6d8b847441def2 MISC metadata.xml 311 BLAKE2B f7da3c88ae13437c6dbd48c7468f091d1b87bea39a53a85b4abc97d6beb3869c5bb9bd0aeafb065961611be1098a25fdafd8f9b0eb6e395a0de734fc2df53dd5 SHA512 a5a60bfea83513d0eba56f9873bc2d38ca89bc2fade19744d32b767120b5c9e29f56ebddb903648643517f6e2488525e538a1810d91cc864640312c05b7031b2 diff --git a/media-libs/openjpeg/files/openjpeg-2.4.0-r2-fix-segfault.patch b/media-libs/openjpeg/files/openjpeg-2.4.0-r2-fix-segfault.patch new file mode 100644 index 000000000000..86e1c1fe39cc --- /dev/null +++ b/media-libs/openjpeg/files/openjpeg-2.4.0-r2-fix-segfault.patch @@ -0,0 +1,17 @@ +Upstream: https://github.com/uclouvain/openjpeg/commit/0afbdcf3e6d0d2bd2e16a0c4d513ee3cf86e460d +From: xiaoxiaoafeifei <lliangliang2007@163.com> +Date: Wed, 14 Jul 2021 09:35:13 +0800 +Subject: [PATCH] Fix segfault in src/bin/jp2/opj_decompress.c due to + uninitialized pointer (fixes #1368) (#1369) + +--- a/src/bin/jp2/opj_decompress.c ++++ b/src/bin/jp2/opj_decompress.c +@@ -1356,7 +1356,7 @@ int main(int argc, char **argv) + int it_image; + num_images = get_num_images(img_fol.imgdirpath); + +- dirptr = (dircnt_t*)malloc(sizeof(dircnt_t)); ++ dirptr = (dircnt_t*)calloc(1, sizeof(dircnt_t)); + if (!dirptr) { + destroy_parameters(¶meters); + return EXIT_FAILURE; diff --git a/media-libs/openjpeg/openjpeg-2.4.0-r2.ebuild b/media-libs/openjpeg/openjpeg-2.4.0-r2.ebuild new file mode 100644 index 000000000000..cecc59d76a7f --- /dev/null +++ b/media-libs/openjpeg/openjpeg-2.4.0-r2.ebuild @@ -0,0 +1,140 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +CMAKE_ECLASS=cmake +inherit cmake-multilib flag-o-matic + +# Make sure that test data are not newer than release; +# otherwise we will see "Found-But-No-Test" test failures! +MY_TESTDATA_COMMIT="cd724fb1f93e6af41ebc68c4904f4bf2a4cd1e60" + +DESCRIPTION="Open-source JPEG 2000 library" +HOMEPAGE="https://www.openjpeg.org" +SRC_URI="https://github.com/uclouvain/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz + test? ( https://github.com/uclouvain/openjpeg-data/archive/${MY_TESTDATA_COMMIT}.tar.gz -> ${PN}-data_20201130.tar.gz )" + +LICENSE="BSD-2" +SLOT="2/7" # based on SONAME +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="doc static-libs test" +RESTRICT="!test? ( test )" + +RDEPEND=" + media-libs/lcms:2 + media-libs/libpng:0= + media-libs/tiff:0 + sys-libs/zlib:=" +DEPEND="${RDEPEND}" +BDEPEND=" + doc? ( app-doc/doxygen )" + +DOCS=( AUTHORS.md CHANGELOG.md NEWS.md README.md THANKS.md ) + +PATCHES=( + "${FILESDIR}/${PN}-2.4.0-r1-gnuinstalldirs.patch" # bug 667150 + "${FILESDIR}/${PN}-2.4.0-r2-fix-segfault.patch" # bug 832007 +) + +src_prepare() { + if use test; then + mv "${WORKDIR}"/openjpeg-data-${MY_TESTDATA_COMMIT} "${WORKDIR}"/data || + die "Failed to rename test data" + fi + + cmake_src_prepare +} + +multilib_src_configure() { + local mycmakeargs=( + -DBUILD_PKGCONFIG_FILES=ON # always build pkgconfig files, bug #539834 + -DBUILD_TESTING="$(multilib_native_usex test)" + -DBUILD_DOC=$(multilib_native_usex doc ON OFF) + -DBUILD_CODEC=$(multilib_is_native_abi && echo ON || echo OFF) + -DBUILD_STATIC_LIBS=$(usex static-libs) + ) + + # Cheat a little bit and force disabling fixed point magic + # The test suite is extremely fragile to small changes + # bug 715130, bug 715422 + # https://github.com/uclouvain/openjpeg/issues/1017 + multilib_is_native_abi && use test && append-cflags "-ffp-contract=off" + + cmake_src_configure +} + +multilib_src_test() { + if ! multilib_is_native_abi ; then + elog "Cannot run tests for non-multilib abi." + return 0 + fi + + local myctestargs= + + pushd "${BUILD_DIR}" > /dev/null || die + [[ -e CTestTestfile.cmake ]] || die "Test suite not available! Check source!" + + [[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure ) + + echo ctest "${myctestargs[@]}" "$@" + if ctest "${myctestargs[@]}" "$@" ; then + einfo "Tests succeeded." + popd > /dev/null || die + return 0 + else + local FAILEDTEST_LOG="${BUILD_DIR}/Testing/Temporary/LastTestsFailed.log" + + if [[ ! -f "${FAILEDTEST_LOG}" ]] ; then + # Should never happen + die "Cannot analyze test failures: LastTestsFailed.log is missing!" + fi + + echo "" + einfo "Note: Upstream is maintaining a list of known test failures." + einfo "We will now compare our test results against this list and sort out any known failure." + + local KNOWN_FAILURES_LIST="${T}/known_failures_compiled.txt" + cat "${S}/tools/travis-ci/knownfailures-all.txt" > "${KNOWN_FAILURES_LIST}" || die + + local ARCH_SPECIFIC_FAILURES= + if use amd64 ; then + ARCH_SPECIFIC_FAILURES="$(find "${S}/tools/travis-ci/" -name 'knownfailures-*x86_64*.txt' -print0 | sort -z | tail -z -n 1 | tr -d '\0')" + elif use x86 || use arm || use arm64; then + ARCH_SPECIFIC_FAILURES="$(find "${S}/tools/travis-ci/" -name 'knownfailures-*i386*.txt' -print0 | sort -z | tail -z -n 1 | tr -d '\0')" + fi + + if [[ -f "${ARCH_SPECIFIC_FAILURES}" ]] ; then + einfo "Adding architecture specific failures (${ARCH_SPECIFIC_FAILURES}) to known failures list ..." + cat "${ARCH_SPECIFIC_FAILURES}" >> "${KNOWN_FAILURES_LIST}" || die + fi + + # Logic copied from $S/tools/travis-ci/run.sh + local FAILEDTEST= + local FAILURES_LOG="${BUILD_DIR}/Testing/Temporary/failures.txt" + local HAS_UNKNOWN_TEST_FAILURES=0 + + echo "" + + awk -F: '{ print $2 }' "${FAILEDTEST_LOG}" > "${FAILURES_LOG}" + while read FAILEDTEST; do + # is this failure known? + if grep -x "${FAILEDTEST}" "${KNOWN_FAILURES_LIST}" > /dev/null; then + ewarn "Test '${FAILEDTEST}' is known to fail, ignoring ..." + continue + fi + + eerror "New/unknown test failure found: '${FAILEDTEST}'" + HAS_UNKNOWN_TEST_FAILURES=1 + done < "${FAILURES_LOG}" + + if [[ ${HAS_UNKNOWN_TEST_FAILURES} -ne 0 ]]; then + die "Test suite failed. New/unknown test failure(s) found!" + else + echo "" + einfo "Test suite passed. No new/unknown test failure(s) found!" + fi + + return 0 + fi +} |