dev-db/xbase: Fix gcc6/7 support (#594174 by Peter Levine), port to eapi6.
authorPacho Ramos <pacho@gentoo.org>
Sat, 8 Apr 2017 10:19:18 +0000 (12:19 +0200)
committerPacho Ramos <pacho@gentoo.org>
Sat, 8 Apr 2017 10:28:05 +0000 (12:28 +0200)
Package-Manager: Portage-2.3.5, Repoman-2.3.2

dev-db/xbase/files/xbase-3.1.2-gcc6.patch [new file with mode: 0644]
dev-db/xbase/files/xbase-3.1.2-gcc7.patch [new file with mode: 0644]
dev-db/xbase/xbase-3.1.2.ebuild

diff --git a/dev-db/xbase/files/xbase-3.1.2-gcc6.patch b/dev-db/xbase/files/xbase-3.1.2-gcc6.patch
new file mode 100644 (file)
index 0000000..8dd4cda
--- /dev/null
@@ -0,0 +1,49 @@
+diff -up xbase64-3.1.2/xbase64/xblock.cpp.gcc6 xbase64-3.1.2/xbase64/xblock.cpp
+--- xbase64-3.1.2/xbase64/xblock.cpp.gcc6      2016-02-16 16:06:40.146864585 -0500
++++ xbase64-3.1.2/xbase64/xblock.cpp   2016-02-16 16:07:51.137342339 -0500
+@@ -84,7 +84,7 @@ xbLock::xbLock(xbDbf * pdbf)
+   TableLockCnt = 0;
+   MemoLockCnt  = 0;
+   IndexLockCnt = 0;
+-  std::cout << "xbLock constructor" << std::cout;
++  std::cout << "xbLock constructor";
+ }
+ /*************************************************************************/
+ xbLock::~xbLock()
+@@ -169,7 +169,7 @@ else if( LockType == XB_LOCK || LockType
+ /*************************************************************************/
+ xbaseLock::xbaseLock( xbDbf * pdbf ) : xbLock( pdbf )
+ {
+-  std::cout << "xbaseLock constructor" << std::cout;
++  std::cout << "xbaseLock constructor";
+ }
+ /*************************************************************************/
+ xbShort xbaseLock::LockTableHeader( xbShort LockType )
+@@ -336,7 +336,7 @@ xbShort xbaseLock::LockInit()
+ /*************************************************************************/
+ dbaseLock::dbaseLock( xbDbf * pdbf ) : xbLock( pdbf )
+ {
+-  std::cout << "dbaseLock constructor" << std::cout;
++  std::cout << "dbaseLock constructor";
+ }
+ /*************************************************************************/
+ xbShort dbaseLock::LockTableHeader( xbShort LockType )
+@@ -460,7 +460,7 @@ xbShort dbaseLock::UnlockAll()
+ /*************************************************************************/
+ clipperLock::clipperLock( xbDbf * pdbf ) : xbLock( pdbf )
+ {
+-  std::cout << "clipperLock constructor" << std::cout;
++  std::cout << "clipperLock constructor";
+ }
+ /*************************************************************************/
+ xbShort clipperLock::LockTableHeader( xbShort LockType )
+@@ -523,7 +523,7 @@ xbShort clipperLock::UnlockAll()
+ /*************************************************************************/
+ foxproLock::foxproLock( xbDbf * pdbf ) : xbLock( pdbf )
+ {
+-  std::cout << "foxproLock constructor" << std::cout;
++  std::cout << "foxproLock constructor";
+ }
+ /*************************************************************************/
+ xbShort foxproLock::LockTableHeader( xbShort LockType )
+diff -up xbase64-3.1.2/xbase64/xblock.h.gcc6 xbase64-3.1.2/xbase64/xblock.h
diff --git a/dev-db/xbase/files/xbase-3.1.2-gcc7.patch b/dev-db/xbase/files/xbase-3.1.2-gcc7.patch
new file mode 100644 (file)
index 0000000..119fb59
--- /dev/null
@@ -0,0 +1,34 @@
+diff -up xbase64-3.1.2/bin/dbfutil1.cpp.gcc7 xbase64-3.1.2/bin/dbfutil1.cpp
+--- xbase64-3.1.2/bin/dbfutil1.cpp.gcc7        2017-02-20 09:59:36.135561103 -0500
++++ xbase64-3.1.2/bin/dbfutil1.cpp     2017-02-20 10:00:32.743218194 -0500
+@@ -157,7 +157,8 @@ void  MyClass::SetFilter()
+   memset( Expression, 0x00, 512 );
+   while( !strlen( Expression )){
+     std::cout << "Enter filter expression (like AMOUNT<5)" << std::endl;
+-    gets( Expression );
++    fgets( Expression, sizeof(Expression), stdin );
++    strtok( Expression, "\n" );
+   }
+   if( xbf )
+     delete xbf;
+@@ -247,7 +248,8 @@ void MyClass::ProcessExpression()
+   while( !strstr( exprsn, "QUIT" ) && !strstr( exprsn, "quit" )){
+     std::cout << ">";
+-    gets( exprsn );
++    fgets( exprsn, sizeof(exprsn), stdin );
++    strtok( exprsn, "\n" );
+     if( strstr( exprsn, "HELP" ) || strstr( exprsn, "help" )){
+       std::cout << "** Command Help ***"    << std::endl << std::endl;
+diff -up xbase64-3.1.2/xbase64/xbase64.h.gcc7 xbase64-3.1.2/xbase64/xbase64.h
+--- xbase64-3.1.2/xbase64/xbase64.h.gcc7       2017-02-20 09:49:07.063609482 -0500
++++ xbase64-3.1.2/xbase64/xbase64.h    2017-02-20 09:57:36.586618723 -0500
+@@ -53,6 +53,7 @@
+ #endif
+ #include <string.h>
++#include <cstdio>
+ #if defined(__WIN32__)
+ #include "windows.h"
index fda7955bdacfb7908890cb239a8f6defd5ca2c9c..eba9889c70a04c3b75aae55fa35873907d7aacc5 100644 (file)
@@ -1,9 +1,8 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=4
-AUTOTOOLS_AUTORECONF=no
-inherit autotools-utils
+EAPI=6
+inherit autotools ltprune
 
 DESCRIPTION="xbase (i.e. dBase, FoxPro, etc.) compatible C++ class library"
 HOMEPAGE="http://linux.techass.com/projects/xdb/"
@@ -17,18 +16,32 @@ IUSE="doc static-libs"
 S="${WORKDIR}"/${PN}64-${PV}
 
 PATCHES=(
-               "${FILESDIR}"/${P}-fixconfig.patch
-               "${FILESDIR}"/${P}-gcc44.patch
-               "${FILESDIR}"/${PN}-2.0.0-ppc.patch
-               "${FILESDIR}"/${P}-xbnode.patch
-               "${FILESDIR}"/${P}-lesserg.patch
-               "${FILESDIR}"/${P}-outofsource.patch
-               "${FILESDIR}"/${P}-gcc47.patch
-               "${FILESDIR}"/${P}-gcc-version.patch
+       "${FILESDIR}"/${P}-fixconfig.patch
+       "${FILESDIR}"/${P}-gcc44.patch
+       "${FILESDIR}"/${PN}-2.0.0-ppc.patch
+       "${FILESDIR}"/${P}-xbnode.patch
+       "${FILESDIR}"/${P}-lesserg.patch
+       "${FILESDIR}"/${P}-outofsource.patch
+       "${FILESDIR}"/${P}-gcc47.patch
+       "${FILESDIR}"/${P}-gcc-version.patch
+       "${FILESDIR}"/${P}-gcc6.patch
+       "${FILESDIR}"/${P}-gcc7.patch
 )
 
+src_prepare() {
+       default
+       mv configure.in configure.ac || die
+       eautoreconf
+}
+
+src_configure() {
+       econf $(use_enable static-libs static)
+}
+
 src_install() {
-       autotools-utils_src_install
+       default
+       prune_libtool_files
+
        # media-tv/linuxtv-dvb-apps collision, bug #208596
        mv "${ED}/usr/bin/zap" "${ED}/usr/bin/${PN}-zap" || die