commit:     47f4d9277737e9d5b7df8d38fa5ea03530712d29
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Fri Apr  4 22:40:06 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May  4 06:16:55 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47f4d927

sci-astronomy/xephem: add 4.2.0

Closes: https://bugs.gentoo.org/944468
Closes: https://bugs.gentoo.org/944933
Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Part-of: https://github.com/gentoo/gentoo/pull/41459
Closes: https://github.com/gentoo/gentoo/pull/41459
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-astronomy/xephem/Manifest                      |   1 +
 .../files/xephem-4.2.0-respect_env_vars.patch      | 120 +++++++++++++++++++++
 sci-astronomy/xephem/xephem-4.2.0.ebuild           |  67 ++++++++++++
 3 files changed, 188 insertions(+)

diff --git a/sci-astronomy/xephem/Manifest b/sci-astronomy/xephem/Manifest
index cf3451a46e1a..b1707b70c6c5 100644
--- a/sci-astronomy/xephem/Manifest
+++ b/sci-astronomy/xephem/Manifest
@@ -1 +1,2 @@
 DIST xephem-4.1.0.tar.gz 17213750 BLAKE2B 
921aa4b305cb80df5746db962739d16ee23f1831b59934389ecd218b874ba1fc51aab07896d1283760db1a50be6279da50ed112320fc481f90b4f2d6e25c96dc
 SHA512 
bcad3a6b375cabf1f44e39bc99386552d97a7e7d2ee4063dae4ccd3d5842604f0efc3407447f18a5c9e7f265bab6eebe98bdb64626dcf2135b56f346818ef1b6
+DIST xephem-4.2.0.tar.gz 17317398 BLAKE2B 
9a77e976ad867e90e6d7fa1bb68759cc2c3c860187aa6f9a4768bcc53ae93a6fb699cf55d07bc1237603d42d0ac6de712cf87724af9cb3923237892f1aa4d2e2
 SHA512 
97756bc299821e95cbc06facc3091795feb245db033193fdf587bcfd7a83142a15552a1f8aa53c040c87cb75021424b94bbed5a747fb9783f5a0cac6fb4ddb3e

