1 |
commit: 8cde5c549479110f27e426f97ee6011542423ceb |
2 |
Author: Lucas Mitrak <lucas <AT> lucasmitrak <DOT> com> |
3 |
AuthorDate: Fri Jun 11 12:15:47 2021 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 11 12:25:24 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=8cde5c54 |
7 |
|
8 |
sci-biology/dcm2niix: add USE flags, dependencies, src_configure |
9 |
|
10 |
* Add static system-jpeg +jpeg-ls jpeg2k use flags and implement them |
11 |
|
12 |
Currently, sci-biology/dcm2niix does not take advantage of many |
13 |
of the package's potential features. These potential features include |
14 |
a static runtime, using the system-wide media-libs/libjpeg-turbo |
15 |
instead of bundled compact NanoJPEG decoder, enabling JPEG-LS using |
16 |
the bundled CharLS library, and enabling JPEG2000 support. These are |
17 |
important, especially since the static runtime is enabled by default |
18 |
and JPEG-LS can be enabled without any downside. This commit adds |
19 |
these USE flags and their implementation in the dependencies and in |
20 |
src_configure. The naming of the use flags follow the same naming |
21 |
convention found elsewhere. For example, system-jpeg is the same |
22 |
as thunderbird, firefox, and seamonkey. In addition, jpeg-ls is the |
23 |
only possible name for the JPEG-LS transfer syntaxes. These two |
24 |
package-specific USE flag names were added to metadata.xml. |
25 |
With this commit, the use flags will be added to the package. |
26 |
Without this commit, the package will not have these potential |
27 |
features. |
28 |
This commit was tested in a docker image with dev-util/ebuildtester. |
29 |
This commit was written, tested, and submitted by Lucas Mitrak. |
30 |
Signed-off-by: Lucas Mitrak <lucas <AT> lucasmitrak.com> |
31 |
Closes: https://github.com/gentoo/sci/pull/1092 |
32 |
|
33 |
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org> |
34 |
|
35 |
sci-biology/dcm2niix/dcm2niix-1.0.20201102.ebuild | 20 ++++++++++++++++++-- |
36 |
sci-biology/dcm2niix/metadata.xml | 5 +++++ |
37 |
2 files changed, 23 insertions(+), 2 deletions(-) |
38 |
|
39 |
diff --git a/sci-biology/dcm2niix/dcm2niix-1.0.20201102.ebuild b/sci-biology/dcm2niix/dcm2niix-1.0.20201102.ebuild |
40 |
index e9d0d7ea0..5ae682ea5 100644 |
41 |
--- a/sci-biology/dcm2niix/dcm2niix-1.0.20201102.ebuild |
42 |
+++ b/sci-biology/dcm2niix/dcm2niix-1.0.20201102.ebuild |
43 |
@@ -12,14 +12,30 @@ SRC_URI="https://github.com/rordenlab/dcm2niix/archive/v${PV}.tar.gz -> ${P}.tar |
44 |
SLOT="0" |
45 |
LICENSE="BSD" |
46 |
KEYWORDS="~amd64 ~x86" |
47 |
+IUSE="static system-jpeg +jpeg-ls jpeg2k" |
48 |
|
49 |
-DEPEND="" |
50 |
-RDEPEND="" |
51 |
+DEPEND=" |
52 |
+ system-jpeg? ( media-libs/libjpeg-turbo ) |
53 |
+ jpeg2k? ( media-libs/openjpeg ) |
54 |
+" |
55 |
+RDEPEND="${DEPEND}" |
56 |
+BDEPEND="virtual/pkgconfig" |
57 |
|
58 |
PATCHES=( |
59 |
"${FILESDIR}"/${PN}-disable_find_git.patch |
60 |
) |
61 |
|
62 |
+src_configure() { |
63 |
+ local mycmakeargs=( |
64 |
+ -DUSE_STATIC_RUNTIME=$(usex static) |
65 |
+ -DUSE_TURBOJPEG=$(usex system-jpeg) |
66 |
+ -DUSE_JPEGLS=$(usex jpeg-ls) |
67 |
+ -DUSE_OPENJPEG=$(usex jpeg2k) |
68 |
+ ) |
69 |
+ |
70 |
+ cmake_src_configure |
71 |
+} |
72 |
+ |
73 |
pkg_postinst() { |
74 |
optfeature "parallel gzip support" app-arch/pigz |
75 |
} |
76 |
|
77 |
diff --git a/sci-biology/dcm2niix/metadata.xml b/sci-biology/dcm2niix/metadata.xml |
78 |
index c7c32010c..9c9e19081 100644 |
79 |
--- a/sci-biology/dcm2niix/metadata.xml |
80 |
+++ b/sci-biology/dcm2niix/metadata.xml |
81 |
@@ -9,6 +9,11 @@ |
82 |
<email>sci@g.o</email> |
83 |
<name>Gentoo Science Project</name> |
84 |
</maintainer> |
85 |
+ <use> |
86 |
+ <flag name="system-jpeg">Use the system-wide <pkg>media-libs/libjpeg-turbo</pkg> |
87 |
+ instead of bundled.</flag> |
88 |
+ <flag name="jpeg-ls">Supprt for converting DICOM images compressed with the JPEG-LS transfer syntaxes using the bundled CharLS library</flag> |
89 |
+ </use> |
90 |
<longdescription> |
91 |
dcm2niix is a designed to convert neuroimaging data from the DICOM |
92 |
format to the NIfTI format. ICOM provides many ways to store/compress |