commit: 8cde5c549479110f27e426f97ee6011542423ceb Author: Lucas Mitrak <lucas <AT> lucasmitrak <DOT> com> AuthorDate: Fri Jun 11 12:15:47 2021 +0000 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> CommitDate: Fri Jun 11 12:25:24 2021 +0000 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=8cde5c54
sci-biology/dcm2niix: add USE flags, dependencies, src_configure * Add static system-jpeg +jpeg-ls jpeg2k use flags and implement them Currently, sci-biology/dcm2niix does not take advantage of many of the package's potential features. These potential features include a static runtime, using the system-wide media-libs/libjpeg-turbo instead of bundled compact NanoJPEG decoder, enabling JPEG-LS using the bundled CharLS library, and enabling JPEG2000 support. These are important, especially since the static runtime is enabled by default and JPEG-LS can be enabled without any downside. This commit adds these USE flags and their implementation in the dependencies and in src_configure. The naming of the use flags follow the same naming convention found elsewhere. For example, system-jpeg is the same as thunderbird, firefox, and seamonkey. In addition, jpeg-ls is the only possible name for the JPEG-LS transfer syntaxes. These two package-specific USE flag names were added to metadata.xml. With this commit, the use flags will be added to the package. Without this commit, the package will not have these potential features. This commit was tested in a docker image with dev-util/ebuildtester. This commit was written, tested, and submitted by Lucas Mitrak. Signed-off-by: Lucas Mitrak <lucas <AT> lucasmitrak.com> Closes: https://github.com/gentoo/sci/pull/1092 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org> sci-biology/dcm2niix/dcm2niix-1.0.20201102.ebuild | 20 ++++++++++++++++++-- sci-biology/dcm2niix/metadata.xml | 5 +++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/sci-biology/dcm2niix/dcm2niix-1.0.20201102.ebuild b/sci-biology/dcm2niix/dcm2niix-1.0.20201102.ebuild index e9d0d7ea0..5ae682ea5 100644 --- a/sci-biology/dcm2niix/dcm2niix-1.0.20201102.ebuild +++ b/sci-biology/dcm2niix/dcm2niix-1.0.20201102.ebuild @@ -12,14 +12,30 @@ SRC_URI="https://github.com/rordenlab/dcm2niix/archive/v${PV}.tar.gz -> ${P}.tar SLOT="0" LICENSE="BSD" KEYWORDS="~amd64 ~x86" +IUSE="static system-jpeg +jpeg-ls jpeg2k" -DEPEND="" -RDEPEND="" +DEPEND=" + system-jpeg? ( media-libs/libjpeg-turbo ) + jpeg2k? ( media-libs/openjpeg ) +" +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" PATCHES=( "${FILESDIR}"/${PN}-disable_find_git.patch ) +src_configure() { + local mycmakeargs=( + -DUSE_STATIC_RUNTIME=$(usex static) + -DUSE_TURBOJPEG=$(usex system-jpeg) + -DUSE_JPEGLS=$(usex jpeg-ls) + -DUSE_OPENJPEG=$(usex jpeg2k) + ) + + cmake_src_configure +} + pkg_postinst() { optfeature "parallel gzip support" app-arch/pigz } diff --git a/sci-biology/dcm2niix/metadata.xml b/sci-biology/dcm2niix/metadata.xml index c7c32010c..9c9e19081 100644 --- a/sci-biology/dcm2niix/metadata.xml +++ b/sci-biology/dcm2niix/metadata.xml @@ -9,6 +9,11 @@ <email>[email protected]</email> <name>Gentoo Science Project</name> </maintainer> + <use> + <flag name="system-jpeg">Use the system-wide <pkg>media-libs/libjpeg-turbo</pkg> + instead of bundled.</flag> + <flag name="jpeg-ls">Supprt for converting DICOM images compressed with the JPEG-LS transfer syntaxes using the bundled CharLS library</flag> + </use> <longdescription> dcm2niix is a designed to convert neuroimaging data from the DICOM format to the NIfTI format. ICOM provides many ways to store/compress
