aports/testing/gdcm/APKBUILD
Bart Ribbers 44ce39a091 */*: remove unnecessary --output-on-failure
We set OUTPUT_ON_FAILURE by default nowadays so this argument is
unnecessary
2025-03-19 15:41:30 +00:00

184 lines
6.4 KiB
Text

# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=gdcm
pkgver=3.0.24
pkgrel=0
pkgdesc="Grassroots DiCoM is a C++ library for DICOM medical files"
url="https://gdcm.sourceforge.net/"
# armhf, aarch64: dcmtk missing
# s390x: vtk missing
# loongarch64: blocked by openjdk8-jdk
arch="all !aarch64 !armhf !s390x !loongarch64"
license="BSD-3-Clause"
makedepends="
charls-dev
cmake
cmake
dcmtk-dev
docbook-xsl
doxygen
expat-dev
font-freefont
fontconfig-dev
graphviz
json-c-dev
libogg-dev
libtheora-dev
libxml2-dev
libxslt-dev
mesa-dev
openjpeg-dev
openssl-dev
poppler-dev
python3-dev
samurai
sqlite-dev
swig
util-linux-dev
vtk-dev
"
subpackages="$pkgname-dev"
# gdcmData.tar.bz2 is broken
source="gdcm-$pkgver.tar.bz2::https://sourceforge.net/projects/gdcm/files/gdcm%203.x/GDCM%20$pkgver/gdcm-$pkgver.tar.bz2/download
https://downloads.sourceforge.net/project/gdcm/gdcmData/gdcmData/gdcmData.tar.gz
10-docbook4.patch
30-off_t.patch
40-java.patch
50-use_copyright.patch
60-fix_export_variables.patch
70-vtk9.3.0.patch
"
# Optional dependency texlive is not available on ppc64le, riscv64 and loongarch64
case "$CARCH" in
ppc64le|riscv64|loongarch64)
_with_doc="OFF"
;;
*)
makedepends="$makedepends texlive texmf-dist-latexextra texlive-dvi texmf-dist-lang texmf-dist-plaingeneric texmf-dist-fontsrecommended"
subpackages="$subpackages $pkgname-doc-html $pkgname-doc-pdf"
_with_doc="ON"
;;
esac
subpackages="$subpackages $pkgname-doc py3-$pkgname:py3"
# Optional dependency openjdk8-jdk is not available on riscv64
case "$CARCH" in
riscv64)
_with_java="OFF"
;;
*)
makedepends="$makedepends java-common openjdk8-jdk"
subpackages="$subpackages java-$pkgname:java"
_with_java="ON"
;;
esac
subpackages="$subpackages lib$pkgname:lib"
prepare() {
default_prepare
# Remove bundled utilities (we use Alpine's ones)
rm -rf Utilities/gdcmexpat
rm -rf Utilities/gdcmopenjpeg
rm -rf Utilities/gdcmopenjpeg
rm -rf Utilities/gdcmzlib
rm -rf Utilities/gdcmuuid
rm -rf Utilities/gdcmcharls
# Remove bundled utilities (we don't use them)
rm -rf Utilities/getopt
rm -rf Utilities/pvrg
}
build() {
if [ "$CBUILD" != "$CHOST" ]; then
local crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
cmake -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=None \
-DGDCM_INSTALL_PACKAGE_DIR=lib/cmake/gdcm \
-DGDCM_BUILD_TESTING:BOOL=ON \
-DGDCM_DATA_ROOT=../gdcmData/ \
-DGDCM_BUILD_EXAMPLES:BOOL=ON \
-DGDCM_DOCUMENTATION:BOOL=$_with_doc \
-DGDCM_WRAP_PYTHON:BOOL=ON \
-DPYTHON_EXECUTABLE="$(which python3)" \
-DGDCM_INSTALL_PYTHONMODULE_DIR="$(python -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')" \
-DGDCM_WRAP_JAVA:BOOL=$_with_java \
-DGDCM_WRAP_CSHARP:BOOL=OFF \
-DGDCM_BUILD_SHARED_LIBS:BOOL=ON \
-DGDCM_BUILD_APPLICATIONS:BOOL=ON \
-DGDCM_USE_VTK:BOOL=ON \
-DGDCM_USE_SYSTEM_CHARLS:BOOL=ON \
-DGDCM_USE_SYSTEM_EXPAT:BOOL=ON \
-DGDCM_USE_SYSTEM_OPENJPEG:BOOL=ON \
-DGDCM_USE_SYSTEM_ZLIB:BOOL=ON \
-DGDCM_USE_SYSTEM_UUID:BOOL=ON \
-DGDCM_USE_SYSTEM_LJPEG:BOOL=OFF \
-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON \
-DGDCM_USE_JPEGLS:BOOL=ON \
-DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON \
-DGDCM_USE_SYSTEM_JSON:BOOL=ON \
-DGDCM_USE_SYSTEM_POPPLER:BOOL=ON \
-DJAVA_HOME=/usr/lib/jvm/default-jvm \
-DPYTHON_VERSION_MAJOR=3 \
$crossopts
cmake --build build
}
check() {
local test_excludes="(TestMD5$|TestSHA1$|TestWriter$|TestAnonymizer4$|TestImageChangeTransferSyntax1$|TestImageChangeTransferSyntax2$|TestImageChangeTransferSyntax3$|TestImageChangeTransferSyntax4$|TestImageChangeTransferSyntax6$|TestImageChangeTransferSyntax7$|TestPrinter1$|TestImageReader$|TestImageRegionReader1$|TestImageRegionReader2$|TestImageRegionReader3$|TestImageReaderRandomEmpty$|TestImageWriter$|TestCleaner4$|TestJSON1$|TestImageChangeTransferSyntax5$|TestUIDGeneratorPython4$|TestDCMTKMD5Python$|TestSCUValidation$|TestEcho$|TestFind$|TestWrapPython$|gdcmscu-echo-dicomserver$|gdcmscu-store-dicomserver$|gdcmscu-find-dicomserver$|TestStrictScanner1$|TestStrictScanner2_1$|TestStrictScanner2$|TestStrictScanner2_2$|TestDICOMDIRGenerator1$|TestUIDGeneratorPython$|TestvtkGDCMImageWriter1$|TestvtkGDCMMetaImageWriter$|TestvtkGDCMImageReader2_2$|TestvtkGDCMMetaImageWriter2$|TestFileChangeTransferSyntax1$|TestFileChangeTransferSyntax2$|TestFileChangeTransferSyntax2$|TestFileChangeTransferSyntax4$|TestReaderCanRead$|TestRescaler2$)"
ctest --test-dir build -E $test_excludes
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
html() {
pkgdesc="Grassroots DiCoM HTML documentation"
amove usr/share/doc/gdcm-3.0/html
}
pdf() {
pkgdesc="Grassroots DiCoM PDF documentation"
amove usr/share/doc/gdcm-3.0/gdcm-$pkgver.pdf
}
java() {
pkgdesc="$pkgdesc (Java bindings)"
mkdir -p "$subpkgdir"/usr/share/java
mv "$pkgdir"/usr/lib/gdcm.jar "$subpkgdir"/usr/share/java/gdcm-$pkgver.jar
cd "$subpkgdir"/usr/share/java/
ln -s gdcm-$pkgver.jar gdcm.jar
amove usr/lib/libgdcmjni.so
}
py3() {
pkgdesc="$pkgdesc (Python3 bindings)"
amove usr/lib/python3*
}
lib() {
pkgdesc="Grassroots DiCoM runtime libraries"
amove usr/lib
amove usr/share/gdcm*
}
sha512sums="
727beb50df893bfc1f693da918d9aafe92df0328dd9a80f074dea43c4f82608999f2aea5f970c5410512fd2791a7159762e5e0c83cc6295bd35465b26dd5f376 gdcm-3.0.24.tar.bz2
ddc67a7a0b41b2d6e1e03defb6fb8a06ceeb2e9dd9bb47dfa4f7283d79df7c1e52577b799c00e930719ae6cdda46bded9497a67b8241359f238f5366085ec9ee gdcmData.tar.gz
87fcf6ea8f6eb34e27bf2ecf5cbd4501092d1f936341dfcf75085780da75fab9be7809521d5cb00a6c4a9e512bfbe7de20233104b19fab245391632e409498a3 10-docbook4.patch
15520cd087ea401744d46a55e83eb307742ee4b94256476531b9f209be4ffaa2b0653d4ab8266b8c82282a52fceaa1f887d5fdebf83c1da0551c51335f74a08e 30-off_t.patch
3254dd27821f9239c0379d8f9ca577a6f2a7ff14b55701cca9fb0ac47568c24d1e681bc404f1d97a9ed8ee00f2a11701c7d53eee7186e5ce9f7ca8eca7834326 40-java.patch
da032530bd27b47ab4ec46652c4fcb65dda02ddeca4a3175f49cbf46efd43a1ff75b126475a694ce2df944e3970c67e378b1cf4db4cacf40d87bd999d37b4eed 50-use_copyright.patch
6994893b96069874bacc9285b994c7f93314b9570c7dd8b64ee51bb701fd5c8bd9892641e3b9d2d6f11fa4f2b7aebbbe25d72c1e689b5cccad34280f4c5199a5 60-fix_export_variables.patch
37514ff5c48e9ecbe9729229021adbbbbfa26c08df6a18b0e715a0a8f220ac0847c646ad091f9eb2f5b9026f5962599b35897057674a2807dd5cdcf4dd84d181 70-vtk9.3.0.patch
"