summary refs log tree commit diff
path: root/app-misc
diff options
context:
space:
mode:
authorAzat Bahawi <azahi@teknik.io>2021-02-18 13:20:57 +0300
committerAzat Bahawi <azahi@teknik.io>2021-02-18 13:20:57 +0300
commit7217e0773b8a6632cac56b31c82f960dcedc464b (patch)
tree915e0fae6ddc68496f3d0593a10d71574d80440f /app-misc
parentapp-misc/fbcat: Refactor (diff)
app-misc/stag: Fix building
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/stag/files/stag-1.0.0-ncurses.patch11
-rw-r--r--app-misc/stag/files/stag-9999-ncurses.patch11
-rw-r--r--app-misc/stag/stag-1.0.0.ebuild25
-rw-r--r--app-misc/stag/stag-9999.ebuild25
4 files changed, 38 insertions, 34 deletions
diff --git a/app-misc/stag/files/stag-1.0.0-ncurses.patch b/app-misc/stag/files/stag-1.0.0-ncurses.patch
deleted file mode 100644
index 2830134..0000000
--- a/app-misc/stag/files/stag-1.0.0-ncurses.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Makefile	2020-10-02 20:44:39.606575295 -0700
-+++ b/Makefile	2020-10-02 20:45:28.695961593 -0700
-@@ -1,7 +1,7 @@
- CC ?= gcc
- CFLAGS=-Wall -Werror -Wextra -std=c99 -pedantic -Wno-unused-parameter
- # D_BSD_SOURCE for strsep
--LIBS=-lncurses -lm -D_DEFAULT_SOURCE
-+LIBS=-lncurses -ltinfo -lm -D_DEFAULT_SOURCE
- PREFIX ?= /usr/local
- 
- .PHONY: install uninstall clean
diff --git a/app-misc/stag/files/stag-9999-ncurses.patch b/app-misc/stag/files/stag-9999-ncurses.patch
deleted file mode 100644
index 2830134..0000000
--- a/app-misc/stag/files/stag-9999-ncurses.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Makefile	2020-10-02 20:44:39.606575295 -0700
-+++ b/Makefile	2020-10-02 20:45:28.695961593 -0700
-@@ -1,7 +1,7 @@
- CC ?= gcc
- CFLAGS=-Wall -Werror -Wextra -std=c99 -pedantic -Wno-unused-parameter
- # D_BSD_SOURCE for strsep
--LIBS=-lncurses -lm -D_DEFAULT_SOURCE
-+LIBS=-lncurses -ltinfo -lm -D_DEFAULT_SOURCE
- PREFIX ?= /usr/local
- 
- .PHONY: install uninstall clean
diff --git a/app-misc/stag/stag-1.0.0.ebuild b/app-misc/stag/stag-1.0.0.ebuild
index fdb6a21..1a58fba 100644
--- a/app-misc/stag/stag-1.0.0.ebuild
+++ b/app-misc/stag/stag-1.0.0.ebuild
@@ -4,11 +4,13 @@
 EAPI=7
 
 if [[ ${PV} == *9999 ]]; then
-	inherit git-r3
+	SCM="git-r3"
 	EGIT_REPO_URI="https://github.com/seenaburns/stag.git"
 fi
 
-DESCRIPTION="Streaming bar graphs. For stats and stuff."
+inherit toolchain-funcs ${SCM}
+
+DESCRIPTION="Streaming bar graphs for stats and stuff"
 HOMEPAGE="https://github.com/seenaburns/stag"
 
 if [[ ${PV} == *9999 ]]; then
@@ -27,10 +29,21 @@ DEPEND="sys-libs/ncurses"
 RDEPEND="${DEPEND}"
 BDEPEND=""
 
-PATCHES=(
-	"${FILESDIR}/${P}-ncurses.patch"
-)
+src_prepare() {
+	sed -e 's/^CFLAGS=/CFLAGS+=/' \
+		-e 's/-lncurses/-lncurses -ltinfo/' \
+		-i Makefile || die
+
+	default
+}
+
+src_compile() {
+	emake \
+		CC="$(tc-getCC)"
+}
 
 src_install() {
-	emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
+	emake install \
+		DESTDIR="${D}" \
+		PREFIX="${EPREFIX}/usr"
 }
diff --git a/app-misc/stag/stag-9999.ebuild b/app-misc/stag/stag-9999.ebuild
index fdb6a21..1a58fba 100644
--- a/app-misc/stag/stag-9999.ebuild
+++ b/app-misc/stag/stag-9999.ebuild
@@ -4,11 +4,13 @@
 EAPI=7
 
 if [[ ${PV} == *9999 ]]; then
-	inherit git-r3
+	SCM="git-r3"
 	EGIT_REPO_URI="https://github.com/seenaburns/stag.git"
 fi
 
-DESCRIPTION="Streaming bar graphs. For stats and stuff."
+inherit toolchain-funcs ${SCM}
+
+DESCRIPTION="Streaming bar graphs for stats and stuff"
 HOMEPAGE="https://github.com/seenaburns/stag"
 
 if [[ ${PV} == *9999 ]]; then
@@ -27,10 +29,21 @@ DEPEND="sys-libs/ncurses"
 RDEPEND="${DEPEND}"
 BDEPEND=""
 
-PATCHES=(
-	"${FILESDIR}/${P}-ncurses.patch"
-)
+src_prepare() {
+	sed -e 's/^CFLAGS=/CFLAGS+=/' \
+		-e 's/-lncurses/-lncurses -ltinfo/' \
+		-i Makefile || die
+
+	default
+}
+
+src_compile() {
+	emake \
+		CC="$(tc-getCC)"
+}
 
 src_install() {
-	emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
+	emake install \
+		DESTDIR="${D}" \
+		PREFIX="${EPREFIX}/usr"
 }

Consider giving Nix/NixOS a try! <3