app-admin/procinfo-ng: Port to EAPI 7
authorDavid Seifert <soap@gentoo.org>
Sun, 8 Mar 2020 12:37:21 +0000 (13:37 +0100)
committerDavid Seifert <soap@gentoo.org>
Sun, 8 Mar 2020 12:37:21 +0000 (13:37 +0100)
* Use CXXFLAGS instead of CFLAGS for .cpp files
* Use proper Autoconf macros for ncurses
* Unify patches

Closes: https://bugs.gentoo.org/668660
Closes: https://github.com/gentoo/gentoo/pull/14635
Package-Manager: Portage-2.3.93, Repoman-2.3.20
Suggested-by: Denis Pronin <dannftk@yandex.ru>
Signed-off-by: David Seifert <soap@gentoo.org>
app-admin/procinfo-ng/files/procinfo-ng-2.0.304-as-needed.patch [deleted file]
app-admin/procinfo-ng/files/procinfo-ng-2.0.304-autotools.patch [new file with mode: 0644]
app-admin/procinfo-ng/files/procinfo-ng-2.0.304-man.patch
app-admin/procinfo-ng/procinfo-ng-2.0.304-r1.ebuild

diff --git a/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-as-needed.patch b/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-as-needed.patch
deleted file mode 100644 (file)
index a489f53..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- Makefile.in        2009-04-27 05:33:50.000000000 +0200
-+++ Makefile.in.new    2009-10-11 15:22:23.458985416 +0200
-@@ -44,7 +44,7 @@
- cygwin_procstat.cpp cygwin_rendercpupagestat.cpp \
- lib/routines.cpp lib/timeRoutines.cpp lib/prettyPrint.cpp \
- Makefile
--      $(CXX) $(CFLAGS) $(LDFLAGS) procinfo.cpp -o $@
-+      $(CXX) $(CFLAGS) $(LDFLAGS) procinfo.cpp -o $@ $(LIBS)
- #procinfo.o: procinfo.cpp procinfo.h
- #     $(XX) $(CFLAGS) procinfo.cpp -o procinfo.o
diff --git a/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-autotools.patch b/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-autotools.patch
new file mode 100644 (file)
index 0000000..9035a59
--- /dev/null
@@ -0,0 +1,69 @@
+--- a/configure.in
++++ b/configure.in
+@@ -37,13 +37,9 @@
+ AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode     Enables debug symbols and disables optimizations [default=no]],
+ [ enable_maintainer_mode=yes ])
+-if test "$enable_maintainer_mode" = "yes"; then
+-      CFLAGS="-O0 -g3 --pipe -Wall"
+-      LDFLAGS="-lncurses"
+-else
+-      CFLAGS="$CFLAGS -pipe -Wall"
+-      LDFLAGS="-s -lncurses"
+-fi
++CXXFLAGS+=" -Wall"
++
++PKG_CHECK_MODULES([NCURSES], [ncurses])
+ AC_OUTPUT(Makefile)
+ #AC_CONFIG_FILES([Makefile])
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -6,24 +6,30 @@
+ mandir= @mandir@
++CC = @CC@
+ CXX = @CXX@
+ CFLAGS = @CFLAGS@
++CXXFLAGS = @CXXFLAGS@
++
+ LDFLAGS = @LDFLAGS@
++CPPFLAGS += @NCURSES_CFLAGS@
++LIBS = @NCURSES_LIBS@
++
+ #LDLIBS = -levent
+ ### Add to taste:
+-# CFLAGS  = -g 
++# CXXFLAGS  = -g 
+ # LDFLAGS = -g
+-# CFLAGS += -DPROC_DIR=\"extra2/\"
++# CXXFLAGS += -DPROC_DIR=\"extra2/\"
+-# CFLAGS += -DDEBUG
++# CXXFLAGS += -DDEBUG
+ # LDLIBS += -ldmalloc
+-# CFLAGS += -pg
++# CXXFLAGS += -pg
+ # LDFLAGS = -pg
+ ### End of configurable options.
+@@ -44,10 +50,10 @@
+ cygwin_procstat.cpp cygwin_rendercpupagestat.cpp \
+ lib/routines.cpp lib/timeRoutines.cpp lib/prettyPrint.cpp \
+ Makefile
+-      $(CXX) $(CFLAGS) $(LDFLAGS) procinfo.cpp -o $@
++      $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) procinfo.cpp -o $@ $(LIBS)
+ #procinfo.o: procinfo.cpp procinfo.h
+-#     $(XX) $(CFLAGS) procinfo.cpp -o procinfo.o
++#     $(CXX) $(CXXFLAGS) procinfo.cpp -o procinfo.o
+ install: procinfo procinfo.8
+       -mkdir -p $(DESTDIR)/$(prefix)/bin
index ce818fcd3e77d5e2c8c46ac0fc54f3e678492d4a..954281258a249bcc0f514ad8cf2bd0ad32dca701 100644 (file)
@@ -1,5 +1,5 @@
---- procinfo-ng-2.0.217/procinfo.8.orig        2009-01-11 11:21:23.000000000 +0100
-+++ procinfo-ng-2.0.217/procinfo.8     2009-01-11 11:21:48.000000000 +0100
+--- a/procinfo.8
++++ b/procinfo.8
 @@ -6,7 +6,7 @@
  .SH SYNOPSIS
  .B procinfo
index 791cfbd4c7fbbfee0f0761ee759d064da783d3bd..49ce7d2cac5777e45cb4b1d0d1859850dca0a9cd 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 
-inherit autotools eutils toolchain-funcs
+inherit autotools
 
 DESCRIPTION="Completely rewrite of the old system monitoring app procinfo"
 HOMEPAGE="https://sourceforge.net/projects/procinfo-ng/"
@@ -12,29 +12,20 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
 LICENSE="|| ( GPL-2 LGPL-2.1 )"
 SLOT="0"
 KEYWORDS="amd64 hppa x86"
-IUSE=""
 
 RDEPEND="
        sys-libs/ncurses:0=
        !app-admin/procinfo"
-DEPEND="${RDEPEND}
-       virtual/pkgconfig"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
 
 PATCHES=(
-       "${FILESDIR}"/${P}-as-needed.patch
+       "${FILESDIR}"/${P}-autotools.patch
        "${FILESDIR}"/${P}-man.patch
 )
 
 src_prepare() {
-       epatch "${PATCHES[@]}"
-       # removing -s flag as portage does the stripping part and add support
-       # for custom LDFLAGS. Plus correct for --as-needed
-       sed \
-               -e 's:-s -lncurses:${LDFLAGS}:' \
-               -i configure.in || die "sed configure.in failed"
+       default
+       mv configure.{in,ac} || die
        eautoreconf
 }
-
-src_compile() {
-       emake LIBS="$($(tc-getPKG_CONFIG) --libs ncurses)"
-}