commit:     b1b6e4a46931c0998199aae07b6b3cc73db730b2
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  8 12:37:21 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Mar  8 12:37:21 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1b6e4a4

app-admin/procinfo-ng: Port to EAPI 7

* 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 <AT> yandex.ru>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../files/procinfo-ng-2.0.304-as-needed.patch      | 11 ----
 .../files/procinfo-ng-2.0.304-autotools.patch      | 69 ++++++++++++++++++++++
 .../files/procinfo-ng-2.0.304-man.patch            |  4 +-
 .../procinfo-ng/procinfo-ng-2.0.304-r1.ebuild      | 25 +++-----
 4 files changed, 79 insertions(+), 30 deletions(-)

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
index a489f533787..00000000000
--- a/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-as-needed.patch
+++ /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
index 00000000000..9035a5987c3
--- /dev/null
+++ b/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-autotools.patch
@@ -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

diff --git a/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-man.patch 
b/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-man.patch
index ce818fcd3e7..954281258a2 100644
--- a/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-man.patch
+++ b/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-man.patch
@@ -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

diff --git a/app-admin/procinfo-ng/procinfo-ng-2.0.304-r1.ebuild 
b/app-admin/procinfo-ng/procinfo-ng-2.0.304-r1.ebuild
index 791cfbd4c7f..49ce7d2cac5 100644
--- a/app-admin/procinfo-ng/procinfo-ng-2.0.304-r1.ebuild
+++ b/app-admin/procinfo-ng/procinfo-ng-2.0.304-r1.ebuild
@@ -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)"
-}

Reply via email to