diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2024-05-31 09:51:25 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2024-05-31 09:51:55 +0300 |
commit | 7b6316fc05397413bc3d08cb6dd13ae23adb30ce (patch) | |
tree | 0391cd663fd66eeb9205c2e02dda37d95c246376 /sci-astronomy/sofa_c | |
parent | x11-themes/numix-icon-theme: drop 21.04.14 (diff) | |
download | gentoo-7b6316fc05397413bc3d08cb6dd13ae23adb30ce.tar.gz gentoo-7b6316fc05397413bc3d08cb6dd13ae23adb30ce.tar.bz2 gentoo-7b6316fc05397413bc3d08cb6dd13ae23adb30ce.zip |
sci-astronomy/sofa_c: add 20231011, EAPI=8
Closes: https://bugs.gentoo.org/794757
Closes: https://bugs.gentoo.org/924304
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'sci-astronomy/sofa_c')
-rw-r--r-- | sci-astronomy/sofa_c/Manifest | 1 | ||||
-rw-r--r-- | sci-astronomy/sofa_c/files/sofa_c-20231011-makefile.patch | 105 | ||||
-rw-r--r-- | sci-astronomy/sofa_c/sofa_c-20231011.ebuild | 37 |
3 files changed, 143 insertions, 0 deletions
diff --git a/sci-astronomy/sofa_c/Manifest b/sci-astronomy/sofa_c/Manifest index c35bfcf6b0ab..300957f6ed2b 100644 --- a/sci-astronomy/sofa_c/Manifest +++ b/sci-astronomy/sofa_c/Manifest @@ -1 +1,2 @@ DIST sofa_c-20170420.tar.gz 1780577 BLAKE2B 80912027893957345e080f02eed059f764970bbf6b89d6979c355a65d6d144edc8073b6a6436d11d36009eab05f5d9ccad0270a7feef117e576055be6d8489d5 SHA512 f2dd806243e3aec51ea03a54e10e533d4c3c1a69d032d5f3ddd7cd823a75aeed8033491c91366813b8d8e5c0b66e0fd582e6ede03aa7b136311fdd7a4ebf20d3 +DIST sofa_c-20231011.tar.gz 3055571 BLAKE2B 4a2771599af61f06cab76c83af8d8bac321258bd2145f7558be9a7afed3b5cefc13bea2a24d05f9a7481409e617f807f4e29173d87ab58a403808d43aae477a5 SHA512 8e7d67f7ac7a285a96160c96d16b1921ccb7a9324b83280b1594efcbbd7eb78c4d41898c1e5acfa5081842e4aeee15a96572d21b466bfda7ef7582c58624d376 diff --git a/sci-astronomy/sofa_c/files/sofa_c-20231011-makefile.patch b/sci-astronomy/sofa_c/files/sofa_c-20231011-makefile.patch new file mode 100644 index 000000000000..9e923db1604a --- /dev/null +++ b/sci-astronomy/sofa_c/files/sofa_c-20231011-makefile.patch @@ -0,0 +1,105 @@ +--- a/makefile ++++ b/makefile +@@ -49,7 +49,7 @@ + + # Specify the installation home directory. + +-INSTALL_DIR = $(HOME) ++INSTALL_DIR = $(DESTDIR)/usr + + # Specify the installation directory for the library. + +@@ -63,9 +63,9 @@ + # of your preferred C compiler (CCOMPC) and compilation flags (CFLAGF + # for functions, CFLAGX for executables) here. + +-CCOMPC = gcc +-CFLAGF = -c -pedantic -Wall -O +-CFLAGX = -pedantic -Wall -O ++CCOMPC = $(CC) ++CFLAGF = $(CPPFLAGS) -I. -c -fPIC $(CFLAGS) ++CFLAGX = $(CPPFLAGS) -I. $(CFLAGS) + + #----YOU SHOULDN'T HAVE TO MODIFY ANYTHING BELOW THIS LINE--------- + +@@ -80,6 +80,11 @@ + SOFA_LIB_NAME = libsofa_c.a + SOFA_LIB = $(SOFA_LIB_DIR)$(SOFA_LIB_NAME) + ++# Name the SOFA/C library in its source and target locations. ++ ++SOFA_SHLIB_NAME = libsofa_c.so ++SOFA_SHLIB = $(SOFA_LIB_DIR)$(SOFA_SHLIB_NAME) ++ + # Name the SOFA/C testbed in its source and target locations. + + SOFA_TEST_NAME = t_sofa_c.c +@@ -88,7 +93,7 @@ + # Name the SOFA/C includes in their source and target locations. + + SOFA_INC_NAMES = sofa.h sofam.h +-SOFA_INC = $(SOFA_INC_DIR)sofa.h $(SOFA_INC_DIR)sofam.h ++SOFA_INC = $(SOFA_INC_NAMES:%=$(SOFA_INC_DIR)%) + + # The list of SOFA/C library object files. + +@@ -347,28 +352,30 @@ + #----------------------------------------------------------------------- + + # Build (but do not install) the library. +-all : $(SOFA_LIB_NAME) ++all : $(SOFA_SHLIB_NAME) + -@ echo "" + -@ echo "*** Now type 'make test'" \ + " to install the library and run tests ***" + -@ echo "" + + # Install the library and header files. +-install $(SOFA_LIB) : $(INSTALL_DIRS) $(SOFA_LIB_NAME) $(SOFA_INC) +- cp $(SOFA_LIB_NAME) $(SOFA_LIB_DIR) ++install: $(INSTALL_DIRS) $(SOFA_SHLIB_NAME) $(SOFA_INC) ++ cp $(SOFA_SHLIB_NAME).0.0 $(SOFA_LIB_DIR) ++ ln -s $(SOFA_SHLIB_NAME).0.0 $(SOFA_SHLIB).0 ++ ln -s $(SOFA_SHLIB_NAME).0 $(SOFA_SHLIB) + + # Deinstall the library and header files. + uninstall: +- - $(RM) $(SOFA_LIB) $(SOFA_INC) ++ - $(RM) $(SOFA_LIB) $(SOFA_SHLIB)* $(SOFA_INC) + + # Test the build. +-check: $(SOFA_TEST_NAME) $(SOFA_INC_NAMES) $(SOFA_LIB_NAME) +- $(CCOMPC) $(CFLAGX) $(SOFA_TEST_NAME) $(SOFA_LIB_NAME) \ +- -I. -lm -o $(SOFA_TEST) +- ./$(SOFA_TEST) ++check: $(SOFA_TEST_NAME) $(SOFA_INC_NAMES) $(SOFA_SHLIB_NAME) ++ $(CCOMPC) $(CFLAGX) $(SOFA_TEST_NAME) $(SOFA_SHLIB_NAME).0.0 \ ++ -lm -o $(SOFA_TEST) ++ LD_LIBRARY_PATH="$${LD_LIBRARY_PATH}:." ./$(SOFA_TEST) + + # Test the installed library. +-installcheck test: $(SOFA_TEST_NAME) $(SOFA_INC) $(SOFA_LIB) ++installcheck: $(SOFA_TEST_NAME) $(SOFA_INC) $(SOFA_LIB) + $(CCOMPC) $(CFLAGX) $(SOFA_TEST_NAME) -I$(SOFA_INC_DIR) \ + -L$(SOFA_LIB_DIR) -lsofa_c -lm -o $(SOFA_TEST) + ./$(SOFA_TEST) +@@ -379,7 +386,7 @@ + + # Delete all generated binaries in the current directory. + realclean distclean : clean +- - $(RM) $(SOFA_LIB_NAME) $(SOFA_TEST) ++ - $(RM) $(SOFA_LIB_NAME) $(SOFA_SHLIB_NAME)* $(SOFA_TEST) + + # Create the installation directories if not already present. + $(INSTALL_DIRS): +@@ -389,6 +396,10 @@ + $(SOFA_LIB_NAME): $(SOFA_OBS) + ar ru $(SOFA_LIB_NAME) $? + ++$(SOFA_SHLIB_NAME): $(SOFA_OBS) ++ $(CC) $(LDFLAGS) -shared -Wl,-soname,$(SOFA_SHLIB_NAME).0 $? -lm -o $(SOFA_SHLIB_NAME).0.0 ++ ln -sfn $(SOFA_SHLIB_NAME).0.0 $(SOFA_SHLIB_NAME).0 ++ + # Install the header files. + $(SOFA_INC) : $(INSTALL_DIRS) $(SOFA_INC_NAMES) + cp $(SOFA_INC_NAMES) $(SOFA_INC_DIR) diff --git a/sci-astronomy/sofa_c/sofa_c-20231011.ebuild b/sci-astronomy/sofa_c/sofa_c-20231011.ebuild new file mode 100644 index 000000000000..fc542d499085 --- /dev/null +++ b/sci-astronomy/sofa_c/sofa_c-20231011.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +YYYY=${PV:0:4} +MMDD=${PV:4:4} +MYPV=${YYYY}${MMDD} + +DESCRIPTION="Library for algorithms for models in fundamental astronomy" +HOMEPAGE=" http://www.iausofa.org/current_C.html" +SRC_URI="http://www.iausofa.org/${YYYY}_${MMDD}_C/${PN}-${MYPV}.tar.gz" +S="${WORKDIR}/sofa/${MYPV}/c/src" + +LICENSE="SOFA" +SLOT=0 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="doc" + +PATCHES=( + "${FILESDIR}"/${P}-makefile.patch +) + +src_prepare() { + default + sed -e "s:/lib:/$(get_libdir):" -i makefile || die + tc-export CC +} + +src_install() { + emake DESTDIR="${ED}" install + cd .. + dodoc 00READ.ME + use doc && dodoc doc/*.lis doc/*.pdf +} |