GCC-11 compatibility for xc3sprog

This commit is contained in:
layman 2021-05-18 11:08:43 +02:00
parent 39a88ca39d
commit 572b933b01
3 changed files with 60 additions and 6 deletions

View File

@ -1 +1,2 @@
EBUILD xc3sprog-9999.ebuild 906 BLAKE2B 9724e44d038605e3db97343299c70195cf8becd1a44d804bbc5a6ffffa2869935797bb22a27c1786b5b62048debeabd40fa7c514b9721cf9179a8432e4bd338e SHA512 e8c218fba5bcdea224cced84b883b07ec4588e057045f84bd3c72400996a15ac2b6a5ec436e35af1fb34ff14db4e117fd3dc57b61a767ffeafdf9e9bcf6ffd7a AUX xc3sprog-9999-gcc-11.patch 1103 BLAKE2B da8c9b3740eedeb7694060c00f599871dd1f6ca5de26733f016e7d8574dd1db1114549c291a67c4d0b07fa83ae7f07b8d0930c349b35be5aeaba770501c37b38 SHA512 dba3a7f773ee513a6c81da24d86d23f7f94956b90fb30f1285e4fa590913bb19cc4cd91fcf27dd7d5ef936cbcc76cbf653987c3b949983d2d6c80f193ba22008
EBUILD xc3sprog-9999.ebuild 1195 BLAKE2B 171be31e807e596c38e804747eb444c94afbf037669ecf6c6e7d8ebae2d78ff80432f278864194b750b4a569991e93f97ddc85b403a9a720195e590929d12ece SHA512 a3febbb423f6c2a804e5dc081888d2f1a09285bffc12741088b26a632f00132e6ea5b1087446dae0735cd36bf19b081e0ccd296a923cdb03b110c820ae5d0d6b

View File

@ -0,0 +1,41 @@
diff -urN xc3sprog-9999.orig/bitfile.cpp xc3sprog-9999/bitfile.cpp
--- xc3sprog-9999.orig/bitfile.cpp 2021-05-18 10:59:54.579686957 +0200
+++ xc3sprog-9999/bitfile.cpp 2021-05-18 11:05:54.542944129 +0200
@@ -35,7 +35,7 @@
#include <time.h>
#include "bitrev.h"
-using namespace std;
+//using namespace std;
BitFile::BitFile()
: length(0)
@@ -607,14 +607,14 @@
return clip;
}
-void BitFile::error(const string &str)
+void BitFile::error(const std::string &str)
{
errorStr=str;
Error=true;
fprintf(logfile,"%s\n",str.c_str());
}
-void BitFile::readField(string &field, FILE *fp)
+void BitFile::readField(std::string &field, FILE *fp)
{
byte t[2];
fread(t,1,2,fp);
diff -urN xc3sprog-9999.orig/srecfile.cpp xc3sprog-9999/srecfile.cpp
--- xc3sprog-9999.orig/srecfile.cpp 2021-05-18 10:59:54.613019051 +0200
+++ xc3sprog-9999/srecfile.cpp 2021-05-18 11:06:12.015624765 +0200
@@ -28,7 +28,7 @@
#include <string.h>
#include <stdlib.h>
-using namespace std;
+//using namespace std;
int SrecFile::DecodeSRecordLine(char *source, unsigned char *dest, S_Record *SRec)
{

View File

@ -2,10 +2,10 @@
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# $Header: $ # $Header: $
EAPI=5 EAPI=7
ESVN_REPO_URI="svn://svn.code.sf.net/p/xc3sprog/code/trunk" EGIT_REPO_URI="https://github.com/matrix-io/xc3sprog.git"
inherit subversion cmake-utils inherit git-r3 cmake-utils toolchain-funcs
DESCRIPTION="A suite of utilities for programming Xilinx FPGAs, CPLDs, and EEPROMs" DESCRIPTION="A suite of utilities for programming Xilinx FPGAs, CPLDs, and EEPROMs"
HOMEPAGE="http://xc3sprog.sourceforge.net/" HOMEPAGE="http://xc3sprog.sourceforge.net/"
@ -22,12 +22,24 @@ RDEPEND="${DEPEND}"
src_prepare() { src_prepare() {
sed -i -e '/if(EXISTS/a set(VERSION_STRING "Gentoo")' \ sed -i -e '/if(EXISTS/a set(VERSION_STRING "Gentoo")' \
-e '/if(EXISTS/,/endif(EXISTS/d' CMakeLists.txt || die -e '/if(EXISTS/,/endif(EXISTS/d' \
-e 's/"Use WiringPi" ON/"Use WiringPi" OFF/' \
CMakeLists.txt || die
sed -i -e 's#usr/lib#opt/lib64#' FindlibFTD2XX.cmake || die sed -i -e 's#usr/lib#opt/lib64#' FindlibFTD2XX.cmake || die
if [ $(gcc-major-version) -gt "10" ]; then
eapply "${FILESDIR}/${P}-gcc-11.patch"
fi
cmake-utils_src_prepare
default
} }
src_configure() { src_configure() {
local mycmakeargs=( local mycmakeargs=(
$(cmake-utils_use_use ftd2xx) -DLIBFTDI_INCLUDE_DIR=/usr/include/libftdi1
-DLIBFTDI_LIBRARIES=/usr/$(get_libdir)/libftdi1.so
-DUSE_FTD2XX="$(usex ftd2xx)"
) )
cmake-utils_src_configure cmake-utils_src_configure
} }