Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/cfitsio/, sci-libs/cfitsio/files/
Date: Sun, 29 Jan 2023 16:31:31
Message-Id: 1675009781.7221fe6d2b5ca1124f8616cd99ef44b49230ae43.andrewammerlaan@gentoo
1 commit: 7221fe6d2b5ca1124f8616cd99ef44b49230ae43
2 Author: Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
3 AuthorDate: Wed Dec 14 22:43:29 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 29 16:29:41 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7221fe6d
7
8 sci-libs/cfitsio: add 4.2.0
9
10 Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
11 Closes: https://github.com/gentoo/gentoo/pull/28666
12 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
13
14 sci-libs/cfitsio/Manifest | 1 +
15 sci-libs/cfitsio/cfitsio-4.2.0.ebuild | 87 ++++++++++++++++++++++
16 .../cfitsio/files/cfitsio-4.2.0-pkgconfig.patch | 19 +++++
17 .../cfitsio/files/cfitsio-4.2.0-system-zlib.patch | 53 +++++++++++++
18 4 files changed, 160 insertions(+)
19
20 diff --git a/sci-libs/cfitsio/Manifest b/sci-libs/cfitsio/Manifest
21 index 2482f16f036b..64031fa708e5 100644
22 --- a/sci-libs/cfitsio/Manifest
23 +++ b/sci-libs/cfitsio/Manifest
24 @@ -1,3 +1,4 @@
25 DIST cfitsio-3.49.tar.gz 4934662 BLAKE2B ca8b701f0fec399d989efb61fdaa2bfbf49d0eea2d3ff47e156757c5a99bc77c23a1b91b4c91166696293c71c78210065dc48d0bb3c77039815f326d0ed55f0a SHA512 9836a4af3bbbfed1ea1b4c70b9d500ac485d7c3d8131eb8a25ee6ef6662f46ba52b5161c45c709ed9a601ff0e9ec36daa5650eaaf4f2cc7d6f4bb5640f10da15
26 DIST cfitsio-4.0.0.tar.gz 4746177 BLAKE2B a43a21d29522cac84294e81ad5f0a45839c21c2fafcbde42504670e73757a41ebd91e42d086529df8139ce920446332f827b1abf027f8932ee73dd025103cd8e SHA512 a5b20bd6ad648450e99167f63813cc7523347aadfc9f85d2c0ed3ba7e4516b3bb6bc0851f209268f2cb045cdacc43a3da9e4506af4581f806ab9f4de248065fa
27 DIST cfitsio-4.1.0.tar.gz 4305184 BLAKE2B 1edfce2b44ab990ed834b22dfc734af632f8f1401b6616f0c4322a3c40117123e52ba191610a3393c077f4a5fccd7462bcb4749e715cf2e9abae08edb1f1f8eb SHA512 bbbe10e890e74a30a9806dd2bbf711b3b1f15502b210b222d2d57cc083495c3b66b44927e4680f989045187fb7075f7187e2805ddcb4753ce53c68c3442cc813
28 +DIST cfitsio-4.2.0.tar.gz 4356372 BLAKE2B 7f5e695a56105866b2457e0f1c2d74bfb2aa86bc53e4eeb39aa9b8e79b278e1184a610422bf43c341a9f3159a93b980bab1ec9084475189b08dfa080b59ec2af SHA512 41b51653370874f50a7a9fe7d5f61577a979ab9d146b8249afa407d3858cb4dce0581eba23093972b66f7d1042b9693b98ad9130ec67b3b44e94005e72d60853
29
30 diff --git a/sci-libs/cfitsio/cfitsio-4.2.0.ebuild b/sci-libs/cfitsio/cfitsio-4.2.0.ebuild
31 new file mode 100644
32 index 000000000000..f3ec0c5b3190
33 --- /dev/null
34 +++ b/sci-libs/cfitsio/cfitsio-4.2.0.ebuild
35 @@ -0,0 +1,87 @@
36 +# Copyright 1999-2023 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=8
40 +
41 +inherit fortran-2 multilib-minimal
42 +
43 +DESCRIPTION="C and Fortran library for manipulating FITS files"
44 +HOMEPAGE="https://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html"
45 +SRC_URI="https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/${P}.tar.gz"
46 +
47 +LICENSE="ISC"
48 +SLOT="0/10"
49 +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris"
50 +IUSE="bzip2 curl threads tools cpu_flags_x86_sse2 cpu_flags_x86_ssse3"
51 +
52 +BDEPEND="
53 + sys-devel/bison
54 + sys-devel/flex
55 +"
56 +RDEPEND="
57 + sys-libs/zlib[${MULTILIB_USEDEP}]
58 + bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
59 + curl? ( net-misc/curl[${MULTILIB_USEDEP}] )
60 +"
61 +# Bug #803350
62 +DEPEND="${RDEPEND}
63 + <dev-lang/cfortran-20110621
64 +"
65 +
66 +PATCHES=(
67 + "${FILESDIR}/${PN}-3.490-ldflags.patch"
68 + "${FILESDIR}/${P}-system-zlib.patch"
69 + "${FILESDIR}/${P}-pkgconfig.patch"
70 +)
71 +
72 +pkg_setup() {
73 + fortran-2_pkg_setup
74 +}
75 +
76 +src_prepare() {
77 + default
78 +
79 + # Avoid internal cfortran
80 + mv cfortran.h cfortran.h.disabled || die
81 + ln -s "${EPREFIX}"/usr/include/cfortran.h . || die
82 +
83 + multilib_copy_sources
84 +}
85 +
86 +multilib_src_configure() {
87 + local myeconfargs=(
88 + $(use_with bzip2)
89 + $(use_enable curl)
90 + $(use_enable threads reentrant)
91 + $(use_enable cpu_flags_x86_sse2 sse2)
92 + $(use_enable cpu_flags_x86_ssse3 ssse3)
93 + )
94 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
95 +}
96 +
97 +multilib_src_compile() {
98 + default
99 +
100 + if use tools ; then
101 + emake utils
102 + fi
103 +}
104 +
105 +multilib_src_install_all() {
106 + dodoc README docs/changes.txt
107 +
108 + dodoc docs/{quick,cfitsio,fpackguide}.pdf
109 + dodoc docs/fitsio.pdf
110 +
111 + docinto examples
112 + dodoc cookbook.c testprog.c speed.c smem.c
113 + dodoc cookbook.f testf77.f
114 +
115 + # https://bugs.gentoo.org/855191
116 + if use tools; then
117 + rm "${ED}/usr/bin/smem" || die
118 + fi
119 +
120 + # Remove static libs
121 + find "${ED}" -name '*.a' -delete || die
122 +}
123
124 diff --git a/sci-libs/cfitsio/files/cfitsio-4.2.0-pkgconfig.patch b/sci-libs/cfitsio/files/cfitsio-4.2.0-pkgconfig.patch
125 new file mode 100644
126 index 000000000000..9ec614616552
127 --- /dev/null
128 +++ b/sci-libs/cfitsio/files/cfitsio-4.2.0-pkgconfig.patch
129 @@ -0,0 +1,19 @@
130 +diff -Naur a/cfitsio.pc.cmake b/cfitsio.pc.cmake
131 +--- a/cfitsio.pc.cmake 2022-10-31 19:40:23.000000000 +0100
132 ++++ b/cfitsio.pc.cmake 2022-12-14 23:35:53.572102437 +0100
133 +@@ -1,12 +1,12 @@
134 + prefix=@CMAKE_INSTALL_PREFIX@
135 + exec_prefix=@CMAKE_INSTALL_PREFIX@
136 + libdir=@LIB_DESTINATION@
137 +-includedir=@INCLUDE_INSTALL_DIR@
138 ++includedir=@INCLUDE_INSTALL_DIR@/cfitsio
139 +
140 + Name: cfitsio
141 + Description: FITS File Subroutine Library
142 + URL: https://heasarc.gsfc.nasa.gov/fitsio/
143 + Version: @CFITSIO_MAJOR@.@CFITSIO_MINOR@.@CFITSIO_MICRO@
144 + Libs: -L${libdir} -lcfitsio
145 +-Libs.private: @PKG_CONFIG_LIBS@ -lm
146 +-Cflags: -I${includedir}
147 ++Libs.private: @PKG_CONFIG_LIBS@ -lm -z
148 ++Cflags: -D_REENTRANT -I${includedir}
149
150 diff --git a/sci-libs/cfitsio/files/cfitsio-4.2.0-system-zlib.patch b/sci-libs/cfitsio/files/cfitsio-4.2.0-system-zlib.patch
151 new file mode 100644
152 index 000000000000..fab375507f83
153 --- /dev/null
154 +++ b/sci-libs/cfitsio/files/cfitsio-4.2.0-system-zlib.patch
155 @@ -0,0 +1,53 @@
156 +diff -Naur a/Makefile.in b/Makefile.in
157 +--- a/Makefile.in 2022-10-31 19:40:23.000000000 +0100
158 ++++ b/Makefile.in 2022-12-14 23:37:10.785099554 +0100
159 +@@ -102,7 +102,7 @@
160 + shared: lib${PACKAGE}${SHLIB_SUFFIX}
161 +
162 + lib${PACKAGE}${SHLIB_SUFFIX}: ${OBJECTS}
163 +- ${SHLIB_LD} ${LDFLAGS} -o ${CFITSIO_SHLIB} ${OBJECTS} -lm ${LIBS_CURL} ${LIBS}
164 ++ ${SHLIB_LD} ${LDFLAGS} -o ${CFITSIO_SHLIB} ${OBJECTS} -lm -lz -lbz2 ${LIBS_CURL} ${LIBS}
165 + @if [ "x${CFITSIO_SHLIB_SONAME}" != x ]; then \
166 + ln -sf ${CFITSIO_SHLIB} ${CFITSIO_SHLIB_SONAME}; \
167 + ln -sf ${CFITSIO_SHLIB_SONAME} $@; \
168 +@@ -142,31 +142,31 @@
169 + ${CC} -c ${CFLAGS} ${CPPFLAGS} ${SSE_FLAGS} ${DEFS} $<
170 +
171 + smem: smem.o lib${PACKAGE}.a ${OBJECTS}
172 +- ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm
173 ++ ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm -lz
174 +
175 + testprog: testprog.o lib${PACKAGE}.a ${OBJECTS}
176 +- ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
177 ++ ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm -lz ${LIBS}
178 +
179 + fpack: fpack.o fpackutil.o lib${PACKAGE}.a ${OBJECTS}
180 +- ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o fpackutil.o -L. -l${PACKAGE} -lm ${LIBS}
181 ++ ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o fpackutil.o -L. -l${PACKAGE} -lm -lz ${LIBS}
182 +
183 + funpack: funpack.o fpackutil.o lib${PACKAGE}.a ${OBJECTS}
184 +- ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o fpackutil.o -L. -l${PACKAGE} -lm ${LIBS}
185 ++ ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o fpackutil.o -L. -l${PACKAGE} -lm -lz ${LIBS}
186 +
187 + fitscopy: fitscopy.o lib${PACKAGE}.a ${OBJECTS}
188 +- ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
189 ++ ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm -lz ${LIBS}
190 +
191 + speed: speed.o lib${PACKAGE}.a ${OBJECTS}
192 +- ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
193 ++ ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm -lz ${LIBS}
194 +
195 + imcopy: imcopy.o lib${PACKAGE}.a ${OBJECTS}
196 +- ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
197 ++ ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm -lz ${LIBS}
198 +
199 + cookbook: cookbook.o lib${PACKAGE}.a ${OBJECTS}
200 +- ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
201 ++ ${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm -lz ${LIBS}
202 +
203 + testf77: testf77.o lib${PACKAGE}.a ${OBJECTS}
204 +- ${FC} ${LDFLAGS_BIN} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
205 ++ ${FC} ${LDFLAGS_BIN} -o $@ ${@}.o -L. -l${PACKAGE} -lm -lz ${LIBS}
206 +
207 + # Tested with bison 3.8 and flex 2.6.4
208 + eval: # Rebuild eval_* files from flex/bison source