commit:     41e37bc346ac1154b8242a0c567e6b01136a4904
Author:     Marty E. Plummer <hanetzer <AT> startmail <DOT> com>
AuthorDate: Fri Oct 19 09:46:29 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Oct 22 20:23:25 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41e37bc3

app-text/scdoc: add live ebuild

Signed-off-by: Marty E. Plummer <hanetzer <AT> startmail.com>
Package-Manager: Portage-2.3.51, Repoman-2.3.11
Closes: https://github.com/gentoo/gentoo/pull/10177
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 app-text/scdoc/scdoc-9999.ebuild | 43 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/app-text/scdoc/scdoc-9999.ebuild b/app-text/scdoc/scdoc-9999.ebuild
new file mode 100644
index 00000000000..3c018008f00
--- /dev/null
+++ b/app-text/scdoc/scdoc-9999.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Standalone tool for generating man pages with a simple syntax"
+HOMEPAGE="https://git.sr.ht/~sircmpwn/scdoc";
+
+if [[ ${PV} == 9999 ]]; then
+       EGIT_REPO_URI="https://git.sr.ht/~sircmpwn/scdoc";
+       inherit git-r3
+else
+       SRC_URI="https://git.sr.ht/~sircmpwn/scdoc/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+
+src_prepare() {
+       default
+
+       sed -e 's/-Werror//' \
+               -i Makefile || die 'Failed to patch Makefile'
+}
+
+src_compile() {
+       local MY_HS="./scdoc"
+       if tc-is-cross-compiler; then
+               tc-export_build_env
+               MY_HS="./hostscdoc"
+               emake scdoc HOST_SCDOC="./hostscdoc" OUTDIR="${S}/.build.host" 
CC="$(tc-getBUILD_CC)" \
+                       CFLAGS="${BUILD_CFLAGS} -DVERSION='\"${PV}\"'" 
LDFLAGS="${BUILD_LDFLAGS}"
+               mv scdoc hostscdoc || die 'Failed to rename host scdoc'
+       fi
+       emake LDFLAGS="${LDFLAGS}" PREFIX="${EPREFIX}/usr" HOST_SCDOC="${MY_HS}"
+}
+
+src_install() {
+       emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" HOST_SCDOC="${MY_HS}" 
install
+}

Reply via email to