Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/lowdown/files/, app-text/lowdown/
Date: Sat, 29 Jan 2022 20:37:22
Message-Id: 1643488634.f105d97dc268c469b1cdc2f503d68ec77007c684.chutzpah@gentoo
1 commit: f105d97dc268c469b1cdc2f503d68ec77007c684
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 29 20:37:00 2022 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 29 20:37:14 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f105d97d
7
8 app-text/lowdown: Bump to 0.10.0, install lib (bug #811111)
9
10 Closes: https://bugs.gentoo.org/811111
11 Package-Manager: Portage-3.0.30, Repoman-3.0.3
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 app-text/lowdown/Manifest | 1 +
15 .../lowdown-0.10.0-dont-install-static-lib.patch | 12 +++++
16 .../lowdown/files/lowdown-0.10.0-linking.patch | 43 ++++++++++++++++++
17 .../files/lowdown-0.10.0-shared-library.patch | 53 ++++++++++++++++++++++
18 app-text/lowdown/lowdown-0.10.0.ebuild | 46 +++++++++++++++++++
19 5 files changed, 155 insertions(+)
20
21 diff --git a/app-text/lowdown/Manifest b/app-text/lowdown/Manifest
22 index ba3e9378cc09..e1d3afdf8827 100644
23 --- a/app-text/lowdown/Manifest
24 +++ b/app-text/lowdown/Manifest
25 @@ -1 +1,2 @@
26 +DIST lowdown-0.10.0.tar.gz 547397 BLAKE2B 93d87e3aca2466398a625750b928062fbafd26311899e52ddd8264218675e78d30714c920f3331619fcd510a92cc6046401c946f5bd1465d6fd46f26937318ac SHA512 7454e618607628ec0a1649f44f5ec64f8778ecaa151f6aad4984935e297abfe8e84ffc321d3c93cec5d336ff14b6bf9a0ff9054e7363cc58ba708a5b60db9048
27 DIST lowdown-0.8.4.tar.gz 520735 BLAKE2B dc66b92f285b186ca83b9fad1cccfef9b395233ef56756e9ea9071b5502cd81dc6ce2d67d7ef265dab8953010af0907cd76125cd4442cfbfc2bcf8c63e097809 SHA512 cd46ead69ed038bf3ccf848b784327d66c78dd8adbc9ae4bfee660b9b1e52844ac8c7ad0377f8f38a3fee0d2e523f979a22d6b547c7964304accef0951cfca34
28
29 diff --git a/app-text/lowdown/files/lowdown-0.10.0-dont-install-static-lib.patch b/app-text/lowdown/files/lowdown-0.10.0-dont-install-static-lib.patch
30 new file mode 100644
31 index 000000000000..4a120c32ed29
32 --- /dev/null
33 +++ b/app-text/lowdown/files/lowdown-0.10.0-dont-install-static-lib.patch
34 @@ -0,0 +1,12 @@
35 +diff --git a/Makefile b/Makefile
36 +index f13a364..d013a1c 100644
37 +--- a/Makefile
38 ++++ b/Makefile
39 +@@ -153,7 +153,6 @@ install: all
40 + $(INSTALL_DATA) lowdown.pc $(DESTDIR)$(LIBDIR)/pkgconfig
41 + $(INSTALL_PROGRAM) lowdown $(DESTDIR)$(BINDIR)
42 + $(INSTALL_PROGRAM) lowdown-diff $(DESTDIR)$(BINDIR)
43 +- $(INSTALL_LIB) liblowdown.a $(DESTDIR)$(LIBDIR)
44 + $(INSTALL_LIB) liblowdown.so $(DESTDIR)$(LIBDIR)
45 + $(INSTALL_DATA) lowdown.h $(DESTDIR)$(INCLUDEDIR)
46 + for f in $(MANS) ; do \
47
48 diff --git a/app-text/lowdown/files/lowdown-0.10.0-linking.patch b/app-text/lowdown/files/lowdown-0.10.0-linking.patch
49 new file mode 100644
50 index 000000000000..e0ab7285e07a
51 --- /dev/null
52 +++ b/app-text/lowdown/files/lowdown-0.10.0-linking.patch
53 @@ -0,0 +1,43 @@
54 +diff --git a/Makefile b/Makefile
55 +index d013a1c..c9de4d4 100644
56 +--- a/Makefile
57 ++++ b/Makefile
58 +@@ -130,8 +130,8 @@ installwww: www
59 + $(INSTALL) -m 0444 lowdown.tar.gz $(WWWDIR)/snapshots
60 + $(INSTALL) -m 0444 lowdown.tar.gz.sha512 $(WWWDIR)/snapshots
61 +
62 +-lowdown: liblowdown.a main.o
63 +- $(CC) -o $@ main.o liblowdown.a $(LDFLAGS) $(LDADD_MD5) -lm
64 ++lowdown: liblowdown.so main.o
65 ++ $(CC) -o $@ main.o -L. -llowdown $(LDFLAGS) $(LDADD_MD5) -lm
66 +
67 + lowdown-diff: lowdown
68 + ln -f lowdown lowdown-diff
69 +@@ -141,7 +141,8 @@ liblowdown.a: $(OBJS) $(COMPAT_OBJS)
70 +
71 +
72 + liblowdown.so: $(OBJS) $(COMPAT_OBJS)
73 +- $(CC) -shared -o $@ $(OBJS) $(COMPAT_OBJS) $(LDFLAGS)
74 ++ $(CC) -shared -o $@.1 $(OBJS) $(COMPAT_OBJS) $(LDFLAGS) -Wl,-soname,$@.1
75 ++ ln -s $@.1 $@
76 +
77 + install: all
78 + mkdir -p $(DESTDIR)$(BINDIR)
79 +@@ -153,7 +154,7 @@ install: all
80 + $(INSTALL_DATA) lowdown.pc $(DESTDIR)$(LIBDIR)/pkgconfig
81 + $(INSTALL_PROGRAM) lowdown $(DESTDIR)$(BINDIR)
82 + $(INSTALL_PROGRAM) lowdown-diff $(DESTDIR)$(BINDIR)
83 +- $(INSTALL_LIB) liblowdown.so $(DESTDIR)$(LIBDIR)
84 ++ $(INSTALL_LIB) liblowdown.so.1 $(DESTDIR)$(LIBDIR)
85 + $(INSTALL_DATA) lowdown.h $(DESTDIR)$(INCLUDEDIR)
86 + for f in $(MANS) ; do \
87 + name=`basename $$f .html` ; \
88 +@@ -271,7 +272,7 @@ main.o: lowdown.h
89 +
90 + clean:
91 + rm -f $(OBJS) $(COMPAT_OBJS) main.o
92 +- rm -f lowdown lowdown-diff liblowdown.a liblowdown.so lowdown.pc
93 ++ rm -f lowdown lowdown-diff liblowdown.a liblowdown.so liblowdown.so.1 lowdown.pc
94 + rm -f index.xml diff.xml diff.diff.xml README.xml lowdown.tar.gz.sha512 lowdown.tar.gz
95 + rm -f $(PDFS) $(HTMLS) $(THUMBS)
96 + rm -f index.latex.aux index.latex.latex index.latex.log index.latex.out
97
98 diff --git a/app-text/lowdown/files/lowdown-0.10.0-shared-library.patch b/app-text/lowdown/files/lowdown-0.10.0-shared-library.patch
99 new file mode 100644
100 index 000000000000..0adfe762fb57
101 --- /dev/null
102 +++ b/app-text/lowdown/files/lowdown-0.10.0-shared-library.patch
103 @@ -0,0 +1,53 @@
104 +commit e33536ae131e31adf77d3258c0cdd3da10868534
105 +Author: Kristaps Dz <kristaps@×××.lv>
106 +Date: Thu Nov 4 12:27:21 2021 +0000
107 +
108 + Generate a shared library as well.
109 +
110 + Earlier, the library interface was just moving too quickly. Now, I
111 + don't think I'll be changing it much---if at all, unless to add new
112 + front-ends.
113 +
114 + References https://github.com/kristapsdz/lowdown/issues/45
115 +
116 +diff --git a/Makefile b/Makefile
117 +index 475f780..f13a364 100644
118 +--- a/Makefile
119 ++++ b/Makefile
120 +@@ -118,7 +118,7 @@ REGRESS_ARGS += "--parse-no-autolink"
121 + REGRESS_ARGS += "--parse-no-cmark"
122 + REGRESS_ARGS += "--parse-no-deflists"
123 +
124 +-all: lowdown lowdown-diff lowdown.pc
125 ++all: lowdown lowdown-diff liblowdown.so lowdown.pc
126 +
127 + www: $(HTMLS) $(PDFS) $(THUMBS) lowdown.tar.gz lowdown.tar.gz.sha512
128 +
129 +@@ -139,6 +139,10 @@ lowdown-diff: lowdown
130 + liblowdown.a: $(OBJS) $(COMPAT_OBJS)
131 + $(AR) rs $@ $(OBJS) $(COMPAT_OBJS)
132 +
133 ++
134 ++liblowdown.so: $(OBJS) $(COMPAT_OBJS)
135 ++ $(CC) -shared -o $@ $(OBJS) $(COMPAT_OBJS) $(LDFLAGS)
136 ++
137 + install: all
138 + mkdir -p $(DESTDIR)$(BINDIR)
139 + mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
140 +@@ -150,6 +154,7 @@ install: all
141 + $(INSTALL_PROGRAM) lowdown $(DESTDIR)$(BINDIR)
142 + $(INSTALL_PROGRAM) lowdown-diff $(DESTDIR)$(BINDIR)
143 + $(INSTALL_LIB) liblowdown.a $(DESTDIR)$(LIBDIR)
144 ++ $(INSTALL_LIB) liblowdown.so $(DESTDIR)$(LIBDIR)
145 + $(INSTALL_DATA) lowdown.h $(DESTDIR)$(INCLUDEDIR)
146 + for f in $(MANS) ; do \
147 + name=`basename $$f .html` ; \
148 +@@ -267,7 +272,7 @@ main.o: lowdown.h
149 +
150 + clean:
151 + rm -f $(OBJS) $(COMPAT_OBJS) main.o
152 +- rm -f lowdown lowdown-diff liblowdown.a lowdown.pc
153 ++ rm -f lowdown lowdown-diff liblowdown.a liblowdown.so lowdown.pc
154 + rm -f index.xml diff.xml diff.diff.xml README.xml lowdown.tar.gz.sha512 lowdown.tar.gz
155 + rm -f $(PDFS) $(HTMLS) $(THUMBS)
156 + rm -f index.latex.aux index.latex.latex index.latex.log index.latex.out
157
158 diff --git a/app-text/lowdown/lowdown-0.10.0.ebuild b/app-text/lowdown/lowdown-0.10.0.ebuild
159 new file mode 100644
160 index 000000000000..a38987c1e1aa
161 --- /dev/null
162 +++ b/app-text/lowdown/lowdown-0.10.0.ebuild
163 @@ -0,0 +1,46 @@
164 +# Copyright 2021-2022 Gentoo Authors
165 +# Distributed under the terms of the GNU General Public License v2
166 +
167 +EAPI=8
168 +
169 +inherit toolchain-funcs flag-o-matic
170 +
171 +MY_PV="VERSION_${PV//./_}"
172 +DESCRIPTION="Markdown translator producing HTML5, roff documents in the ms and man formats"
173 +HOMEPAGE="https://kristaps.bsd.lv/lowdown/"
174 +SRC_URI="https://github.com/kristapsdz/lowdown/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.tar.gz"
175 +S="${WORKDIR}/${PN}-${MY_PV}"
176 +
177 +LICENSE="ISC"
178 +SLOT="0"
179 +KEYWORDS="~amd64 ~x86"
180 +
181 +DEPEND="virtual/libcrypt:="
182 +RDEPEND="${DEPEND}"
183 +
184 +PATCHES=(
185 + "${FILESDIR}/lowdown-0.10.0-shared-library.patch"
186 + "${FILESDIR}/lowdown-0.10.0-dont-install-static-lib.patch"
187 + "${FILESDIR}/lowdown-0.10.0-linking.patch"
188 +)
189 +
190 +src_configure() {
191 + append-flags -fPIC
192 + tc-export CC AR
193 +
194 + ./configure \
195 + PREFIX="/usr" \
196 + MANDIR="/usr/share/man" \
197 + LDFLAGS="${LDFLAGS}" \
198 + CPPFLAGS="${CPPFLAGS}" \
199 + LIBDIR="/usr/$(get_libdir)" \
200 + || die "./configure failed"
201 +}
202 +
203 +src_compile() {
204 + emake $(usex elibc_musl UTF8_LOCALE=C.UTF-8 '')
205 +}
206 +
207 +src_test() {
208 + emake regress
209 +}