commit:     ae76bbdafb14402e4779e00de82b2583ebb3d13e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 01:11:02 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 01:11:07 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae76bbda

app-text/htp: update EAPI 6 -> 8, fix build with perl-5.26(!), fix parallel make

Closes: https://bugs.gentoo.org/668250
Closes: https://bugs.gentoo.org/712280
Closes: https://bugs.gentoo.org/827173
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-text/htp/files/htp-1.19-fix-perl-5.26.patch | 12 +++++++++
 app-text/htp/files/htp-1.19-no-prestrip.patch   | 11 ++++++++
 app-text/htp/files/htp-1.19-parallel-make.patch | 27 +++++++++++++++++++
 app-text/htp/htp-1.19-r1.ebuild                 | 36 +++++++++++++++++++++++++
 4 files changed, 86 insertions(+)

diff --git a/app-text/htp/files/htp-1.19-fix-perl-5.26.patch 
b/app-text/htp/files/htp-1.19-fix-perl-5.26.patch
new file mode 100644
index 000000000000..b3adff7db2be
--- /dev/null
+++ b/app-text/htp/files/htp-1.19-fix-perl-5.26.patch
@@ -0,0 +1,12 @@
+https://bugs.gentoo.org/668250
+--- a/homepage/ref/pphtp.pl
++++ b/homepage/ref/pphtp.pl
+@@ -6,7 +6,7 @@
+ #  -n include line numbers
+ #  -s include EBNF like syntax
+ 
+-require "hlhtp.pl";
++require "./hlhtp.pl";
+ 
+ 
+ while ($ARGV[0] =~ /^-(.*)/) {

diff --git a/app-text/htp/files/htp-1.19-no-prestrip.patch 
b/app-text/htp/files/htp-1.19-no-prestrip.patch
new file mode 100644
index 000000000000..c47b9e4d4241
--- /dev/null
+++ b/app-text/htp/files/htp-1.19-no-prestrip.patch
@@ -0,0 +1,11 @@
+--- a/src/Makefile.sub
++++ b/src/Makefile.sub
+@@ -46,7 +46,7 @@ install: install-bin
+ 
+ install-bin: $(HTP)
+       mkdir -p $(bindir)
+-      $(INSTALL) -s $(HTP) $(bindir)
++      $(INSTALL) $(HTP) $(bindir)
+ 
+ #
+ # explicit dependency: final executable

diff --git a/app-text/htp/files/htp-1.19-parallel-make.patch 
b/app-text/htp/files/htp-1.19-parallel-make.patch
new file mode 100644
index 000000000000..850b1d18e330
--- /dev/null
+++ b/app-text/htp/files/htp-1.19-parallel-make.patch
@@ -0,0 +1,27 @@
+https://bugs.gentoo.org/827173
+https://sources.debian.org/patches/htp/1.19-8/0004-Parallel-ftbfs.patch/
+
+Description: Fix occasional parallel FTBFS
+ Various source files indirectly include $(d)/version.inc,
+ don't regenerate it in the middle of the build.
+Author: Adrian Bunk <[email protected]>
+
+--- htp-1.19.orig/src/Makefile.sub
++++ htp-1.19/src/Makefile.sub
+@@ -57,14 +57,12 @@ $(HTP) : $(OBJ$(d))
+ #
+ # implicit dependencies for source code
+ #
+-$(OBJ$(d)) : %.$(OBJEXT) : %.c
++$(OBJ$(d)) : %.$(OBJEXT) : %.c $(d)/version.inc
+ ifdef WIN32DMC
+       cd $(dir $<); $(CC) $(CCOPT) $(DEFINES) $(notdir $<)
+ else
+       $(CC) $(CCOPT) $(DEFINES) -o $*.$(OBJEXT) $<
+ endif
+ 
+-$(d)/htp.$(OBJEXT) $(d)/ver.$(OBJEXT): $(d)/version.inc
+-
+ # restore parent dir
+ d := $(p$(d))
+

diff --git a/app-text/htp/htp-1.19-r1.ebuild b/app-text/htp/htp-1.19-r1.ebuild
new file mode 100644
index 000000000000..c01e19b48e7d
--- /dev/null
+++ b/app-text/htp/htp-1.19-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="An HTML preprocessor"
+HOMEPAGE="http://htp.sourceforge.net/";
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="Clarified-Artistic"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.19-no-prestrip.patch
+       "${FILESDIR}"/${PN}-1.19-parallel-make.patch
+       "${FILESDIR}"/${PN}-1.19-fix-perl-5.26.patch
+)
+
+src_compile() {
+       # TOOD: Tests are always run by the Makefile right now
+       emake \
+               CCOPT="-c ${CFLAGS} ${CPPFLAGS} -DHAVE_SNPRINTF 
-DHAVE_VASPRINTF -DHAVE_ASPRINTF" \
+               CC="$(tc-getCC)" \
+               LINK='$(CC) $(LDFLAGS)'
+}
+
+src_install() {
+       emake \
+               DESTDIR="${D}" \
+               prefix='$(DESTDIR)/usr' \
+               pkgdocdir='$(DESTDIR)/usr/share/doc/${PF}/html' \
+               install
+}

Reply via email to