app-misc/getopt: EAPI=7 bump
authorMichael Mair-Keimberger <m.mairkeimberger@gmail.com>
Sat, 18 May 2019 16:40:40 +0000 (18:40 +0200)
committerFabian Groffen <grobian@gentoo.org>
Mon, 17 Jun 2019 18:48:07 +0000 (20:48 +0200)
Closes: https://bugs.gentoo.org/686236
Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger@gmail.com>
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
app-misc/getopt/files/getopt-1.1.4-irix.patch
app-misc/getopt/files/getopt-1.1.5-libintl.patch
app-misc/getopt/getopt-1.1.6-r1.ebuild [new file with mode: 0644]

index 0c344a80131a62137d85565c5765125fa4232aad..1fd38c3b0a20b1046ba254539e73e3ff92a9e1da 100644 (file)
@@ -1,7 +1,7 @@
 http://bugs.gentoo.org/show_bug.cgi?id=211499
 
---- gnu/getopt.c.dist
-+++ gnu/getopt.c
+--- a/gnu/getopt.c
++++ b/gnu/getopt.c
 @@ -69,12 +69,7 @@
  #include <unistd.h>
  #endif        /* GNU C library.  */
index b40367105ed0afc3b2361f82e2e9b7cdfde2465c..0b39b4ecbdc0df65a8154f18bd07952894ef079d 100644 (file)
@@ -1,5 +1,5 @@
---- Makefile.orig      2012-12-28 11:40:09.524686698 +0100
-+++ Makefile   2012-12-28 11:41:20.646157275 +0100
+--- a/Makefile 2012-12-28 11:40:09.524686698 +0100
++++ b/Makefile 2012-12-28 11:41:20.646157275 +0100
 @@ -61,7 +61,7 @@
        -$(RM) $(objects) $(binaries) 
  
diff --git a/app-misc/getopt/getopt-1.1.6-r1.ebuild b/app-misc/getopt/getopt-1.1.6-r1.ebuild
new file mode 100644 (file)
index 0000000..0acad8e
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="getopt(1) replacement supporting GNU-style long options"
+HOMEPAGE="http://frodo.looijaard.name/project/getopt/"
+SRC_URI="http://frodo.looijaard.name/system/files/software/getopt/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64-fbsd ~m68k-mint ~ppc-aix ~ppc-macos ~sparc-solaris ~sparc64-solaris ~x64-cygwin ~x64-macos ~x64-solaris ~x86-fbsd ~x86-macos ~x86-solaris"
+IUSE="nls"
+
+RDEPEND="nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+       nls? ( sys-devel/gettext )"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.1.5-libintl.patch
+       "${FILESDIR}"/${PN}-1.1.5-setlocale.patch
+       "${FILESDIR}"/${PN}-1.1.6-longrename.patch
+       "${FILESDIR}"/${PN}-1.1.4-irix.patch
+)
+
+src_compile() {
+       local nogettext="1"
+       local libintl=""
+       local libcgetopt=1
+
+       if use nls; then
+               nogettext=0
+               has_version sys-libs/glibc || libintl="-lintl"
+       fi
+
+       [[ ${CHOST} == *-aix* ]] && libcgetopt=0
+       [[ ${CHOST} == *-irix* ]] && libcgetopt=0
+       [[ ${CHOST} == *-interix* ]] && libcgetopt=0
+
+       emake CC="$(tc-getCC)" prefix="${EPREFIX}/usr" \
+               LIBCGETOPT=${libcgetopt} \
+               WITHOUT_GETTEXT=${nogettext} LIBINTL=${libintl} \
+               CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+       use nls && emake prefix="${EPREFIX}/usr" DESTDIR="${D}" install_po
+
+       newbin getopt getopt-long
+
+       # at least on interix, the system getopt is ... broken...
+       # util-linux, which would provide the getopt binary, does not build &
+       # install on interix/prefix, so, this has to provide it.
+       [[ ${CHOST} == *-interix* || ${CHOST} == *-mint* ]] && \
+               dosym getopt-long /usr/bin/getopt
+
+       newman getopt.1 getopt-long.1
+
+       dodoc getopt-*sh
+}