media-gfx/hp2xx: Port to EAPI 7
authorDavid Seifert <soap@gentoo.org>
Fri, 13 Dec 2019 15:07:22 +0000 (16:07 +0100)
committerDavid Seifert <soap@gentoo.org>
Fri, 13 Dec 2019 15:07:22 +0000 (16:07 +0100)
Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: David Seifert <soap@gentoo.org>
media-gfx/hp2xx/files/hp2xx-3.4.4-r1.patch
media-gfx/hp2xx/hp2xx-3.4.4-r1.ebuild

index 9bff4f43b9227909df43846edf710ae4c20e2905..d9f3edb849474cba5e48b80b53f1409372fdb796 100644 (file)
@@ -1,6 +1,20 @@
-diff -ruN hp2xx-3.4.4.orig/makes/generic.mak hp2xx-3.4.4/makes/generic.mak
---- hp2xx-3.4.4.orig/makes/generic.mak 2003-06-21 17:16:35.000000000 +0200
-+++ hp2xx-3.4.4/makes/generic.mak      2012-02-07 22:30:29.000000000 +0100
+--- a/Makefile
++++ b/Makefile
+@@ -1,9 +1,9 @@
+ all:
+-      cd sources; make
++      cd sources && $(MAKE)
+ clean:
+-      cd sources; make clean
++      cd sources && $(MAKE) clean
+ install:
+-      cd sources; make install
++      cd sources && $(MAKE) install
+--- a/makes/generic.mak
++++ b/makes/generic.mak
 @@ -30,11 +30,11 @@
  CP       = cp
  MKINFO   = makeinfo
@@ -115,9 +129,8 @@ diff -ruN hp2xx-3.4.4.orig/makes/generic.mak hp2xx-3.4.4/makes/generic.mak
        $(BINDCMD)
  
  
-diff -ruN hp2xx-3.4.4.orig/sources/png.c hp2xx-3.4.4/sources/png.c
---- hp2xx-3.4.4.orig/sources/png.c     2003-06-21 17:31:51.000000000 +0200
-+++ hp2xx-3.4.4/sources/png.c  2012-02-07 22:26:33.000000000 +0100
+--- a/sources/png.c
++++ b/sources/png.c
 @@ -5,6 +5,7 @@
  #include <stdio.h>
  #include <stdlib.h>
index 9bdc0204255d883124299afc8b124f5d1c7cf195..82bdb6b2b16f6b86c95ba8732328a5c87fb7bbaa 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=4
+EAPI=7
 
-inherit eutils base
+inherit toolchain-funcs
 
 DESCRIPTION="Convert Hewlett-Packard's HP-GL plotter language to other graphics formats"
 HOMEPAGE="https://www.gnu.org/software/hp2xx/"
@@ -12,58 +12,72 @@ SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE="X jpeg png tiff"
+IUSE="jpeg png tiff X"
 
 RDEPEND="
-       png? ( media-libs/libpng sys-libs/zlib )
-       tiff? ( media-libs/tiff )
        jpeg? ( virtual/jpeg )
+       png? (
+               media-libs/libpng:=
+               sys-libs/zlib
+       )
+       tiff? ( media-libs/tiff:= )
        X? ( x11-libs/libX11 )"
-DEPEND="${RDEPEND}
-       sys-apps/texinfo"
+DEPEND="${RDEPEND}"
+BDEPEND="sys-apps/texinfo"
 
-PATCHES=(  "${FILESDIR}"/${P}-r1.patch
-       "${FILESDIR}"/${P}-docbuild.patch )
+PATCHES=(
+       "${FILESDIR}"/${P}-r1.patch
+       "${FILESDIR}"/${P}-docbuild.patch
+)
 
 src_prepare() {
-       base_src_prepare
+       default
        cp -v makes/generic.mak sources/Makefile || die
 }
 
-src_compile() {
-       cd "${S}/sources" || die
+src_configure() {
        export PREVIEWER="no_prev"
        export EX_SRC=
        export EX_OBJ=
        export EX_DEFS=-DUNIX
        export ALL_LIBS=-lm
-       use X && \
-               PREVIEWER="to_x11" \
-               EX_DEFS="-DHAS_UNIX_X11" \
-               ALL_LIBS="${ALL_LIBS} -lX11"
+
        use jpeg && \
-               EX_SRC="${EX_SRC} to_jpg.c" \
-               EX_OBJ="${EX_OBJ} to_jpg.o" \
-               EX_DEFS="${EX_DEFS} -DJPG" \
-               ALL_LIBS="${ALL_LIBS} -ljpeg"
+               EX_SRC+=" to_jpg.c" \
+               EX_OBJ+=" to_jpg.o" \
+               EX_DEFS+=" -DJPG" \
+               ALL_LIBS+=" -ljpeg"
        use png && \
-               EX_SRC="${EX_SRC} png.c to_png.c" \
-               EX_OBJ="${EX_OBJ} png.o to_png.o" \
-               EX_DEFS="${EX_DEFS} -DPNG" \
-               ALL_LIBS="${ALL_LIBS} -lpng"
+               EX_SRC+=" png.c to_png.c" \
+               EX_OBJ+=" png.o to_png.o" \
+               EX_DEFS+=" -DPNG" \
+               ALL_LIBS+=" -lpng"
        use tiff && \
-               EX_SRC="${EX_SRC} to_tif.c" \
-               EX_OBJ="${EX_OBJ} to_tif.o" \
-               EX_DEFS="${EX_DEFS} -DTIF" \
-               ALL_LIBS="${ALL_LIBS} -ltiff"
-       emake all
+               EX_SRC+=" to_tif.c" \
+               EX_OBJ+=" to_tif.o" \
+               EX_DEFS+=" -DTIF" \
+               ALL_LIBS+=" -ltiff"
+       use X && \
+               PREVIEWER="to_x11" \
+               EX_DEFS="-DHAS_UNIX_X11" \
+               ALL_LIBS+=" -lX11"
+
+       tc-export CC
+}
+
+src_compile() {
+       emake -C sources all
 }
 
 src_install() {
-       dodir /usr/bin /usr/share/info /usr/share/man/man1
+       dodir \
+               /usr/bin \
+               /usr/share/info \
+               /usr/share/man/man1
 
-       make prefix="${D}/usr" \
-               mandir="${D}/usr/share/man" \
-               infodir="${D}/usr/share/info" \
-               install || die
+       emake \
+               prefix="${ED}"/usr \
+               mandir="${ED}"/usr/share/man \
+               infodir="${ED}"/usr/share/info \
+               install
 }