diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-05-30 11:44:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-05-30 11:44:06 +0100 |
commit | f516638b7fe9592837389826a6152a7e1b251c54 (patch) | |
tree | 8bfecb640b7b6403d7a3d662d923eed630033da7 /sci-libs/liborigin | |
parent | 1a61119f9f7b057830e2ce0563f913ec86f282ad (diff) |
gentoo resync : 30.05.2020
Diffstat (limited to 'sci-libs/liborigin')
-rw-r--r-- | sci-libs/liborigin/Manifest | 10 | ||||
-rw-r--r-- | sci-libs/liborigin/files/liborigin-3.0.0-buildsystem.patch | 166 | ||||
-rw-r--r-- | sci-libs/liborigin/files/liborigin-3.0.0-missing-header.patch | 38 | ||||
-rw-r--r-- | sci-libs/liborigin/files/liborigin-3.0.0-no-exit-calls.patch | 89 | ||||
-rw-r--r-- | sci-libs/liborigin/files/liborigin-3.0.0-no-standard-streams.patch | 210 | ||||
-rw-r--r-- | sci-libs/liborigin/liborigin-20110829-r1.ebuild | 62 | ||||
-rw-r--r-- | sci-libs/liborigin/liborigin-3.0.0.ebuild | 55 | ||||
-rw-r--r-- | sci-libs/liborigin/metadata.xml | 6 |
8 files changed, 568 insertions, 68 deletions
diff --git a/sci-libs/liborigin/Manifest b/sci-libs/liborigin/Manifest index eac5f8b29a66..11d8ea4e43a6 100644 --- a/sci-libs/liborigin/Manifest +++ b/sci-libs/liborigin/Manifest @@ -1,3 +1,7 @@ -DIST liborigin2-20110829.zip 158364 BLAKE2B fb6902142fe20bd29c8f3dd4c6d0c77b6f94e66f082c6950809367a4049adc1092a5e1abc2705670a15a32d1d680c14fc05061d34d422cd55689bb778ee47fde SHA512 d0e4013a686fbc61c58b1f39e98aace91978bcadffbb2ef9d32576a3b2f19cc2443d595da2d3ecc19298ec6e29c20717db94e1fda6a64d71f3763841228a01c0 -EBUILD liborigin-20110829-r1.ebuild 1181 BLAKE2B 4cfd8ff280f87fca3ce4e7694b53e68651350f91146a133378d12c93e3de134b18eb1039f92b1ec4bf7d674b427c358858e1498e7f69233d14018df66c8c7577 SHA512 aad74ef776c84779083810f0a897983409d67f3036e7d2e56f888c1a95ac4e75f02f2a0ff8c72165af57fb700513873114c86ad8b78316043be2cbfc5428f1ba -MISC metadata.xml 344 BLAKE2B d186e3d34368240a8e4657f548d1c3e75b0d6efd7f6e185bd5dcabf2bbd42dbfdc6c65940cb9174eea3807b5e409018afc9dc4e2822ae880c0bfba70f53c01c8 SHA512 b673614f7818521f487094df5b41a804e9e3b8cce6bfe3166b64efed3230dbdf46ef8a0d3742ccef1039bf04e6ed76b20dfe168d29a620a270b6524b18735807 +AUX liborigin-3.0.0-buildsystem.patch 5563 BLAKE2B c9905687284e0a81b504d765ff237bc89c0023816c7ac1a8636971ff43db62d894b3add5d5d3427966ff627125fbd524240d2fa3f9da716c221d87dc83eb44d0 SHA512 2d63a85c22f86a30b11414712c0d7b4871332e83c81a1995cb8efb8cfd717ab15747ab70f178808b8191379bc49b1f0219f87f0112c97e51d044d1f454fd6e75 +AUX liborigin-3.0.0-missing-header.patch 978 BLAKE2B 717a5bc981d5695688a5ae588c87da7501fa97e76fc8df4a71da57021d75a8e33c8696ea9ef606854a8943431debc0fcb998913f4d09ddd7833e6c7029ad83b0 SHA512 d515977558b0938a0d0453a6c1e4c9c506a7cafeeac39cc881d748ca3d8ff0e6153f8552b2efd5f2c0e478bf8b2075fc225bfc1d0b9f4542c3b6848918e88203 +AUX liborigin-3.0.0-no-exit-calls.patch 2452 BLAKE2B d635890d02f2605d52b869e09522bbb2aae9062eee9403c0f6e9639620229f983dc1031301d926617b63dbfa8cb0c163988119cf17b82db1786425499efe56bf SHA512 db491659f27168c2a4ce27517abcf5464fdc75ca9356500dde7a22987f5a766015e843c1b0c0b4f3d9bbf74c53d7b840a9aab64090173c2433e1176eefc816ec +AUX liborigin-3.0.0-no-standard-streams.patch 7649 BLAKE2B 2f9c933d2d6ee65477ac0e23ad317d3b569bfe4eb37876c954501b93cf17be67cd1f3070724762a30c9bc1f9687880a5f5da8513e3cce4e2ae365ec1401c9123 SHA512 31f64c5a9c7156d19f2109be2768e4bae24b0547416da372b4c7dac24fbe6a026c3767372f778823f053af1bd4a2b85160457ebb101f06c22e2add4e15bb1d04 +DIST liborigin-3.0.0.tar.gz 156736 BLAKE2B 1c1fda3fc3ad47394b65637a808eca1ecf4cff19eb49de0811e50d395c3b7759f8ec19c680ed83f7a8191022aa17b4ba1211baa6ea16a48a5153736d9138ed5c SHA512 1cf00ec33a90b4baede0cd3b2a3e6d78ca4810511c6be58c4d1cce12e7e1001752422fe2ddbca80cd9016b91c5321eca1ab43606ace3acc21955a034ebc4094c +EBUILD liborigin-3.0.0.ebuild 1205 BLAKE2B 798155fe1038866179902f488192429ac9543bbc8504a3939a8e795fea8498f60157626f2b01748b4e0fcf3b843261004da7fba4695de618b3117fb1430ca7ab SHA512 8bf0e3b0801b6381b0fb50cc4923f357e88c8103f4003aa22c926f38a5c3abf37ecd366fbc1cf9001c45f96a140268dca438903b4bba822eb4e5c17e398ada34 +MISC metadata.xml 330 BLAKE2B 1327fe176e03cb3f671b64e5a20efbabb375773c4c3633367feef929feeca52c835fb313a7cb315fb96d29f38ec26c6144f41af43b83957a22ba9a3ddd420bb8 SHA512 1eabc021a57d8928ca58b415f906293576c225aedb9f5fc88f8ad247d2a08a9e16650b2693cee1636d011b3f03cdf1255f125feb8f8fb7f55413baf1d519a6be diff --git a/sci-libs/liborigin/files/liborigin-3.0.0-buildsystem.patch b/sci-libs/liborigin/files/liborigin-3.0.0-buildsystem.patch new file mode 100644 index 000000000000..d8444dedafed --- /dev/null +++ b/sci-libs/liborigin/files/liborigin-3.0.0-buildsystem.patch @@ -0,0 +1,166 @@ +From a751f00ebba9fa226860ed4e2c1ae5fa35622e89 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Wed, 20 May 2020 22:33:08 +0200 +Subject: [PATCH 1/4] Don't install bundled tree.hh + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 17c613b..a6b4b8a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,7 +25,6 @@ set (devel-headers + OriginObj.h + OriginFile.h + OriginParser.h +- tree.hh + ) + + # LIB_SUFFIX can either be defined at cmake command line: cmake -DLIB_SUFFIX:STRING=64 ... +-- +2.26.2 + + +From 0b4fa1ce0946bc293d798484c609c6a7ac5ab50a Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Wed, 20 May 2020 22:35:02 +0200 +Subject: [PATCH 2/4] No static target, compile opj2dat against the shared lib + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + CMakeLists.txt | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a6b4b8a..6f2d87b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -52,22 +52,16 @@ set_target_properties(origin PROPERTIES + VERSION ${LIBORIGIN_VERSION_MAJOR}.${LIBORIGIN_VERSION_MINOR}.${LIBORIGIN_VERSION_BUGFIX} + SOVERSION ${LIBORIGIN_VERSION_MAJOR} ) + +-# static library +-add_library (origin-static STATIC ${sources}) +-set_target_properties(origin-static PROPERTIES OUTPUT_NAME "origin" POSITION_INDEPENDENT_CODE ON) +- + # inform on log setting + if (DEFINED GENERATE_CODE_FOR_LOG) + message("File parsing will be logged.") + target_compile_definitions(origin PRIVATE GENERATE_CODE_FOR_LOG=${GENERATE_CODE_FOR_LOG}) +- target_compile_definitions(origin-static PRIVATE GENERATE_CODE_FOR_LOG=${GENERATE_CODE_FOR_LOG}) + else() + message("File parsing will NOT be logged. Define GENERATE_CODE_FOR_LOG to activate logging.") + endif () + + # install libraries + install(TARGETS origin DESTINATION lib${LIB_SUFFIX} OPTIONAL) +-install(TARGETS origin-static DESTINATION lib${LIB_SUFFIX} OPTIONAL) + + # install headers + install(FILES ${devel-headers} DESTINATION include/liborigin) +@@ -77,7 +71,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liborigin.pc DESTINATION lib${LIB_SUFF + + # command line util + add_executable(opj2dat opj2dat.cpp) +-target_link_libraries (opj2dat origin-static) ++target_link_libraries (opj2dat origin) + + install(TARGETS opj2dat DESTINATION bin OPTIONAL) + +-- +2.26.2 + + +From 5f4c497408a6f144e581dd17fb3e49963e8b6b2b Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Wed, 20 May 2020 22:43:52 +0200 +Subject: [PATCH 3/4] Don't install README COPYING etc., distro package does + that + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6f2d87b..4fc16e0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,6 @@ target_link_libraries (opj2dat origin) + install(TARGETS opj2dat DESTINATION bin OPTIONAL) + + # documentation +-install(FILES COPYING FORMAT README DESTINATION share/doc/liborigin OPTIONAL) + configure_file(doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + find_package(Doxygen) + if(DOXYGEN_FOUND) +-- +2.26.2 + + +From bb554d88b78e7575c04cf3e79098f35b776c3878 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Wed, 20 May 2020 22:47:22 +0200 +Subject: [PATCH 4/4] Drop 'OPTIONAL' from install targets, add ENABLE_TOOLS + option + +I've never seen an optional install of library. +ENABLE_TOOLS takes care of the binary. +Doxygen is already optional. + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + CMakeLists.txt | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4fc16e0..1759eee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,6 +9,8 @@ set(LIBORIGIN_VERSION_MAJOR 3) + set(LIBORIGIN_VERSION_MINOR 0) + set(LIBORIGIN_VERSION_BUGFIX 0) + ++option(ENABLE_TOOLS "Install opj2dat command line util" ON) ++ + # compile-time configuration variables to be linked in + configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) +@@ -61,7 +63,7 @@ else() + endif () + + # install libraries +-install(TARGETS origin DESTINATION lib${LIB_SUFFIX} OPTIONAL) ++install(TARGETS origin DESTINATION lib${LIB_SUFFIX}) + + # install headers + install(FILES ${devel-headers} DESTINATION include/liborigin) +@@ -70,10 +72,12 @@ install(FILES ${devel-headers} DESTINATION include/liborigin) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liborigin.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig) + + # command line util +-add_executable(opj2dat opj2dat.cpp) +-target_link_libraries (opj2dat origin) ++if(ENABLE_TOOLS) ++ add_executable(opj2dat opj2dat.cpp) ++ target_link_libraries (opj2dat origin) + +-install(TARGETS opj2dat DESTINATION bin OPTIONAL) ++ install(TARGETS opj2dat DESTINATION bin) ++endif() + + # documentation + configure_file(doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) +@@ -82,5 +86,5 @@ if(DOXYGEN_FOUND) + add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/html) +- install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc/liborigin OPTIONAL) ++ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc/liborigin) + endif(DOXYGEN_FOUND) +-- +2.26.2 + diff --git a/sci-libs/liborigin/files/liborigin-3.0.0-missing-header.patch b/sci-libs/liborigin/files/liborigin-3.0.0-missing-header.patch new file mode 100644 index 000000000000..162dd93c3c5e --- /dev/null +++ b/sci-libs/liborigin/files/liborigin-3.0.0-missing-header.patch @@ -0,0 +1,38 @@ +From 78da3c4456cef15c91b5e5fcc1e82ca2364ea654 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Wed, 20 May 2020 22:28:21 +0200 +Subject: [PATCH] Add missing header + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + OriginAnyParser.cpp | 1 + + opj2dat.cpp | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/OriginAnyParser.cpp b/OriginAnyParser.cpp +index 07a619e..c90f6e4 100644 +--- a/OriginAnyParser.cpp ++++ b/OriginAnyParser.cpp +@@ -22,6 +22,7 @@ + #include "OriginAnyParser.h" + #include <sstream> + #include <cinttypes> ++#include <iostream> + + /* define a macro to get an int (or uint) from a istringstream in binary mode */ + #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +diff --git a/opj2dat.cpp b/opj2dat.cpp +index 230ac84..67b0815 100644 +--- a/opj2dat.cpp ++++ b/opj2dat.cpp +@@ -31,6 +31,7 @@ + #include <cmath> + #include <fstream> + #include <sstream> ++#include <iostream> + #include <string> + + using namespace std; +-- +2.26.2 + diff --git a/sci-libs/liborigin/files/liborigin-3.0.0-no-exit-calls.patch b/sci-libs/liborigin/files/liborigin-3.0.0-no-exit-calls.patch new file mode 100644 index 000000000000..44b56a296fde --- /dev/null +++ b/sci-libs/liborigin/files/liborigin-3.0.0-no-exit-calls.patch @@ -0,0 +1,89 @@ +From a8b25b489b48086e2616df98688969f89e63fa69 Mon Sep 17 00:00:00 2001 +From: Miquel Garriga <gbmiquel@gmail.com> +Date: Fri, 23 Nov 2018 00:15:04 +0100 +Subject: [PATCH] Remove exit() calls + +--- + OriginFile.cpp | 15 ++++++++++----- + OriginFile.h | 2 +- + opj2dat.cpp | 2 ++ + 3 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/OriginFile.cpp b/OriginFile.cpp +index f6c41b4..bcdcccb 100644 +--- a/OriginFile.cpp ++++ b/OriginFile.cpp +@@ -33,14 +33,15 @@ + #include <string> + + OriginFile::OriginFile(const string& fileName) +-: fileVersion(0) ++: fileVersion(0), ioError(0) + { + ifstream file(fileName.c_str(), ios_base::binary); + + if (!file.is_open()) + { +- cerr << "Could not open " << fileName.c_str() << "!" << endl; +- exit(EXIT_FAILURE); ++ cerr << endl << "liborigin: " << strerror(errno) << ": " << fileName.c_str() << endl; ++ ioError = errno; ++ return; + } + + #ifdef GENERATE_CODE_FOR_LOG +@@ -48,8 +49,9 @@ OriginFile::OriginFile(const string& fileName) + logfile = fopen("./opjfile.log", "w"); + if (logfile == nullptr) + { +- cerr << "Could not open opjfile.log !" << endl; +- exit(EXIT_FAILURE); ++ cerr << endl << "liborigin: " << strerror(errno) << ": opjfile.log" << endl; ++ ioError = errno; ++ return; + } + #endif // GENERATE_CODE_FOR_LOG + +@@ -152,10 +154,13 @@ OriginFile::OriginFile(const string& fileName) + fclose(logfile); + #endif // GENERATE_CODE_FOR_LOG + parser.reset(createOriginAnyParser(fileName)); ++ ioError=0; + } + + bool OriginFile::parse() + { ++ if (ioError != 0) ++ return false; + parser->buildVersion = buildVersion; + parser->fileVersion = fileVersion; + return parser->parse(); +diff --git a/OriginFile.h b/OriginFile.h +index 80b6ff2..3a49395 100644 +--- a/OriginFile.h ++++ b/OriginFile.h +@@ -70,7 +70,7 @@ public: + string resultsLogString() const; //!< get Results Log + + private: +- unsigned int fileVersion, buildVersion; ++ unsigned int fileVersion, buildVersion, ioError; + unique_ptr<OriginParser> parser; + }; + +diff --git a/opj2dat.cpp b/opj2dat.cpp +index ff53309..230ac84 100644 +--- a/opj2dat.cpp ++++ b/opj2dat.cpp +@@ -54,6 +54,8 @@ int main(int argc, char *argv[]) { + OriginFile opj(inputfile); + int status = opj.parse(); + cout << "Parsing status = " << status << endl; ++ if (! status) ++ return -1; + cout << "OPJ PROJECT \"" << inputfile.c_str() << "\" VERSION = " << opj.version() << endl; + + cout << "number of datasets = " << opj.datasetCount() << endl; +-- +2.26.2 + diff --git a/sci-libs/liborigin/files/liborigin-3.0.0-no-standard-streams.patch b/sci-libs/liborigin/files/liborigin-3.0.0-no-standard-streams.patch new file mode 100644 index 000000000000..227ce7b14d5e --- /dev/null +++ b/sci-libs/liborigin/files/liborigin-3.0.0-no-standard-streams.patch @@ -0,0 +1,210 @@ +From 6cb6d9b328195e11c1f168f6e4b915b522c7089f Mon Sep 17 00:00:00 2001 +From: Stefan Gerlach <stefan.gerlach@uni-konstanz.de> +Date: Wed, 15 May 2019 23:16:09 +0200 +Subject: [PATCH 1/3] do not output to standard streams (cout, + cerr) by default + +it might be better to hide all such usage behind #ifdefs, +since the streams might not belong to the shared library + +provided by Ivan Krylov (Ropj) +--- + OriginAnyParser.cpp | 11 +++++------ + OriginAnyParser.h | 2 +- + OriginFile.cpp | 2 -- + 3 files changed, 6 insertions(+), 9 deletions(-) + +diff --git a/OriginAnyParser.cpp b/OriginAnyParser.cpp +index d45026b..ff7b8f7 100644 +--- a/OriginAnyParser.cpp ++++ b/OriginAnyParser.cpp +@@ -756,7 +756,7 @@ void OriginAnyParser::readProjectTree() { + + // log info on project tree + #ifdef GENERATE_CODE_FOR_LOG +- outputProjectTree(); ++ outputProjectTree(cout); + #endif // GENERATE_CODE_FOR_LOG + + return; +@@ -2835,7 +2835,6 @@ void OriginAnyParser::getColorMap(ColorMap& cmap, const string& cmapdata, unsign + // check we have enough data to fill the map + unsigned int minDataSize = cmoffset + 0x114 + (colorMapSize+2)*0x38; + if (minDataSize > cmapdatasz) { +- cerr << "WARNING: Too few data while getting ColorMap. Needed: at least " << minDataSize << " bytes. Have: " << cmapdatasz << " bytes." << endl; + LOG_PRINT(logfile, "WARNING: Too few data while getting ColorMap. Needed: at least %d bytes. Have: %d bytes.\n", minDataSize, cmapdatasz) + return; + } +@@ -2988,15 +2987,15 @@ void OriginAnyParser::getProjectFolderProperties(tree<ProjectNode>::iterator cur + (*current_folder).modificationDate = doubleToPosixTime(modificationDate); + } + +-void OriginAnyParser::outputProjectTree() { ++void OriginAnyParser::outputProjectTree(std::ostream & out) { + size_t windowsCount = spreadSheets.size()+matrixes.size()+excels.size()+graphs.size()+notes.size(); + +- cout << "Project has " << windowsCount << " windows." << endl; +- cout << "Origin project Tree" << endl; ++ out << "Project has " << windowsCount << " windows." << endl; ++ out << "Origin project Tree" << endl; + + char cdsz[21]; + for (tree<ProjectNode>::iterator it = projectTree.begin(projectTree.begin()); it != projectTree.end(projectTree.begin()); ++it) { + strftime(cdsz, sizeof(cdsz), "%F %T", gmtime(&(*it).creationDate)); +- cout << string(projectTree.depth(it) - 1, ' ') << (*it).name.c_str() << "\t" << cdsz << endl; ++ out << string(projectTree.depth(it) - 1, ' ') << (*it).name.c_str() << "\t" << cdsz << endl; + } + } +diff --git a/OriginAnyParser.h b/OriginAnyParser.h +index ed62bbb..bd7c1ae 100644 +--- a/OriginAnyParser.h ++++ b/OriginAnyParser.h +@@ -68,7 +68,7 @@ protected: + void getZcolorsMap(ColorMap&, const string&, unsigned int); + void getProjectLeafProperties(tree<ProjectNode>::iterator, const string&, unsigned int); + void getProjectFolderProperties(tree<ProjectNode>::iterator, const string&, unsigned int); +- void outputProjectTree(); ++ void outputProjectTree(std::ostream &); + + inline time_t doubleToPosixTime(double jdt) + { +diff --git a/OriginFile.cpp b/OriginFile.cpp +index 5ac8e22..dba050f 100644 +--- a/OriginFile.cpp ++++ b/OriginFile.cpp +@@ -39,7 +39,6 @@ OriginFile::OriginFile(const string& fileName) + + if (!file.is_open()) + { +- cerr << endl << "liborigin: " << strerror(errno) << ": " << fileName.c_str() << endl; + ioError = errno; + return; + } +@@ -49,7 +48,6 @@ OriginFile::OriginFile(const string& fileName) + logfile = fopen("./opjfile.log", "w"); + if (logfile == nullptr) + { +- cerr << endl << "liborigin: " << strerror(errno) << ": opjfile.log" << endl; + ioError = errno; + return; + } +-- +2.26.2 + + +From 588bbc357cd34b9d353470ed6c0632b6f00805f5 Mon Sep 17 00:00:00 2001 +From: Stefan Gerlach <stefan.gerlach@uni-konstanz.de> +Date: Wed, 15 May 2019 23:28:46 +0200 +Subject: [PATCH 2/3] fix bugs found by UBSan + + - check values before casting to enum Attach + - default-initialize sensitive struct elements + +provided by Ivan Krylov (Ropj) +--- + OriginAnyParser.cpp | 1 + + OriginObj.h | 5 ++++- + README | 3 +++ + 3 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/OriginAnyParser.cpp b/OriginAnyParser.cpp +index ff7b8f7..9f9731c 100644 +--- a/OriginAnyParser.cpp ++++ b/OriginAnyParser.cpp +@@ -1543,6 +1543,7 @@ void OriginAnyParser::getAnnotationProperties(const string& anhd, unsigned int a + GET_SHORT(stmp, r.bottom) + + unsigned char attach = anhd[0x28]; ++ if (attach >= (unsigned char)Attach::End_) attach = Attach::Frame; + unsigned char border = anhd[0x29]; + + Color color = getColor(anhd.substr(0x33,4)); +diff --git a/OriginObj.h b/OriginObj.h +index 3a9f719..aeeeb6b 100644 +--- a/OriginObj.h ++++ b/OriginObj.h +@@ -67,7 +67,7 @@ namespace Origin + enum DayOfWeekFormat {DAY_DDD = 0, DAY_DDDD = 1, DAY_LETTER = 2}; + + enum NumericDisplayType {DefaultDecimalDigits = 0, DecimalPlaces = 1, SignificantDigits = 2}; +- enum Attach {Frame = 0, Page = 1, Scale = 2}; ++ enum Attach {Frame = 0, Page = 1, Scale = 2, End_}; + enum BorderType {BlackLine = 0, Shadow = 1, DarkMarble = 2, WhiteOut = 3, BlackOut = 4, None = -1}; + enum FillPattern {NoFill = 0, BDiagDense = 1, BDiagMedium = 2, BDiagSparse = 3, FDiagDense = 4, FDiagMedium = 5, FDiagSparse = 6, + DiagCrossDense = 7, DiagCrossMedium = 8, DiagCrossSparse = 9, HorizontalDense = 10, HorizontalMedium = 11, HorizontalSparse = 12, +@@ -345,6 +345,7 @@ namespace Origin + , width(8) + , index(_index) + , view(DataView) ++ , colorMap() + {coordinates.push_back(10.0);coordinates.push_back(10.0);coordinates.push_back(1.0);coordinates.push_back(1.0);}; + }; + +@@ -895,9 +896,11 @@ namespace Origin + GraphLayer() + : backgroundColor({Color::Regular, {Color::White}}) + , borderType(BlackLine) ++ , xAxis(), yAxis(), zAxis() + , histogramBin(0.5) + , histogramBegin(0.0) + , histogramEnd(10.0) ++ , colorMap() + , xAngle(0) + , yAngle(0) + , zAngle(0) +diff --git a/README b/README +index 1dd56ef..598eacc 100644 +--- a/README ++++ b/README +@@ -7,6 +7,9 @@ It is based on the code at + http://sourceforge.net/projects/liborigin + http://soft.proindependent.com/liborigin2 + ++Additionally, some fixes were applied to silence UBSan warnings caused by ++uninitialised POD struct members. ++ + AUTHORS: Knut Franke, Miquel Garriga, Stefan Gerlach, Alex Kargovsky, Russell Standish, Ion Vasilief + + DEPENDENCIES: tree.hh (included) http://tree.phi-sci.com/ +-- +2.26.2 + + +From 88b4de31e1860b8b5de6e3eea4a32e92f2e58c71 Mon Sep 17 00:00:00 2001 +From: Stefan Gerlach <stefan.gerlach@uni-konstanz.de> +Date: Wed, 15 May 2019 23:32:50 +0200 +Subject: [PATCH 3/3] readProjectTree: provide root node to append + to + +append_child() is not supposed to work on an empty tree, +and I couldn't find any initialization before its use. +All inserted nodes seemed to end up below tree_node::feet +(or something) and were not cleaned up by the destructor. + +Using insert() to create a dummy node for others to be +children of fixes the leak. + +provided by Ivan Krylov (Ropj) +--- + OriginAnyParser.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/OriginAnyParser.cpp b/OriginAnyParser.cpp +index 9f9731c..4a79423 100644 +--- a/OriginAnyParser.cpp ++++ b/OriginAnyParser.cpp +@@ -743,7 +743,10 @@ void OriginAnyParser::readProjectTree() { + string pte_pre2 = readObjectAsString(pte_pre2_size); + + // root element and children +- unsigned int rootfolder = readFolderTree(projectTree.begin(), pte_depth); ++ unsigned int rootfolder = readFolderTree( ++ projectTree.insert(projectTree.begin(), ProjectNode("", ProjectNode::Folder)), ++ pte_depth ++ ); + if (rootfolder > 0) { + LOG_PRINT(logfile, "Number of files at root: %d\n", rootfolder) + } +-- +2.26.2 + diff --git a/sci-libs/liborigin/liborigin-20110829-r1.ebuild b/sci-libs/liborigin/liborigin-20110829-r1.ebuild deleted file mode 100644 index 27e4ccbbe0f9..000000000000 --- a/sci-libs/liborigin/liborigin-20110829-r1.ebuild +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit qmake-utils - -DESCRIPTION="Library for reading OriginLab OPJ project files" -HOMEPAGE="http://soft.proindependent.com/liborigin2/" -SRC_URI="https://dev.gentoo.org/~dilfridge/distfiles/${PN}2-${PV}.zip" - -LICENSE="GPL-3" -SLOT="2" -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" -IUSE="doc" - -RDEPEND=" - dev-libs/boost - dev-qt/qtcore:5 - dev-qt/qtgui:5 -" -DEPEND="${RDEPEND} - app-arch/unzip - dev-cpp/tree - doc? ( app-doc/doxygen ) -" - -DOCS=( readme FORMAT ) - -S="${WORKDIR}"/${PN}${SLOT} - -src_prepare() { - default - - cat >> liborigin2.pro <<-EOF - INCLUDEPATH += "${EPREFIX}/usr/include/tree" - headers.files = \$\$HEADERS - headers.path = "${EPREFIX}/usr/include/liborigin2" - target.path = "${EPREFIX}/usr/$(get_libdir)" - INSTALLS = target headers - EOF - # use system one - rm -f tree.hh || die -} - -src_configure() { - eqmake5 liborigin2.pro -} - -src_compile() { - default - if use doc; then - cd doc || die - doxygen Doxyfile || die "doc generation failed" - fi -} - -src_install() { - use doc && local HTML_DOCS=( doc/html/. ) - einstalldocs - emake install INSTALL_ROOT="${D}" -} diff --git a/sci-libs/liborigin/liborigin-3.0.0.ebuild b/sci-libs/liborigin/liborigin-3.0.0.ebuild new file mode 100644 index 000000000000..aa4538748af9 --- /dev/null +++ b/sci-libs/liborigin/liborigin-3.0.0.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="Library for reading OriginLab OPJ project files" +HOMEPAGE="https://sourceforge.net/projects/liborigin/" +SRC_URI="http://downloads.sourceforge.net/liborigin/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="2" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="debug doc tools" + +BDEPEND=" + doc? ( app-doc/doxygen ) +" +RDEPEND=" + dev-cpp/tree +" +DEPEND="${RDEPEND}" + +PATCHES=( + # git master + "${FILESDIR}/${P}-no-exit-calls.patch" + "${FILESDIR}/${P}-no-standard-streams.patch" + # TODO upstream + "${FILESDIR}/${P}-missing-header.patch" + # downstream + "${FILESDIR}/${P}-buildsystem.patch" # ENABLE_TOOLS, shared link, doc paths +) + +src_prepare() { + cmake_src_prepare + rm tree.hh || die "failed to remove bundled tree.hh" + + sed -e "/install.*html/s/liborigin/${PF}/" \ + -i CMakeLists.txt || die "failed to fix htmldoc install path" +} + +src_configure() { + local mycmakeargs=( + -DGENERATE_CODE_FOR_LOG=$(usex debug) + $(cmake_use_find_package doc Doxygen) + -DENABLE_TOOLS=$(usex tools) + ) + cmake_src_configure +} + +src_compile() { + cmake_src_compile + use doc && cmake_src_compile doc +} diff --git a/sci-libs/liborigin/metadata.xml b/sci-libs/liborigin/metadata.xml index c049cd0777bf..e7dc202da9b1 100644 --- a/sci-libs/liborigin/metadata.xml +++ b/sci-libs/liborigin/metadata.xml @@ -5,7 +5,7 @@ <email>sci@gentoo.org</email> <name>Gentoo Science Project</name> </maintainer> - <longdescription> - A library providing IO for Microcal Origin files. - </longdescription> + <use> + <flag name="tools">Install opj2dat command line util</flag> + </use> </pkgmetadata> |