public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-text/discount/files/, app-text/discount/
@ 2020-06-26 15:53 Ben Kohler
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Kohler @ 2020-06-26 15:53 UTC (permalink / raw
  To: gentoo-commits

commit:     28625ec7e0e405c313b34ac9a08a85ee50cc1982
Author:     Ben Kohler <bkohler <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 26 15:53:19 2020 +0000
Commit:     Ben Kohler <bkohler <AT> gentoo <DOT> org>
CommitDate: Fri Jun 26 15:53:36 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28625ec7

app-text/discount: parallel build fix from upstream

Closes: https://bugs.gentoo.org/728930
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org>

 app-text/discount/discount-2.2.6.ebuild         |  2 ++
 app-text/discount/files/gethopt-undefined.patch | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/app-text/discount/discount-2.2.6.ebuild b/app-text/discount/discount-2.2.6.ebuild
index 9e570549251..9cb5d5ea9f1 100644
--- a/app-text/discount/discount-2.2.6.ebuild
+++ b/app-text/discount/discount-2.2.6.ebuild
@@ -15,6 +15,8 @@ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
 IUSE="minimal test"
 RESTRICT="!test? ( test )"
 
+PATCHES=( "${FILESDIR}"/gethopt-undefined.patch )
+
 src_prepare() {
 	default
 

diff --git a/app-text/discount/files/gethopt-undefined.patch b/app-text/discount/files/gethopt-undefined.patch
new file mode 100644
index 00000000000..5b081877a7a
--- /dev/null
+++ b/app-text/discount/files/gethopt-undefined.patch
@@ -0,0 +1,12 @@
+diff -aur discount-2.2.6/Makefile.in discount-2.2.6-new/Makefile.in
+--- discount-2.2.6/Makefile.in	2019-04-16 03:28:20.000000000 +1200
++++ discount-2.2.6-new/Makefile.in	2020-06-21 07:39:32.256757588 +1200
+@@ -139,7 +139,7 @@
+ 
+ pandoc_headers.o: tools/pandoc_headers.c config.h
+ 	$(BUILD) -c -o pandoc_headers.o tools/pandoc_headers.c
+-pandoc_headers: pandoc_headers.o
++pandoc_headers: pandoc_headers.o $(MKDLIB)
+ 	$(LINK) -o pandoc_headers pandoc_headers.o $(COMMON) -lmarkdown 
+ 
+ branch.o: tools/branch.c config.h


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/discount/files/, app-text/discount/
@ 2024-05-13 14:33 Ben Kohler
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Kohler @ 2024-05-13 14:33 UTC (permalink / raw
  To: gentoo-commits

commit:     261d388060c886afade681b01b650905be87e3a5
Author:     Ian Jordan <immoloism <AT> gmail <DOT> com>
AuthorDate: Mon May 13 14:04:58 2024 +0000
Commit:     Ben Kohler <bkohler <AT> gentoo <DOT> org>
CommitDate: Mon May 13 14:27:55 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=261d3880

app-text/discount: C99 Fixes

Cherrypicked patch from Atri Bhattacharya to fix C99 compile time errors.
Upstream are not interested in this as it works in v3 so this seems the best way forward.

Closes: https://bugs.gentoo.org/894560
Signed-off-by: Ian Jordan <immoloism <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/36662
Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org>

 app-text/discount/discount-2.2.7c-r1.ebuild        | 71 ++++++++++++++++++++++
 .../discount/files/discount-2.2.7c-C99-fix.patch   | 38 ++++++++++++
 2 files changed, 109 insertions(+)

diff --git a/app-text/discount/discount-2.2.7c-r1.ebuild b/app-text/discount/discount-2.2.7c-r1.ebuild
new file mode 100644
index 000000000000..1ff52d6de8b1
--- /dev/null
+++ b/app-text/discount/discount-2.2.7c-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="A Markdown-to HTML translator written in C"
+HOMEPAGE="http://www.pell.portland.or.us/~orc/Code/discount/"
+SRC_URI="https://github.com/Orc/discount/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/2.2.7"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="minimal test"
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.2.7c-C99-fix.patch
+)
+
+src_prepare() {
+	default
+
+	# for QA, we remove the Makefile’s usage of install -s.
+	# Drop ldconfig invocation.
+	# Force “librarian.sh” to respect LDFLAGS ($FLAGS should have CFLAGS
+	# at that point).
+	sed -i \
+		-e '/INSTALL_PROGRAM/s,\$_strip ,,' \
+		-e 's/\(LDCONFIG=\).*/\1:/' \
+		-e 's/\(.\)\$FLAGS/& \1$LDFLAGS/' \
+		configure.inc || die "sed configure.inc failed"
+}
+
+src_configure() {
+	local configure_call=(
+		./configure.sh
+		--libdir="${EPREFIX}/usr/$(get_libdir)"
+		--prefix="${EPREFIX}/usr"
+		--mandir="${EPREFIX}/usr/share/man"
+		--shared
+		--pkg-config
+		$(usex minimal '' --enable-all-features)
+		# Enable deterministic HTML generation behavior. Otherwise, will
+		# actually call rand() as part of its serialization code...
+		--debian-glitch
+	)
+	einfo "Running ${configure_call[@]}"
+	CC="$(tc-getCC)" AR="$(tc-getAR)" \
+	"${configure_call[@]}" || die
+}
+
+src_compile() {
+	emake libmarkdown
+	emake
+}
+
+src_install() {
+	emake \
+		DESTDIR="${D}" \
+		$(usex minimal install install.everything) \
+		SAMPLE_PFX="${PN}-"
+}
+
+pkg_postinst() {
+	if ! use minimal; then
+		elog 'Sample binaries with overly-generic names have been'
+		elog "prefixed with \"${PN}-\"."
+	fi
+}

diff --git a/app-text/discount/files/discount-2.2.7c-C99-fix.patch b/app-text/discount/files/discount-2.2.7c-C99-fix.patch
new file mode 100644
index 000000000000..b08d3d41f844
--- /dev/null
+++ b/app-text/discount/files/discount-2.2.7c-C99-fix.patch
@@ -0,0 +1,38 @@
+FROM: https://github.com/Orc/discount/issues/283
+FROM: Atri Bhattacharya <badshah400@gmail.com>
+
+--- a/main.c
++++ b/main.c
+@@ -100,14 +100,15 @@ free_it(char *object, void *ctx)
+ }
+ 
+ char *
+-external_codefmt(char *src, int len, char *lang)
++external_codefmt(const char *src, const int len, void *lang)
+ {
+     int extra = 0;
+     int i, x;
+     char *res;
++    char *ec_lang = (char *)lang;
+ 
+-    if ( lang == 0 )
+-	lang = "generic_code";
++    if ( ec_lang == 0 )
++	ec_lang = "generic_code";
+ 
+     for ( i=0; i < len; i++) {
+ 	if ( src[i] == '&' )
+@@ -117,11 +118,11 @@ external_codefmt(char *src, int len, cha
+     }
+ 
+     /* 80 characters for the format wrappers */
+-    if ( (res = malloc(len+extra+80+strlen(lang))) ==0 )
++    if ( (res = malloc(len+extra+80+strlen(ec_lang))) ==0 )
+ 	/* out of memory?  drat! */
+ 	return 0;
+ 
+-    sprintf(res, "<pre><code class=\"%s\">\n", lang);
++    sprintf(res, "<pre><code class=\"%s\">\n", ec_lang);
+     x = strlen(res);
+     for ( i=0; i < len; i++ ) {
+ 	switch (src[i]) {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-13 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-13 14:33 [gentoo-commits] repo/gentoo:master commit in: app-text/discount/files/, app-text/discount/ Ben Kohler
  -- strict thread matches above, loose matches on Subject: below --
2020-06-26 15:53 Ben Kohler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox