forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- bumped java version - no longer installs into /usr/CDFLeapSeconds.txt - no longer calls CC directly - restricted bindist Closes: https://bugs.gentoo.org/786708 Closes: https://bugs.gentoo.org/773076 Closes: https://bugs.gentoo.org/633438 Closes: https://bugs.gentoo.org/544588 Closes: https://bugs.gentoo.org/544588 Closes: https://bugs.gentoo.org/731932 Closes: https://bugs.gentoo.org/695390 Package-Manager: Portage-3.0.19, Repoman-3.0.3 Signed-off-by: Andrew Ammerlaan <[email protected]>
- Loading branch information
1 parent
95b4e38
commit a33ab5b
Showing
4 changed files
with
239 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
# Copyright 1999-2021 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=7 | ||
|
||
inherit java-pkg-opt-2 multilib toolchain-funcs | ||
|
||
MY_DP="${PN}$(ver_cut 1)$(ver_cut 2)" | ||
MY_P="${MY_DP}_$(ver_cut 3)" | ||
|
||
DESCRIPTION="Common Data Format I/O library for multi-dimensional data sets" | ||
HOMEPAGE="https://cdf.gsfc.nasa.gov" | ||
SRC_BASE="https://spdf.gsfc.nasa.gov/pub/software/${PN}/dist/${MY_P}/unix/" | ||
|
||
SRC_URI="${SRC_BASE}/${MY_P}-dist-${PN}.tar.gz | ||
java? ( ${SRC_BASE}/${MY_P}-dist-java.tar.gz ) | ||
doc? ( | ||
${SRC_BASE}/${MY_DP}_documentation/${MY_DP}ifd.pdf | ||
${SRC_BASE}/${MY_DP}_documentation/${MY_DP}0crm.pdf | ||
${SRC_BASE}/${MY_DP}_documentation/${MY_DP}0csrm.pdf | ||
${SRC_BASE}/${MY_DP}_documentation/${MY_DP}0frm.pdf | ||
${SRC_BASE}/${MY_DP}_documentation/${MY_DP}0prm.pdf | ||
${SRC_BASE}/${MY_DP}_documentation/${MY_DP}0ug.pdf | ||
${SRC_BASE}/${MY_DP}_documentation/${MY_DP}0vbrm.pdf | ||
)" | ||
|
||
LICENSE="CDF" | ||
SLOT="0" | ||
KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux" | ||
IUSE="doc examples java ncurses static-libs" | ||
RESTRICT="bindist" | ||
|
||
RDEPEND=" | ||
java? ( >=virtual/jre-1.8:= ) | ||
ncurses? ( sys-libs/ncurses:0= ) | ||
" | ||
DEPEND=" | ||
${RDEPEND} | ||
ncurses? ( virtual/pkgconfig ) | ||
" | ||
|
||
S="${WORKDIR}/${MY_P}-dist" | ||
|
||
# respect cflags, ldflags, soname | ||
PATCHES=( | ||
"${FILESDIR}"/${P}-respect-flags.patch | ||
) | ||
|
||
src_prepare() { | ||
default | ||
|
||
# use proper lib dir | ||
sed -i \ | ||
-e "s:\$(INSTALLDIR)/lib:\$(INSTALLDIR)/$(get_libdir):g" \ | ||
Makefile || die "sed failed" | ||
} | ||
|
||
src_compile() { | ||
PV_SO=${PV:0:1} | ||
emake \ | ||
OS=linux \ | ||
CC=$(tc-getCC) \ | ||
ENV=gnu \ | ||
SHARED=yes \ | ||
SHAREDEXT_linux=so.${PV_SO} \ | ||
CURSESLIB_linux_gnu="$(usex ncurses "$($(tc-getPKG_CONFIG) --libs ncurses)" "")" \ | ||
CURSES=$(usex ncurses) \ | ||
${myconf} \ | ||
all | ||
|
||
if use java; then | ||
export CDF_BASE="${S}" | ||
export CDF_LIB="${S}/src/lib" | ||
cd cdfjava/jni | ||
$(tc-getCC) \ | ||
${CFLAGS} -fPIC \ | ||
-I${CDF_BASE}/src/include \ | ||
-I$(java-config -O)/include \ | ||
-I$(java-config -O)/include/linux \ | ||
-c cdfNativeLibrary.c \ | ||
-o cdfNativeLibrary.o \ | ||
|| die "compiling java lib failed" | ||
$(tc-getCC) \ | ||
${LDFLAGS} \ | ||
-shared cdfNativeLibrary.o \ | ||
-Wl,-soname=libcdfNativeLibrary.so.${PV_SO} \ | ||
-L${CDF_LIB} -lcdf -lm \ | ||
-o libcdfNativeLibrary.so.${PV_SO} \ | ||
|| die "linking java lib failed" | ||
fi | ||
} | ||
|
||
src_test() { | ||
emake -j1 test | ||
} | ||
|
||
src_install() { | ||
dodir /usr/bin /usr/$(get_libdir) | ||
# -j1 (fragile non-autotooled make) | ||
emake -j1 \ | ||
INSTALLDIR="${ED}/usr" \ | ||
SHAREDEXT=so.${PV_SO} \ | ||
install | ||
dosym libcdf.so.${PV_SO} /usr/$(get_libdir)/libcdf.so | ||
use static-libs || rm "${ED}"/usr/$(get_libdir)/libcdf.a | ||
dodoc Release.notes CHANGES.txt Welcome.txt | ||
doenvd "${FILESDIR}"/50cdf | ||
|
||
if use doc; then | ||
dodoc "${DISTDIR}"/${MY_DP}{0{crm,csrm,frm,prm,ug,vbrm},ifd}.pdf | ||
fi | ||
|
||
if use examples; then | ||
docinto /usr/share/doc/${PF}/examples | ||
dodoc samples/* | ||
fi | ||
|
||
if use java; then | ||
cd cdfjava || die | ||
dolib.so jni/libcdfNativeLibrary.so.${PV_SO} | ||
dosym libcdfNativeLibrary.so.${PV_SO} \ | ||
/usr/$(get_libdir)/libcdfNativeLibrary.so | ||
java-pkg_dojar */*.jar | ||
if use examples; then | ||
docinto /usr/share/doc/${PF}/examples/java | ||
dodoc examples/* | ||
fi | ||
fi | ||
|
||
# move this to a better location | ||
dodir "/usr/share/${PF}" | ||
mv "${ED}/usr/CDFLeapSeconds.txt" "${ED}/usr/share/${PF}/" || die | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
diff --git a/Makefile b/Makefile | ||
index 9857fa9..6dc0953 100644 | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -896,7 +896,7 @@ install.tools: create.bin copy.tools | ||
install.help_: create.help copy.help | ||
|
||
install.lib: create.lib copy.lib.a | ||
- @if [ -f $(LIBsrcDIR)/libcdf.so ] ; then \ | ||
+ @if [ -f $(LIBsrcDIR)/libcdf.$(SHAREDEXT) ] ; then \ | ||
$(MAKE) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIR)" install.lib.so ; \ | ||
else \ | ||
$(NULL) ; \ | ||
@@ -1010,10 +1010,10 @@ copy.include: | ||
cp $(INCsrcDIR)/cdfconfig.h $(INSTALLDIR)/include | ||
|
||
copy.lib.so: | ||
- @echo cp $(LIBsrcDIR)/libcdf.so $(INSTALLDIR)/lib | ||
- cp $(LIBsrcDIR)/libcdf.so $(INSTALLDIR)/lib/libcdf.$(VERSION).so | ||
- rm -f $(INSTALLDIR)/lib/libcdf.so | ||
- cd $(INSTALLDIR)/lib && ln -s libcdf.$(VERSION).so libcdf.so | ||
+ @echo cp $(LIBsrcDIR)/libcdf.$(SHAREDEXT) $(INSTALLDIR)/lib | ||
+ cp $(LIBsrcDIR)/libcdf.$(SHAREDEXT) $(INSTALLDIR)/lib/libcdf.$(VERSION).so | ||
+ rm -f $(INSTALLDIR)/lib/libcdf.$(SHAREDEXT) | ||
+ cd $(INSTALLDIR)/lib && ln -s libcdf.$(VERSION).so libcdf.$(SHAREDEXT) | ||
|
||
copy.lib.sl: | ||
@echo cp $(LIBsrcDIR)/libcdf.sl $(INSTALLDIR)/lib | ||
diff --git a/src/lib/Makefile b/src/lib/Makefile | ||
index 2017c46..b666ce3 100644 | ||
--- a/src/lib/Makefile | ||
+++ b/src/lib/Makefile | ||
@@ -62,9 +62,9 @@ AR=ar | ||
RANLIBcmd=ranlib | ||
MACos=Darwin | ||
|
||
-CFLAGS=$(COPTIONS) $(PIC) -I$(INCLUDEcdf) -I$(ZlibDIR) | ||
+CFLAGS+=$(COPTIONS) $(PIC) -I$(INCLUDEcdf) -I$(ZlibDIR) | ||
CFLAGS2=-DZ_PREFIX | ||
-LDFLAGS=$(LDOPTIONS) | ||
+LDFLAGS+=$(LDOPTIONS) | ||
ARFLAGS=$(AROPTIONS) | ||
ZLIB=zlib | ||
|
||
@@ -120,13 +120,13 @@ ranlib.yes: | ||
|
||
shared.yes: libcdf.$(SHAREDEXT) | ||
|
||
-libcdf.so \ | ||
+libcdf.$(SHAREDEXT) \ | ||
libcdf.dylib \ | ||
libcdf.dll \ | ||
libcdf.sl: $(OBJs) | ||
@if [ -f $@ ] ; then rm $@ ; else $(NULL) ; fi | ||
- @echo $(LD) $(LDFLAGS) -o $@ $(OBJs) $(SYSLIBS) | ||
- $(LD) $(LDFLAGS) -o $@ $(OBJs) $(SYSLIBS) | ||
+ @echo $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,libcdf.$(SHAREDEXT) -o $@ $(OBJs) $(SYSLIBS) | ||
+ $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,libcdf.$(SHAREDEXT) -o $@ $(OBJs) $(SYSLIBS) | ||
# @if [ $(MACVERSION) -gt 0 ]; then \ | ||
# rm -f $(MACLIB)/$@; \ | ||
# cp $@ $(MACLIB)/libcdf.$(VERSION).dylib; \ | ||
@@ -134,8 +134,8 @@ libcdf.sl: $(OBJs) | ||
# fi | ||
|
||
libcdf.o: $(OBJs) | ||
- @echo $(CC) $(LDFLAGS) -o $@ $(OBJs) $(SYSLIBS) | ||
- $(CC) $(LDFLAGS) -o $@ $(OBJs) $(SYSLIBS) | ||
+ @echo $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJs) $(SYSLIBS) | ||
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJs) $(SYSLIBS) | ||
|
||
.c.o: | ||
@if [ "$<" = "cdfgzip.c" ] || [ "$<" = "cdfgzip64.c" ] ; then \ | ||
diff --git a/src/tools/Makefile b/src/tools/Makefile | ||
index bac4ca0..ef44264 100644 | ||
--- a/src/tools/Makefile | ||
+++ b/src/tools/Makefile | ||
@@ -33,7 +33,7 @@ | ||
SHELL=/bin/sh | ||
|
||
CURSES=yes | ||
-CCx=gcc | ||
+CCx=$(CC) | ||
COPTIONS=-I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2 | ||
COPTIONSld= | ||
SYSLIBS=-lgcc | ||
@@ -43,8 +43,8 @@ MAKE=make | ||
INCLUDEcdf= ../include | ||
|
||
CC=$(CCx) | ||
-CFLAGS=$(COPTIONS) -I$(INCLUDEcdf) | ||
-CFLAGSld=$(COPTIONSld) | ||
+CFLAGS+=$(COPTIONS) -I$(INCLUDEcdf) | ||
+CFLAGSld=$(COPTIONSld) $(LDFLAGS) | ||
|
||
WHICHOS=$(shell uname -a | cut -f1 -d" ") | ||
ifeq ("$(WHICHOS)","Darwin") |