x11-misc/xnots: Add GCC 6 patch.
authorJeroen Roovers <jer@gentoo.org>
Fri, 7 Apr 2017 09:22:27 +0000 (11:22 +0200)
committerJeroen Roovers <jer@gentoo.org>
Fri, 7 Apr 2017 09:22:27 +0000 (11:22 +0200)
Package-Manager: Portage-2.3.5, Repoman-2.3.2

x11-misc/xnots/files/xnots-0.2.1-gcc6.patch [new file with mode: 0644]
x11-misc/xnots/xnots-0.2.1-r2.ebuild [new file with mode: 0644]

diff --git a/x11-misc/xnots/files/xnots-0.2.1-gcc6.patch b/x11-misc/xnots/files/xnots-0.2.1-gcc6.patch
new file mode 100644 (file)
index 0000000..df65f00
--- /dev/null
@@ -0,0 +1,46 @@
+diff --git a/src/Makefile b/src/Makefile
+index 4f8aaf1..7b527a6 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -28,7 +28,7 @@ else
+     CFLAGS += -DDEBUG_LEVEL=1 -g
+ endif
+-CFLAGS                += -fno-strict-aliasing
++CFLAGS                += -fno-strict-aliasing -fgnu89-inline
+ CFLAGS                += -DVERSION=\"$(VERSION)\" -Wall
+ CFLAGS                += $(shell pkg-config $(PKGS) --cflags)
+ LDLIBS                += $(shell pkg-config $(PKGS) --libs)
+diff --git a/src/main.c b/src/main.c
+index aef54d6..f1571f3 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -228,7 +228,6 @@ processOptions( int argc, char **argv )
+     char              text[1024];
+     unsigned long     flags, flagsMask;
+     char              *options[NOPTIONS];
+-    int                       nbytes;
+     int                       i;
+@@ -295,7 +294,7 @@ OPTIONS\n\
+     for( i=0; i < NOPTIONS; i++)
+       options[i] = NULL;
+-    nbytes = readOptionsFromFile( options, &flags, &flagsMask, text, 1024,
++    readOptionsFromFile( options, &flags, &flagsMask, text, 1024,
+                                   config_file);
+     /* Initialize  the global xnots_t structure. */
+diff --git a/src/xnots.h b/src/xnots.h
+index 52316fe..6b9f577 100644
+--- a/src/xnots.h
++++ b/src/xnots.h
+@@ -330,6 +330,7 @@ void               correctNoteGeometry     ( Note          *note,
+                                         unsigned      height
+                                       );
+ void          correctNoteHeight       ( Note *note );
++extern
+ inline void   resetNoteWidth          ( Note *note );
+ void          freeNote                ( Note *note );
+ void          showNotes               ();
diff --git a/x11-misc/xnots/xnots-0.2.1-r2.ebuild b/x11-misc/xnots/xnots-0.2.1-r2.ebuild
new file mode 100644 (file)
index 0000000..89500bf
--- /dev/null
@@ -0,0 +1,58 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="A desktop sticky note program for the unix geek"
+HOMEPAGE="http://xnots.sourceforge.net https://github.com/thePalindrome/xnots"
+SRC_URI="mirror://sourceforge/xnots/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="vim-syntax"
+
+RDEPEND="
+       x11-libs/libX11
+       x11-libs/libXext
+       x11-libs/libXrandr
+       x11-libs/libXrender
+       x11-libs/pango[X]
+"
+
+DEPEND="
+       ${RDEPEND}
+       virtual/pkgconfig
+       x11-proto/randrproto
+       x11-proto/renderproto
+       x11-proto/xextproto
+"
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.2.1-gcc6.patch
+)
+
+src_prepare() {
+       default
+
+       sed -i -e 's|LICENCE||g' Makefile || die
+
+       append-cflags -std=gnu89
+}
+
+src_compile() {
+       emake CC="$(tc-getCC)" NO_DEBUG=1
+}
+
+src_install() {
+       emake \
+               DESTDIR="${D}" \
+               docdir=/usr/share/doc/${PF} \
+               mandir=/usr/share/man \
+               prefix=/usr \
+               install
+       if use vim-syntax; then
+               insinto /usr/share/vim/vimfiles/syntax
+               doins etc/xnots.vim
+       fi
+}