diff --git a/sci-astronomy/xephem/files/xephem-4.2.0-respect_env_vars.patch 
b/sci-astronomy/xephem/files/xephem-4.2.0-respect_env_vars.patch
new file mode 100644
index 000000000000..8fa55502ff4b
--- /dev/null
+++ b/sci-astronomy/xephem/files/xephem-4.2.0-respect_env_vars.patch
@@ -0,0 +1,120 @@
+--- a/GUI/xephem/Makefile
++++ b/GUI/xephem/Makefile
+@@ -9,9 +9,9 @@
+ # one executable, xephem.
+ 
+ # These -I and -L flags point to the supporting XEphem libraries
+-LIBINC = -I../../libastro -I../../libip -I../../liblilxml -I../../libjpegd 
-I../../libpng -I../../libz
+-LIBLNK = -L../../libastro -L../../libip -L../../liblilxml -L../../libjpegd 
-L../../libpng -L../../libz
+-LIBLIB = -lastro -lip -llilxml -ljpegd -lpng -lz
++LIBINC = -I../../libastro -I../libastro -I../../libip -I../libip 
-I../../liblilxml -I../liblilxml
++LIBLNK = -L../../libastro -L../libastro -L../../libip -L../libip 
-L../../liblilxml -L../liblilxml
++LIBLIB = -lastro -lip -llilxml -ljpeg -lpng -lz
+ 
+ # MOTIFI is the directory containing the Xm directory of include files.
+ # MOTIFL is the directory containing the libXm.a library.
+@@ -36,12 +36,9 @@ ifeq ($(UNAME_S),Darwin)
+   PLATL = -L/usr/local/opt/openssl@3/lib -L/opt/X11/lib
+ endif
+ 
+-CC = gcc
+-CLDFLAGS = -g
+-CFLAGS = $(LIBINC) $(CLDFLAGS) -O2 -Wall -I$(MOTIFI) $(PLATI)
+-LDFLAGS = $(LIBLNK) $(CLDFLAGS) -L$(MOTIFL) $(PLATL)
+ XLIBS = -lXm -lXt -lXext -lXmu -lX11
+-LIBS = $(XLIBS) $(LIBLIB) -lm -lssl
++CFLAGS := $(LIBINC) $(CFLAGS)
++LIBS = $(LIBLNK) $(XLIBS) $(LIBLIB) -lm -lssl
+ 
+ # static linking on Apple using X11 libs from ports
+ # CC = gcc
+@@ -201,12 +198,9 @@ xephem.1: xephem.man
+       nroff -man $? > $@
+ 
+ libs:
+-      cd ../../libastro; make
+-      cd ../../libip; make
+-      cd ../../libjpegd; make
+-      cd ../../liblilxml; make
+-      cd ../../libpng; make
+-      cd ../../libz; make
++      $(MAKE) -C ../../libastro
++      $(MAKE) -C ../../libip
++      $(MAKE) -C ../../liblilxml
+ 
+ clean:
+       rm -fr *.o ../../lib*/*.[ao]
+--- a/libastro/Makefile
++++ b/libastro/Makefile
+@@ -4,8 +4,6 @@
+ # compiler and flags
+ 
+ # gcc
+-CC = gcc
+-CFLAGS= -O2 -Wall
+ 
+ # macosx universal binary
+ # CFLAGS= -O2 -Wall -arch i386 -arch ppc
+@@ -83,11 +81,11 @@ OBJS =                     \
+       vsop87_data.o
+ 
+ libastro.a: $(HS) $(OBJS)
+-      ar rv $@ $(OBJS)
+-      ranlib $@
++      $(AR) rv $@ $(OBJS)
++      $(RANLIB) $@
+ 
+ libastro.so: $(HS) $(OBJS)
+-      $(CC) -shared -o $@ $(OBJS)
++      $(CC) $(LDFLAGS) -shared -o $@ $(OBJS)
+ 
+ clobber:
+       rm -f *.o libastro.a
+--- a/libip/Makefile
++++ b/libip/Makefile
+@@ -2,8 +2,6 @@
+ # (C) 2001 Elwood Charles Downey
+ 
+ # gcc
+-CC = gcc
+-CFLAGS= -I../libastro -O2 -Wall
+ 
+ # macosx universal binary
+ # CFLAGS= -I../libastro -O2 -Wall -arch i386 -arch ppc
+@@ -36,11 +34,11 @@ OBJS =     \
+ HS = ip.h fsmatch.h
+ 
+ libip.a: $(HS)        $(OBJS)
+-      ar rv $@ $(OBJS)
+-      ranlib $@
++      $(AR) rv $@ $(OBJS)
++      $(RANLIB) $@
+ 
+ libip.so:    $(OBJS)
+-      gcc -shared -o $@ $(OBJS)
++      $(CC) $(LDFLAGS) -shared -o $@ $(OBJS)
+ 
+ clobber:
+       rm -f *.o libip.a
+--- a/liblilxml/Makefile
++++ b/liblilxml/Makefile
+@@ -4,8 +4,6 @@
+ # compiler and flags
+ 
+ # gcc
+-CC = gcc
+-CFLAGS= -O2 -Wall
+ 
+ # macosx universal binary
+ # CFLAGS= -O2 -Wall -arch i386 -arch ppc
+@@ -27,8 +25,8 @@ HS = lilxml.h
+ OBJS = lilxml.o base64.o
+ 
+ liblilxml.a: $(HS) $(OBJS)
+-      ar r $@ $(OBJS)
+-      ranlib $@
++      $(AR) r $@ $(OBJS)
++      $(RANLIB) $@
+ 
+ liltest: liltest.o liblilxml.a
+       $(CC) $(LDFLAGS) -o liltest liltest.o liblilxml.a

diff --git a/sci-astronomy/xephem/xephem-4.2.0.ebuild 
b/sci-astronomy/xephem/xephem-4.2.0.ebuild
new file mode 100644
index 000000000000..c7eb6c9182cb
--- /dev/null
+++ b/sci-astronomy/xephem/xephem-4.2.0.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop flag-o-matic toolchain-funcs
+
+DESCRIPTION="Interactive tool for astronomical ephemeris and sky simulation"
+HOMEPAGE="https://xephem.github.io/XEphem/Site/xephem.html";
+SRC_URI="https://github.com/XEphem/XEphem/archive/refs/tags/${PV}.tar.gz -> 
${P}.tar.gz"
+S="${WORKDIR}/XEphem-${PV}"
+
+LICENSE="MIT"
+SLOT=0
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+       dev-libs/openssl:=
+       media-libs/libjpeg-turbo:=
+       media-libs/libpng:0=
+       sys-libs/zlib
+       >=x11-libs/motif-2.3:0
+       x11-libs/libXext
+       x11-libs/libXmu
+       x11-libs/libXt
+       x11-libs/libX11
+"
+DEPEND="${RDEPEND}"
+BDEPEND="sys-apps/groff"
+
+HTML_DOCS=( GUI/xephem/help/. )
+
+# NOTE: order is relevant - parallel build patch requires respect env vars
+# patch to be already applied
+PATCHES=(
+       "${FILESDIR}/${PN}-3.7.7-implicits.patch"
+       "${FILESDIR}/${P}-respect_env_vars.patch"
+       "${FILESDIR}/${PN}-4.1.0-allow-parallel-builds.patch"
+)
+
+src_compile() {
+       # https://bugs.gentoo.org/944933
+       # https://bugs.gentoo.org/944468
+       append-cflags -std=gnu17
+
+       tc-export CC AR RANLIB
+       emake -C GUI/xephem
+}
+
+src_install() {
+       insinto /usr/share/X11/app-defaults
+       newins - XEphem <<-EOF
+               XEphem.ShareDir: /usr/share/${PN}
+       EOF
+       newenvd - 99xephem <<-EOF
+               XEHELPURL=/usr/share/doc/${PF}/html/xephem.html
+       EOF
+       einstalldocs
+
+       cd GUI/xephem || die
+       dobin xephem
+       doman xephem.1
+       newicon XEphem.png ${PN}.png
+       insinto /usr/share/${PN}
+       doins -r auxil catalogs fifos fits gallery lo
+       make_desktop_entry xephem XEphem ${PN}
+}

Reply via email to