blob: 49bb3f2c2ed01b23c2a6479138835712d76744fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
# Maintainer: Butui Hu <hot123tea123@gmail.com>
_pkgname=ITK
pkgname=(itk-git python-itk-git)
_pkgver=5.4
pkgver=5.4.r56520.74296d2ddc
pkgrel=1
pkgdesc='An open-source, cross-platform library that provides developers with an extensive suite of software tools for image analysis'
arch=('x86_64')
url='https://www.itk.org'
license=('Apache-2.0')
depends=(
dcmtk
double-conversion
eigen
expat
fftw
gcc-libs
gdcm
glibc
hdf5
intel-oneapi-mkl
libjpeg-turbo
libpng
libtiff.so
# vxl
zlib
)
makedepends=(
castxml
cmake
gcc13
git
# gtest
python
subversion
swig
)
options=(!emptydirs)
source=("${_pkgname}::git+https://github.com/InsightSoftwareConsortium/ITK.git")
sha512sums=('SKIP')
pkgver() {
cd "${_pkgname}"
printf "%s.r%s.%s" "${_pkgver}" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
get_pyver() {
python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
}
prepare() {
# quick fix for building with swig < 4.3.0
find ${_pkgname} -type f -exec sed -i "s/SWIG_Py_DECREF/Py_DECREF/g" {} \;
find ${_pkgname} -type f -exec sed -i "s/SWIG_Py_INCREF/Py_INCREF/g" {} \;
}
build() {
# we build the default modules by default
# you could add additional modules by setting -DModule_<NAME>=ON
# set ITK_USE_SYSTEM_VXL=OFF due to conflicting file: /usr/lib/libvpl.so (owned by libvpl)
cmake_opts=(
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=OFF
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_COMPILER=g++-13
-DCMAKE_C_COMPILER=gcc-13
-DCMAKE_INSTALL_PREFIX=/usr
-DCMAKE_SKIP_INSTALL_RPATH=ON
-DCMAKE_SKIP_RPATH=ON
-DDO_NOT_BUILD_ITK_TEST_DRIVER=ON
-DITK_BUILD_DEFAULT_MODULES=ON
-DITK_LEGACY_REMOVE=ON
-DITK_USE_MKL=ON
-DITK_USE_SYSTEM_CASTXML=ON
-DITK_USE_SYSTEM_DCMTK=ON
-DITK_USE_SYSTEM_DOUBLECONVERSION=ON
-DITK_USE_SYSTEM_EIGEN=ON
-DITK_USE_SYSTEM_EXPAT=ON
-DITK_USE_SYSTEM_FFTW=ON
-DITK_USE_SYSTEM_GDCM=ON
-DITK_USE_SYSTEM_GOOGLETEST=OFF
-DITK_USE_SYSTEM_HDF5=ON
-DITK_USE_SYSTEM_JPEG=ON
-DITK_USE_SYSTEM_MINC=OFF
-DITK_USE_SYSTEM_PNG=ON
-DITK_USE_SYSTEM_SWIG=ON
-DITK_USE_SYSTEM_TIFF=ON
-DITK_USE_SYSTEM_VXL=OFF
-DITK_USE_SYSTEM_ZLIB=ON
-DITK_WRAP_IMAGE_DIMS="2;3;4"
-DITK_WRAP_PYTHON=ON
-DITK_WRAP_complex_double=ON
-DITK_WRAP_complex_float=ON
-DITK_WRAP_covariant_vector_double=ON
-DITK_WRAP_covariant_vector_float=ON
-DITK_WRAP_double=ON
-DITK_WRAP_float=ON
-DITK_WRAP_rgb_unsigned_char=ON
-DITK_WRAP_rgb_unsigned_short=ON
-DITK_WRAP_rgb_unsigned_short=ON
-DITK_WRAP_rgba_unsigned_char=ON
-DITK_WRAP_rgba_unsigned_short=ON
-DITK_WRAP_rgba_unsigned_short=ON
-DITK_WRAP_signed_char=ON
-DITK_WRAP_signed_long_long=ON
-DITK_WRAP_signed_short=ON
-DITK_WRAP_unsigned_char=ON
-DITK_WRAP_unsigned_long_long=ON
-DITK_WRAP_unsigned_short=ON
-DITK_WRAP_vector_double=ON
-DModule_GenericLabelInterpolator=ON
-DModule_ITKIODCMTK=ON
-DModule_ITKIOTransformMINC=ON
-DModule_ITKReview=ON
-DModule_MorphologicalContourInterpolation=ON
# -DModule_SimpleITKFilters=ON
)
cmake -B "build" -S "${srcdir}/${_pkgname}" \
${cmake_opts[@]} \
-DITK_USE_GPU=OFF
make -C "${srcdir}/build"
}
package_itk-git() {
provides=(itk=${_pkgver})
conflicts=(itk)
make -C "${srcdir}/build" DESTDIR="${pkgdir}" install
rm -rf "${pkgdir}/usr/lib/python$(get_pyver)"
}
package_python-itk-git() {
pkgdesc="${pkgdesc} (Python binding)"
depends+=(
itk
python-numpy
python-xarray
)
provides=(python-itk=${_pkgver})
conflicts=(python-itk)
make -C "${srcdir}/build" DESTDIR="${srcdir}/dist" install
install -dm755 "${pkgdir}/usr/lib"
cp -a "${srcdir}/dist/usr/lib/python$(get_pyver)" "${pkgdir}/usr/lib"
python -O -m compileall "${pkgdir}/usr/lib"
}
# vim:set ts=2 sw=2 et:
|