x11-misc/efax-gtk: Fix CFLAGS=-fno-common
authorJeroen Roovers <jer@gentoo.org>
Sat, 1 Feb 2020 13:08:54 +0000 (14:08 +0100)
committerJeroen Roovers <jer@gentoo.org>
Sat, 1 Feb 2020 13:43:33 +0000 (14:43 +0100)
Package-Manager: Portage-2.3.86, Repoman-2.3.20
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
x11-misc/efax-gtk/efax-gtk-3.2.13-r1.ebuild [new file with mode: 0644]
x11-misc/efax-gtk/files/efax-gtk-3.2.13-fno-common.patch [new file with mode: 0644]

diff --git a/x11-misc/efax-gtk/efax-gtk-3.2.13-r1.ebuild b/x11-misc/efax-gtk/efax-gtk-3.2.13-r1.ebuild
new file mode 100644 (file)
index 0000000..3a4ae41
--- /dev/null
@@ -0,0 +1,55 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="A graphical frontend for the 'efax' application"
+HOMEPAGE="http://efax-gtk.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.src.tgz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="nls"
+
+RDEPEND=">=dev-libs/glib-2.10
+       media-libs/tiff:0=
+       x11-libs/libX11
+       x11-libs/c++-gtk-utils:0[gtk]
+       x11-libs/gtk+:3"
+DEPEND="${RDEPEND}
+       virtual/pkgconfig
+       nls? ( sys-devel/gettext )"
+
+DOCS="AUTHORS BUGS ChangeLog README"
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.2.13-fno-common.patch
+)
+
+src_prepare() {
+       default
+       # Prevent sandbox violation with chown/chgrp and existing spooldir
+       sed -i -e '/ch.*lp.*spooldir/d' efax-gtk-faxfilter/Makefile.in || die
+
+       sed -i \
+               -e '/^Categories/s:Office;::' \
+               ${PN}.desktop || die
+}
+
+src_configure() {
+       econf \
+               $(use_enable nls) \
+               --with-gtk-version=gtk3
+}
+
+src_install() {
+       default
+       # File collision with net-misc/efax wrt #401221
+       mv "${ED}"/usr/share/man/man1/efax{,-0.9a}.1 || die
+       mv "${ED}"/usr/share/man/man1/efix{,-0.9a}.1 || die
+}
+
+pkg_postinst() {
+       local spooldir="${EROOT}"/var/spool/fax
+       [[ -d ${spooldir} ]] && chown lp:lp "${spooldir}"
+}
diff --git a/x11-misc/efax-gtk/files/efax-gtk-3.2.13-fno-common.patch b/x11-misc/efax-gtk/files/efax-gtk-3.2.13-fno-common.patch
new file mode 100644 (file)
index 0000000..4cfd79a
--- /dev/null
@@ -0,0 +1,35 @@
+--- a/efax/efaxos.h
++++ b/efax/efaxos.h
+@@ -11,10 +11,6 @@
+ #define UNIXSIGS  SIGHUP, SIGQUIT, SIGIOT, SIGALRM
+ #define CATCHSIGS ANSISIGS, UNIXSIGS
+-/* Bit order reversal table. */
+-
+-extern unsigned char normalbits [ ] ;
+-
+ typedef enum ttymodes         /* serial port modes:  */
+ {
+     COMMAND,                  /*   19200 8N1, no f/c, DTR high */
+--- a/efax/efaxlib.h
++++ b/efax/efaxlib.h
+@@ -208,7 +208,7 @@
+ /* Bit reversal lookup tables (note that the `normalbits' array
+    is the one actually used for the bit reversal.  */
+-uchar reversebits [ 256 ], normalbits [ 256 ] ;
++extern uchar reversebits [ 256 ], normalbits [ 256 ] ;
+ void initbittab(void) ;
+--- a/efax/efaxlib.c
++++ b/efax/efaxlib.c
+@@ -48,6 +48,8 @@
+   return n < 0 ;
+ }
++uchar reversebits [ 256 ], normalbits [ 256 ] ;
++
+ /* Provide dummy gettext() function if there is no internationalisation support */
+ #ifndef ENABLE_NLS