From 2de8614619fff4b70366a455899e3136f0b38bef Mon Sep 17 00:00:00 2001 From: Heinz Wiesinger Date: Sat, 6 Feb 2016 22:23:25 +0100 Subject: libraries/barry: Fix build on 14.2. Signed-off-by: Heinz Wiesinger --- libraries/barry/README | 6 +- libraries/barry/barry.SlackBuild | 24 ++-- libraries/barry/c++11.patch | 240 +++++++++++++++++++++++++++++++++++ libraries/barry/fix-sizeof-use.patch | 30 +++++ 4 files changed, 280 insertions(+), 20 deletions(-) create mode 100644 libraries/barry/c++11.patch create mode 100644 libraries/barry/fix-sizeof-use.patch diff --git a/libraries/barry/README b/libraries/barry/README index b9b10a51d5..03263749ba 100644 --- a/libraries/barry/README +++ b/libraries/barry/README @@ -3,8 +3,4 @@ comes with a command line tool for exploring the device and a GUI for making quick backups. This project's goal is to create a fully functional syncing mechanism on Linux. -FYI, this slackbuild can take a variable of OPENSYNC (in addition to the -standard ARCH, TMP, BUILD, etc.), by default compiling barry with opensync -is disabled. passing OPENSYNC= will compile barry -with opensync support, which will require that opensync already be installed -(libopensync is in the SBo repository as well) +This optionally depends on libxml++ for the ALX parser. diff --git a/libraries/barry/barry.SlackBuild b/libraries/barry/barry.SlackBuild index 589c174854..7948654cda 100644 --- a/libraries/barry/barry.SlackBuild +++ b/libraries/barry/barry.SlackBuild @@ -7,16 +7,13 @@ ## http://sourceforge.net/projects/barry/ ## ## Written by "Vincent Batts " -## -## opensync consideration added thanks -## to "Heinz Wiesinger " # Modified by Robby Workman # Modified by Mario Preksavec PRGNAM=barry VERSION=${VERSION:-0.18.3} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -37,14 +34,6 @@ OUTPUT=${OUTPUT:-/tmp} # BARRY_GROUP=barry ./barry.SlackBuild BARRY_GROUP=${BARRY_GROUP:-plugdev} -# Enable opensync-plugin? -OPENSYNC=${OPENSYNC:-no} - -case "$OPENSYNC" in - no) opensync_opt="dis" ;; - *) opensync_opt="en" ;; -esac - if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" @@ -77,8 +66,14 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ +# Debian fixes +patch -p1 -i $CWD/fix-sizeof-use.patch + +# Fix C++11 compatibilty (taken from Arch) +patch -p1 -i $CWD/c++11.patch + +CFLAGS="$SLKCFLAGS -std=c++11" \ +CXXFLAGS="$SLKCFLAGS -std=c++11" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ @@ -86,7 +81,6 @@ CXXFLAGS="$SLKCFLAGS" \ --disable-static \ --enable-boost \ --enable-gui \ - --${opensync_opt}able-opensync-plugin \ --build=$ARCH-slackware-linux make diff --git a/libraries/barry/c++11.patch b/libraries/barry/c++11.patch new file mode 100644 index 0000000000..89373392c6 --- /dev/null +++ b/libraries/barry/c++11.patch @@ -0,0 +1,240 @@ +diff -Nur original/desktop/src/xmlmap.cc modified/desktop/src/xmlmap.cc +--- original/desktop/src/xmlmap.cc 2013-04-05 07:49:43.000000000 +0100 ++++ modified/desktop/src/xmlmap.cc 2015-10-24 17:02:59.792298395 +0100 +@@ -540,14 +540,14 @@ + np.SortBySummary(); + cout << "\n\nCute summary:\n"; + for_each(np.begin(), np.priority_end(), +- bind( mem_fn(&XmlNodeMapping::DumpSummaries), +- _1, ref(cout))); ++ std::bind( std::mem_fn(&XmlNodeMapping::DumpSummaries), ++ _1, std::ref(cout))); + + np.SortByPath(); + cout << "\n\nCute summary:\n"; + for_each(np.begin(), np.priority_end(), +- bind( mem_fn(&XmlNodeMapping::DumpSummaries), +- _1, ref(cout))); ++ std::bind( std::mem_fn(&XmlNodeMapping::DumpSummaries), ++ _1, std::ref(cout))); + } + catch( Glib::ConvertError &e ) { + cerr << e.what() << endl; +diff -Nur original/tools/bio.cc modified/tools/bio.cc +--- original/tools/bio.cc 2013-04-05 07:49:43.000000000 +0100 ++++ modified/tools/bio.cc 2015-10-24 16:50:04.487574052 +0100 +@@ -869,7 +869,7 @@ + class App + { + public: +- typedef shared_ptr OutputPtr; ++ typedef std::shared_ptr OutputPtr; + typedef vector OutputsType; + + private: +diff -Nur original/tools/btool.cc modified/tools/btool.cc +--- original/tools/btool.cc 2013-04-05 07:49:43.000000000 +0100 ++++ modified/tools/btool.cc 2015-10-24 16:50:04.487574052 +0100 +@@ -284,7 +284,7 @@ + } + }; + +-shared_ptr GetParser(const string &name, ++std::shared_ptr GetParser(const string &name, + const string &filename, + bool null_parser, + bool immediate_display, +@@ -296,139 +296,139 @@ + + if( null_parser ) { + // use null parser +- return shared_ptr( new Barry::HexDumpParser(cout) ); ++ return std::shared_ptr( new Barry::HexDumpParser(cout) ); + } + else if( bbackup_mode ) { + #ifdef __BARRY_BACKUP_MODE__ + // Only one backup file per run +- static shared_ptr backup; ++ static std::shared_ptr backup; + if( !backup.get() ) { + backup.reset( new Backup(filename) ); + } + return backup; + #else +- return shared_ptr( new Barry::HexDumpParser(cout) ); ++ return std::shared_ptr( new Barry::HexDumpParser(cout) ); + #endif + } + // check for recognized database names + else if( name == Contact::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == Message::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == Calendar::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == CalendarAll::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == CallLog::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == Bookmark::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == ServiceBook::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + + else if( name == Memo::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == Task::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == PINMessage::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == SavedMessage::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == Sms::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == Folder::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == TimeZone::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == HandheldAgent::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else { + // unknown database, use null parser +- return shared_ptr( new Barry::HexDumpParser(cout) ); ++ return std::shared_ptr( new Barry::HexDumpParser(cout) ); + } + } + +-shared_ptr GetBuilder(const string &name, const string &filename) ++std::shared_ptr GetBuilder(const string &name, const string &filename) + { + // check for recognized database names + if( name == Contact::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordBuilder > ( + new Store(filename, true, true, false))); + } + else if( name == Calendar::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordBuilder > ( + new Store(filename, true, true, false))); + } + else if( name == CalendarAll::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordBuilder > ( + new Store(filename, true, true, false))); + } + else if( name == Memo::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordBuilder > ( + new Store(filename, true, true, false))); + } + else if( name == Task::GetDBName() ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordBuilder > ( + new Store(filename, true, true, false))); + } + /* + else if( name == "Messages" ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, true, true, false))); + } + else if( name == "Service Book" ) { +- return shared_ptr( ++ return std::shared_ptr( + new RecordParser > ( + new Store(filename, true, true, false))); + } +@@ -942,7 +942,7 @@ + } + + unsigned int id = desktop.GetDBID(dbNames[0]); +- shared_ptr parse = GetParser(dbNames[0],filename, ++ std::shared_ptr parse = GetParser(dbNames[0],filename, + null_parser, true, vformat_mode, bbackup_mode); + + for( unsigned int i = 0; i < stCommands.size(); i++ ) { +@@ -968,7 +968,7 @@ + vector::iterator b = dbNames.begin(); + + for( ; b != dbNames.end(); b++ ) { +- shared_ptr parse = GetParser(*b, ++ std::shared_ptr parse = GetParser(*b, + filename, null_parser, !sort_records, + vformat_mode, bbackup_mode); + unsigned int id = desktop.GetDBID(*b); +@@ -1000,7 +1000,7 @@ + vector::iterator b = saveDbNames.begin(); + + for( ; b != saveDbNames.end(); b++ ) { +- shared_ptr build = GetBuilder(*b, ++ std::shared_ptr build = GetBuilder(*b, + filename); + unsigned int id = desktop.GetDBID(*b); + desktop.SaveDatabase(id, *build); diff --git a/libraries/barry/fix-sizeof-use.patch b/libraries/barry/fix-sizeof-use.patch new file mode 100644 index 0000000000..a3d516e3a3 --- /dev/null +++ b/libraries/barry/fix-sizeof-use.patch @@ -0,0 +1,30 @@ +Description: Fix sizeof(pointer) to be sizeof(buffer_pointed_to) +Author: Olly Betts +Forwarded: no +Last-Update: 2014-08-14 + +--- a/src/vformat.c ++++ b/src/vformat.c +@@ -1881,11 +1881,11 @@ + + //static unsigned char _evc_base64_rank[256]; + +-static void base64_init(char *rank) ++static void base64_init(char *rank, size_t len) + { + int i; + +- memset(rank, 0xff, sizeof(rank)); ++ memset(rank, 0xff, len); + for (i=0;i<64;i++) { + rank[(unsigned int)base64_alphabet[i]] = i; + } +@@ -2011,7 +2011,7 @@ + static size_t base64_decode_step(const unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save) + { + unsigned char base64_rank[256]; +- base64_init((char*)base64_rank); ++ base64_init((char*)base64_rank, sizeof(base64_rank)); + + register const unsigned char *inptr; + register unsigned char *outptr; -- cgit v1.2.3