diff options
author | V3n3RiX <venerix@koprulu.sector> | 2025-03-11 01:49:36 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2025-03-11 01:49:36 +0000 |
commit | cf7807d7aea23a99a144afceaba961cfed652b5f (patch) | |
tree | ffd2c781c27e0b7e72152a685a04938a2b7966f0 /sci-libs/cfitsio | |
parent | 7c5ebaf83da4c538dd11b56fdd5dfdf39dcbc096 (diff) |
Diffstat (limited to 'sci-libs/cfitsio')
-rw-r--r-- | sci-libs/cfitsio/Manifest | 2 | ||||
-rw-r--r-- | sci-libs/cfitsio/cfitsio-4.5.0-r1.ebuild | 73 | ||||
-rw-r--r-- | sci-libs/cfitsio/files/cfitsio-4.5.0-rename-nullptr.patch | 51 |
3 files changed, 126 insertions, 0 deletions
diff --git a/sci-libs/cfitsio/Manifest b/sci-libs/cfitsio/Manifest index c00ec013eba6..0d4ad980a2a3 100644 --- a/sci-libs/cfitsio/Manifest +++ b/sci-libs/cfitsio/Manifest @@ -1,3 +1,5 @@ +AUX cfitsio-4.5.0-rename-nullptr.patch 1818 BLAKE2B c4accd8ebd77efa7cba49d531822b2c91e4b083556410f6ac924bfa266a45274a7b92266a412e65c02868c5123a86aa6ebf297fe3bb16011b195702c17e0135d SHA512 95558623d93a8733d5407136ef11413d05ed3707ef71a755fa92754876b930935abb0e85e97dcf8ee81e95ed19afaf3147b2d255e4600d56869b4cfa446095c7 DIST cfitsio-4.5.0.tar.gz 4648097 BLAKE2B 5e0e09a3e6f43ce00bb5e5dd90e88c1aa2a873b407f3156147b064904ab341da219e69dc2a763e6b02eea0392a78e0ce74c15f921054bf72cac9b6e425765f99 SHA512 03746bf49cfcd97991be54f3e4dd51fb45c7b3a75f581dc6ab9ee5726a342dc11b651667807fd67e5318576d9b15e3580dd62ceab02fd684feff7ee6bb2edc7c +EBUILD cfitsio-4.5.0-r1.ebuild 1564 BLAKE2B dc25c9254e63fcca390b4b06e35704903521d774dc0edd9f3ef6696ba79a511537ff857d02421b65bc69d432e9f571ae49db32cee212a446fb6c501f2957fe59 SHA512 593758480da7280a11ec4cf091784727f69e61c0009f6e6d5a14cd19c45697b665024f716f3bb200a9787c50aa7b13ae3d6f1e0ee6b42561e340cb7f1011b526 EBUILD cfitsio-4.5.0.ebuild 1508 BLAKE2B 550442eed75e8fe7e01493b21a298481aea1d4e134a38dc2f91043cb5603bea515ca9ba29857e3ff4ba7362aa64a144852737c361ac2f8d89665011e9b7df780 SHA512 4c983f1098a573e09ccebca7351d3226e3cad83d16823320168ca4ce600e56761dc6c4a55f72b55541e6f49fbcec0c7b048752502e30f8841b383d4b0ac54390 MISC metadata.xml 1032 BLAKE2B 4479a1c6a42796e7effcc1b53ecc30d11e7302140cee2a34f7deaa1270497d0b0add85ddf1ce38223b357a9cac5f11af9039246f41228aca7d73653fd58a0fcf SHA512 ad32ecfbeceae8d768e9fa63386bdf89887d36ca18a68a72965b4f9206d779a26ece545d618540538246be5307c066e823ce55117208533cd9e668a6010222df diff --git a/sci-libs/cfitsio/cfitsio-4.5.0-r1.ebuild b/sci-libs/cfitsio/cfitsio-4.5.0-r1.ebuild new file mode 100644 index 000000000000..c50383b46670 --- /dev/null +++ b/sci-libs/cfitsio/cfitsio-4.5.0-r1.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake-multilib fortran-2 + +DESCRIPTION="C and Fortran library for manipulating FITS files" +HOMEPAGE="https://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html" +SRC_URI="https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/${P}.tar.gz" + +LICENSE="ISC" +SLOT="0/10-r1" +KEYWORDS="~alpha ~amd64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +IUSE="bzip2 curl test tools" +RESTRICT="!test? ( test )" + +BDEPEND=" + app-alternatives/yacc + app-alternatives/lex +" +RDEPEND=" + sys-libs/zlib[${MULTILIB_USEDEP}] + bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] ) + curl? ( net-misc/curl[${MULTILIB_USEDEP}] ) +" +# Bug #803350 +DEPEND=" + ${RDEPEND} + <dev-lang/cfortran-20110621 +" + +PATCHES=( "${FILESDIR}/${P}-rename-nullptr.patch" ) + +pkg_setup() { + fortran-2_pkg_setup +} + +src_prepare() { + cmake_src_prepare + + # fix libdir + sed -e 's:lib/::' -i CMakeLists.txt || die + + # Avoid internal cfortran + rm cfortran.h || die +} + +multilib_src_configure() { + local libdir=$(get_libdir) + local mycmakeargs=( + # used for .pc file + -DLIB_SUFFIX=${libdir#lib} + + -DUSE_BZIP2=$(usex bzip2) + -DUSE_CURL=$(usex curl) + -DUSE_PTHREADS=ON + # just appending CFLAGS + -DUSE_SSE2=OFF + -DUSE_SSSE3=OFF + + -DTESTS=$(usex test) + -DUTILS=$(multilib_native_usex tools) + ) + cmake_src_configure +} + +multilib_src_install_all() { + dodoc README.md docs/*.pdf + + docinto examples + dodoc utilities/{cookbook.{c,f},testprog.c,testf77.f,speed.c,smem.c} +} diff --git a/sci-libs/cfitsio/files/cfitsio-4.5.0-rename-nullptr.patch b/sci-libs/cfitsio/files/cfitsio-4.5.0-rename-nullptr.patch new file mode 100644 index 000000000000..6281d7f7e324 --- /dev/null +++ b/sci-libs/cfitsio/files/cfitsio-4.5.0-rename-nullptr.patch @@ -0,0 +1,51 @@ +Nullptr is reserved keyword in C23. Rename to something that describes usage better +https://bugs.gentoo.org/944747 +--- a/putcol.c ++++ b/putcol.c +@@ -1226,7 +1226,7 @@ + long rept, rowrept, width, tnull, naxes[9] = {1,1,1,1,1,1,1,1,1}, groups; + double zeros = 0.; + char message[FLEN_ERRMSG], keyname[FLEN_KEYWORD], nullstr[FLEN_VALUE]; +- char **stringptr, *nullptr, *cptr; ++ char **stringptr, *ptr_to_null, *cptr; + + if (*status > 0) + return(*status); +@@ -2081,24 +2081,24 @@ + { + stringptr = cols[jj].array; + dataptr = stringptr + 1; +- nullptr = *stringptr; ++ ptr_to_null = *stringptr; + nbytes = 2; + } + else + { + dataptr = (char *) cols[jj].array + col[jj].nullsize; +- nullptr = (char *) cols[jj].array; ++ ptr_to_null = (char *) cols[jj].array; + nbytes = col[jj].nullsize; + } + +- if (memcmp(nullptr, &zeros, nbytes) ) ++ if (memcmp(ptr_to_null, &zeros, nbytes) ) + { + /* null value flag not zero; must check for and write nulls */ + if (hdutype == IMAGE_HDU) + { + if (ffppn(cols[jj].fptr, cols[jj].datatype, + felement, cols[jj].repeat * ntodo, dataptr, +- nullptr, &tstatus) > 0) ++ ptr_to_null, &tstatus) > 0) + break; + } + else +@@ -2113,7 +2113,7 @@ + + if (ffpcn(cols[jj].fptr, cols[jj].datatype, cols[jj].colnum, frow, + felement, cols[jj].repeat * ntodo, dataptr, +- nullptr, &tstatus) > 0) ++ ptr_to_null, &tstatus) > 0) + break; + } + } |