From 5a2cbd8f0546da93e1279dfa323f9a202f16beac Mon Sep 17 00:00:00 2001 From: maz-1 Date: Mon, 14 Jun 2021 21:21:42 +0800 Subject: [PATCH 01/10] [libe57] Add new port --- ports/libe57/0001_cmake.patch | 34 +++++++++++++++++++++++ ports/libe57/CONTROL | 5 ++++ ports/libe57/portfile.cmake | 52 +++++++++++++++++++++++++++++++++++ ports/libe57/vcpkg.json | 19 +++++++++++++ versions/baseline.json | 4 +++ 5 files changed, 114 insertions(+) create mode 100644 ports/libe57/0001_cmake.patch create mode 100644 ports/libe57/CONTROL create mode 100644 ports/libe57/portfile.cmake create mode 100644 ports/libe57/vcpkg.json diff --git a/ports/libe57/0001_cmake.patch b/ports/libe57/0001_cmake.patch new file mode 100644 index 00000000000000..3e4f35c1e3b225 --- /dev/null +++ b/ports/libe57/0001_cmake.patch @@ -0,0 +1,34 @@ +diff -Naur a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2012-04-04 19:09:11.000000000 +0800 ++++ b/CMakeLists.txt 2020-02-01 13:37:30.887116500 +0800 +@@ -81,17 +80,17 @@ + endif(NOT Boost_FOUND) + + set(Xerces_USE_STATIC_LIBS On) +-find_package(Xerces QUIET) +-if (NOT Xerces_FOUND) ++find_package(XercesC QUIET) ++if (NOT XercesC_FOUND) + set(XERCES_ROOT CACHE PATH "Location of the xerces library") + message(FATAL_ERROR + "Unable to find xerces library. + Please set the the XERCES_ROOT to point to the root of the xerces directory." + ) +-endif (NOT Xerces_FOUND) ++endif (NOT XercesC_FOUND) + +-set(XML_LIBRARIES ${Xerces_LIBRARY}) +-set(XML_INCLUDE_DIRS ${Xerces_INCLUDE_DIR}) ++set(XML_LIBRARIES ${XercesC_LIBRARY}) ++set(XML_INCLUDE_DIRS ${XercesC_INCLUDE_DIR}) + + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + add_definitions(-DLINUX) +@@ -193,6 +192,7 @@ + time_conversion + ${XML_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ++ bcrypt + ) + add_executable( e57fields + src/tools/e57fields.cpp diff --git a/ports/libe57/CONTROL b/ports/libe57/CONTROL new file mode 100644 index 00000000000000..ea8f1364f76d6f --- /dev/null +++ b/ports/libe57/CONTROL @@ -0,0 +1,5 @@ +Source: libe57 +Version: 1.1.312 +Homepage: http://www.libe57.org +Description: The libE57 software is an open source implementation of the ASTM E2807 Standard Specification for 3D Imaging Data Exchange (known as the E57 format hereafter) in the C++ language. +Build-Depends: boost-system, boost-filesystem, boost-thread, boost-program-options, boost-crc, xerces-c, boost-variant, boost-format, boost-uuid diff --git a/ports/libe57/portfile.cmake b/ports/libe57/portfile.cmake new file mode 100644 index 00000000000000..17c3c6fd43740d --- /dev/null +++ b/ports/libe57/portfile.cmake @@ -0,0 +1,52 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/E57RefImpl_src-1.1.312) +vcpkg_download_distfile(ARCHIVE + URLS "https://downloads.sourceforge.net/project/e57-3d-imgfmt/E57Refimpl-src/E57RefImpl_src-1.1.312.zip" + FILENAME "E57RefImpl_src-1.1.312.zip" + SHA512 c729cc3094131f115ddf9b8c24a9420c4ab9d16a4343acfefb42f997f4bf25247cd5563126271df2af95f103093b7f6b360dbade52c9e66ec39dd2f06e041eb7 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES + "0001_cmake.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/share/libe57) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() +vcpkg_copy_pdbs() + +vcpkg_copy_tools( + TOOL_NAMES e57fields e57unpack e57validate e57xmldump las2e57 + AUTO_CLEAN +) + +file(INSTALL ${SOURCE_PATH}/README.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/src/refimpl/E57RefImplConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/e57refimpl/) + +file(INSTALL ${SOURCE_PATH}/include/E57Simple.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57) +file(INSTALL ${SOURCE_PATH}/include/LASReader.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57) +file(INSTALL ${SOURCE_PATH}/include/time_conversion/time_conversion.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57/time_conversion) +file(INSTALL ${SOURCE_PATH}/include/time_conversion/basictypes.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57/time_conversion) +file(INSTALL ${SOURCE_PATH}/include/time_conversion/constants.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57/time_conversion) +file(INSTALL ${SOURCE_PATH}/include/time_conversion/gnss_error.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57/time_conversion) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + +file(REMOVE ${CURRENT_PACKAGES_DIR}/CHANGES.TXT) +file(REMOVE ${CURRENT_PACKAGES_DIR}/E57RefImplConfig.cmake) +file(REMOVE ${CURRENT_PACKAGES_DIR}/README.TXT) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/CHANGES.TXT) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/E57RefImplConfig.cmake) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/README.TXT) \ No newline at end of file diff --git a/ports/libe57/vcpkg.json b/ports/libe57/vcpkg.json new file mode 100644 index 00000000000000..e9c688c2cb043c --- /dev/null +++ b/ports/libe57/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "libe57", + "version-semver": "1.1.312", + "port-version": 0, + "description": "An open source implementation of the ASTM E2807 Standard Specification for 3D Imaging Data Exchange in the C++ language.", + "homepage": "http://www.libe57.org/", + "supports": "!uwp", + "dependencies": [ + "boost-system", + "boost-filesystem", + "boost-thread", + "boost-program-options", + "boost-crc", + "boost-variant", + "boost-format", + "boost-uuid", + "xerces-c" + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 8c59d3e7dd1741..d2190b5b708820 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3104,6 +3104,10 @@ "baseline": "1.2.6", "port-version": 0 }, + "libe57": { + "baseline": "1.1.312", + "port-version": 0 + }, "libepoxy": { "baseline": "1.5.5", "port-version": 0 From 06b64492e15a4ab78b863acf2b3308f9d9bb2135 Mon Sep 17 00:00:00 2001 From: maz-1 Date: Tue, 15 Jun 2021 23:31:46 +0800 Subject: [PATCH 02/10] remove deprecated entries --- ports/libe57/portfile.cmake | 1 - ports/libe57/vcpkg.json | 1 - 2 files changed, 2 deletions(-) diff --git a/ports/libe57/portfile.cmake b/ports/libe57/portfile.cmake index 17c3c6fd43740d..7b76f0f41b1333 100644 --- a/ports/libe57/portfile.cmake +++ b/ports/libe57/portfile.cmake @@ -1,4 +1,3 @@ -include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/E57RefImpl_src-1.1.312) vcpkg_download_distfile(ARCHIVE URLS "https://downloads.sourceforge.net/project/e57-3d-imgfmt/E57Refimpl-src/E57RefImpl_src-1.1.312.zip" diff --git a/ports/libe57/vcpkg.json b/ports/libe57/vcpkg.json index e9c688c2cb043c..9de4b10938efff 100644 --- a/ports/libe57/vcpkg.json +++ b/ports/libe57/vcpkg.json @@ -1,7 +1,6 @@ { "name": "libe57", "version-semver": "1.1.312", - "port-version": 0, "description": "An open source implementation of the ASTM E2807 Standard Specification for 3D Imaging Data Exchange in the C++ language.", "homepage": "http://www.libe57.org/", "supports": "!uwp", From 23384be84bf762bbf753fed775fbb2d03d2cb211 Mon Sep 17 00:00:00 2001 From: maz-1 Date: Tue, 15 Jun 2021 23:49:23 +0800 Subject: [PATCH 03/10] update version files according to maintainer guide --- ports/libe57/CONTROL | 5 ----- ports/libe57/vcpkg.json | 10 +++++----- versions/l-/libe57.json | 9 +++++++++ 3 files changed, 14 insertions(+), 10 deletions(-) delete mode 100644 ports/libe57/CONTROL create mode 100644 versions/l-/libe57.json diff --git a/ports/libe57/CONTROL b/ports/libe57/CONTROL deleted file mode 100644 index ea8f1364f76d6f..00000000000000 --- a/ports/libe57/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: libe57 -Version: 1.1.312 -Homepage: http://www.libe57.org -Description: The libE57 software is an open source implementation of the ASTM E2807 Standard Specification for 3D Imaging Data Exchange (known as the E57 format hereafter) in the C++ language. -Build-Depends: boost-system, boost-filesystem, boost-thread, boost-program-options, boost-crc, xerces-c, boost-variant, boost-format, boost-uuid diff --git a/ports/libe57/vcpkg.json b/ports/libe57/vcpkg.json index 9de4b10938efff..09450c98c6ec8f 100644 --- a/ports/libe57/vcpkg.json +++ b/ports/libe57/vcpkg.json @@ -5,14 +5,14 @@ "homepage": "http://www.libe57.org/", "supports": "!uwp", "dependencies": [ - "boost-system", - "boost-filesystem", - "boost-thread", - "boost-program-options", "boost-crc", - "boost-variant", + "boost-filesystem", "boost-format", + "boost-program-options", + "boost-system", + "boost-thread", "boost-uuid", + "boost-variant", "xerces-c" ] } diff --git a/versions/l-/libe57.json b/versions/l-/libe57.json new file mode 100644 index 00000000000000..9f3d44455499f3 --- /dev/null +++ b/versions/l-/libe57.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "6c58c4d29a623e71b60f7fd2b301313e8c417f17", + "version-semver": "1.1.312", + "port-version": 0 + } + ] +} From caf3cd16dc75b773566ef3589efe983839abc8b4 Mon Sep 17 00:00:00 2001 From: maz-1 Date: Wed, 16 Jun 2021 00:13:54 +0800 Subject: [PATCH 04/10] add dependency for linux --- ports/libe57/vcpkg.json | 5 ++++- versions/l-/libe57.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ports/libe57/vcpkg.json b/ports/libe57/vcpkg.json index 09450c98c6ec8f..df4b257067199d 100644 --- a/ports/libe57/vcpkg.json +++ b/ports/libe57/vcpkg.json @@ -3,7 +3,6 @@ "version-semver": "1.1.312", "description": "An open source implementation of the ASTM E2807 Standard Specification for 3D Imaging Data Exchange in the C++ language.", "homepage": "http://www.libe57.org/", - "supports": "!uwp", "dependencies": [ "boost-crc", "boost-filesystem", @@ -13,6 +12,10 @@ "boost-thread", "boost-uuid", "boost-variant", + { + "name": "icu", + "platform": "linux" + }, "xerces-c" ] } diff --git a/versions/l-/libe57.json b/versions/l-/libe57.json index 9f3d44455499f3..5015f09eb9d8cc 100644 --- a/versions/l-/libe57.json +++ b/versions/l-/libe57.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "6c58c4d29a623e71b60f7fd2b301313e8c417f17", + "git-tree": "0df3b3a100a97e64fd5ad413fe1fa20739c3d1fc", "version-semver": "1.1.312", "port-version": 0 } From f954e0e4b692819c61ff63c1ae68119b3f0134bf Mon Sep 17 00:00:00 2001 From: maz-1 Date: Wed, 16 Jun 2021 01:00:30 +0800 Subject: [PATCH 05/10] update cmake patch --- ports/libe57/0001_cmake.patch | 86 +++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/ports/libe57/0001_cmake.patch b/ports/libe57/0001_cmake.patch index 3e4f35c1e3b225..b00324eda4192f 100644 --- a/ports/libe57/0001_cmake.patch +++ b/ports/libe57/0001_cmake.patch @@ -1,34 +1,54 @@ diff -Naur a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt 2012-04-04 19:09:11.000000000 +0800 -+++ b/CMakeLists.txt 2020-02-01 13:37:30.887116500 +0800 -@@ -81,17 +80,17 @@ - endif(NOT Boost_FOUND) - - set(Xerces_USE_STATIC_LIBS On) --find_package(Xerces QUIET) --if (NOT Xerces_FOUND) -+find_package(XercesC QUIET) -+if (NOT XercesC_FOUND) - set(XERCES_ROOT CACHE PATH "Location of the xerces library") - message(FATAL_ERROR - "Unable to find xerces library. - Please set the the XERCES_ROOT to point to the root of the xerces directory." - ) --endif (NOT Xerces_FOUND) -+endif (NOT XercesC_FOUND) - --set(XML_LIBRARIES ${Xerces_LIBRARY}) --set(XML_INCLUDE_DIRS ${Xerces_INCLUDE_DIR}) -+set(XML_LIBRARIES ${XercesC_LIBRARY}) -+set(XML_INCLUDE_DIRS ${XercesC_INCLUDE_DIR}) - - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - add_definitions(-DLINUX) -@@ -193,6 +192,7 @@ - time_conversion - ${XML_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} -+ bcrypt - ) - add_executable( e57fields - src/tools/e57fields.cpp +--- a/CMakeLists.txt 2012-04-04 13:09:12.000000000 +0800 ++++ b/CMakeLists.txt 2021-06-16 01:14:35.669163100 +0800 +@@ -31,6 +31,8 @@ + set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/c_flag_overrides.cmake) + set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_flag_overrides.cmake) + ++set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++ + # Set a private module find path + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") + +@@ -81,17 +83,17 @@ + endif(NOT Boost_FOUND) + + set(Xerces_USE_STATIC_LIBS On) +-find_package(Xerces QUIET) +-if (NOT Xerces_FOUND) ++find_package(XercesC QUIET) ++if (NOT XercesC_FOUND) + set(XERCES_ROOT CACHE PATH "Location of the xerces library") + message(FATAL_ERROR + "Unable to find xerces library. + Please set the the XERCES_ROOT to point to the root of the xerces directory." + ) +-endif (NOT Xerces_FOUND) ++endif (NOT XercesC_FOUND) + +-set(XML_LIBRARIES ${Xerces_LIBRARY}) +-set(XML_INCLUDE_DIRS ${Xerces_INCLUDE_DIR}) ++set(XML_LIBRARIES ${XercesC_LIBRARY}) ++set(XML_INCLUDE_DIRS ${XercesC_INCLUDE_DIR}) + + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + add_definitions(-DLINUX) +@@ -187,12 +189,18 @@ + add_executable( las2e57 + src/tools/las2e57.cpp + ) ++ ++if (MSVC) ++ set(LAS2E57_EXTRA_LINK bcrypt) ++endif(MSVC) ++ + target_link_libraries( las2e57 + E57RefImpl + LASReader + time_conversion + ${XML_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ++ ${LAS2E57_EXTRA_LINK} + ) + add_executable( e57fields + src/tools/e57fields.cpp From 74ee37c8d2586d5cbaeb73e500728c5d712bf98e Mon Sep 17 00:00:00 2001 From: maz-1 Date: Wed, 16 Jun 2021 10:02:57 +0800 Subject: [PATCH 06/10] update versioning --- versions/l-/libe57.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/libe57.json b/versions/l-/libe57.json index 5015f09eb9d8cc..26f41113b06400 100644 --- a/versions/l-/libe57.json +++ b/versions/l-/libe57.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "0df3b3a100a97e64fd5ad413fe1fa20739c3d1fc", + "git-tree": "33740d7719efce750f00f8fb15d9e778aaf37c6e", "version-semver": "1.1.312", "port-version": 0 } From 972379471a63ed5f34eb8b91ee10a687a0a47dfa Mon Sep 17 00:00:00 2001 From: maz-1 Date: Wed, 16 Jun 2021 22:27:03 +0800 Subject: [PATCH 07/10] delete obsolete lines --- ports/libe57/portfile.cmake | 2 -- versions/l-/libe57.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ports/libe57/portfile.cmake b/ports/libe57/portfile.cmake index 7b76f0f41b1333..01a7bce7c72197 100644 --- a/ports/libe57/portfile.cmake +++ b/ports/libe57/portfile.cmake @@ -40,8 +40,6 @@ file(INSTALL ${SOURCE_PATH}/include/time_conversion/gnss_error.h DESTINATION ${C file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE ${CURRENT_PACKAGES_DIR}/CHANGES.TXT) file(REMOVE ${CURRENT_PACKAGES_DIR}/E57RefImplConfig.cmake) diff --git a/versions/l-/libe57.json b/versions/l-/libe57.json index 26f41113b06400..3c4557dc51129f 100644 --- a/versions/l-/libe57.json +++ b/versions/l-/libe57.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "33740d7719efce750f00f8fb15d9e778aaf37c6e", + "git-tree": "b69915ef88c52cb0149b277d027df105304bf930", "version-semver": "1.1.312", "port-version": 0 } From 09847fd9ef3fb71d3cfeac19f0fd366e8b146eee Mon Sep 17 00:00:00 2001 From: maz-1 Date: Wed, 16 Jun 2021 23:19:52 +0800 Subject: [PATCH 08/10] fix linux/osx --- .../libe57/0002_replace_tr1_with_cpp11.patch | 96 +++++++++++++++++++ ports/libe57/0003_fix_osx_support.patch | 53 ++++++++++ ports/libe57/portfile.cmake | 2 + versions/l-/libe57.json | 2 +- 4 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 ports/libe57/0002_replace_tr1_with_cpp11.patch create mode 100644 ports/libe57/0003_fix_osx_support.patch diff --git a/ports/libe57/0002_replace_tr1_with_cpp11.patch b/ports/libe57/0002_replace_tr1_with_cpp11.patch new file mode 100644 index 00000000000000..1b48de7c22a612 --- /dev/null +++ b/ports/libe57/0002_replace_tr1_with_cpp11.patch @@ -0,0 +1,96 @@ +diff -Naur a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2021-06-16 22:53:02.033465000 +0800 ++++ b/CMakeLists.txt 2021-06-16 23:01:31.542323600 +0800 +@@ -25,7 +25,9 @@ + # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + # DEALINGS IN THE SOFTWARE. + +-cmake_minimum_required(VERSION 2.8.2) ++cmake_minimum_required(VERSION 3.1) ++ ++set(CMAKE_CXX_STANDARD 11) + + # Override flags to enable prepare for linking to static runtime + set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/c_flag_overrides.cmake) +diff -Naur a/src/tools/e57fields.cpp b/src/tools/e57fields.cpp +--- a/src/tools/e57fields.cpp 2012-04-04 17:19:01.000000000 +0800 ++++ b/src/tools/e57fields.cpp 2021-06-16 22:55:02.789463000 +0800 +@@ -30,11 +30,7 @@ + #include + #include + #include +-#if defined(_MSC_VER) +-# include +-#else +-# include +-#endif ++#include + #include "E57Foundation.h" + #include "E57FoundationImpl.h" //??? for exceptions, should be in separate file + +@@ -43,7 +39,6 @@ + + using namespace e57; + using namespace std; +-using namespace std::tr1; + + //!!! prologue, file name, date, version#, total # elements + //!!! doc +@@ -446,9 +441,9 @@ + /// Only one is used, depending on the type of the E57 element. + /// One of these three should be resized to BUFFER_ELEMENT_COUNT. + /// These are smart pointers to avoid the copying (and the moving) when put on the cvElements list. +- shared_ptr > iBuffer; +- shared_ptr > dBuffer; +- shared_ptr > sBuffer; ++ std::shared_ptr > iBuffer; ++ std::shared_ptr > dBuffer; ++ std::shared_ptr > sBuffer; + + /// The precalculated parts of the element path name. + /// The only part that is missing is the record number which goes in between. +diff -Naur a/src/tools/e57unpack.cpp b/src/tools/e57unpack.cpp +--- a/src/tools/e57unpack.cpp 2011-10-06 16:01:00.000000000 +0800 ++++ b/src/tools/e57unpack.cpp 2021-06-16 22:56:57.150323800 +0800 +@@ -41,12 +41,8 @@ + #include + using std::runtime_error; + +-#if defined(_MSC_VER) +-# include +-#else +-# include +-#endif +-using std::tr1::shared_ptr; ++#include ++using std::shared_ptr; + + #include + using std::string; +diff -Naur a/src/tools/e57validate.cpp b/src/tools/e57validate.cpp +--- a/src/tools/e57validate.cpp 2011-10-06 16:01:00.000000000 +0800 ++++ b/src/tools/e57validate.cpp 2021-06-16 22:58:19.365323700 +0800 +@@ -66,11 +66,8 @@ + + + ================================================================*/ +-#if defined(_MSC_VER) +-# include +-#else +-# include +-using std::tr1::unordered_map; ++ ++#include ++using std::unordered_map; +-#endif + #include + using std::strlen; +@@ -694,7 +692,7 @@ + void dump(int indent = 0, std::ostream& os = std::cout); + //================ + private: +- typedef std::tr1::unordered_map GroupsMap; ++ typedef std::unordered_map GroupsMap; + + bool isDefined_; + bool isByRow_; diff --git a/ports/libe57/0003_fix_osx_support.patch b/ports/libe57/0003_fix_osx_support.patch new file mode 100644 index 00000000000000..833c32ec2c7850 --- /dev/null +++ b/ports/libe57/0003_fix_osx_support.patch @@ -0,0 +1,53 @@ +diff -Naur a/src/refimpl/E57FoundationImpl.cpp b/src/refimpl/E57FoundationImpl.cpp +--- a/src/refimpl/E57FoundationImpl.cpp 2012-04-12 21:44:42.000000000 +0800 ++++ b/src/refimpl/E57FoundationImpl.cpp 2021-06-16 23:13:28.656574600 +0800 +@@ -57,6 +57,11 @@ + # include + # define O_BINARY (0) + # define _unlink unlink ++#elif defined( __APPLE__ ) ++# include ++# include ++# define O_BINARY (0) ++# define _unlink unlink + #else + # error "no supported OS platform defined" + #endif +@@ -4764,6 +4769,8 @@ + # endif + #elif defined(LINUX) + int64_t result = ::lseek64(fd_, offset, whence); ++#elif defined( __APPLE__ ) ++ int64_t result = ::lseek(fd_, offset, whence); + #else + # error "no supported OS platform defined" + #endif +diff -Naur a/src/refimpl/E57Simple.cpp b/src/refimpl/E57Simple.cpp +--- a/src/refimpl/E57Simple.cpp 2011-05-14 05:40:11.000000000 +0800 ++++ b/src/refimpl/E57Simple.cpp 2021-06-16 23:14:48.228582600 +0800 +@@ -799,6 +799,9 @@ + # define __LARGE64_FILES + # include + # include ++#elif defined( __APPLE__ ) ++# include ++# include + #else + # error "no supported OS platform defined" + #endif +diff -Naur a/src/refimpl/E57SimpleImpl.cpp b/src/refimpl/E57SimpleImpl.cpp +--- a/src/refimpl/E57SimpleImpl.cpp 2012-04-12 23:15:46.000000000 +0800 ++++ b/src/refimpl/E57SimpleImpl.cpp 2021-06-16 23:16:10.941588400 +0800 +@@ -74,6 +74,12 @@ + # include + # include + # include ++#elif defined(__APPLE__) ++# include ++# include ++# include ++# include ++# include + #else + # error "no supported OS platform defined" + #endif diff --git a/ports/libe57/portfile.cmake b/ports/libe57/portfile.cmake index 01a7bce7c72197..ebcc286c1aee5b 100644 --- a/ports/libe57/portfile.cmake +++ b/ports/libe57/portfile.cmake @@ -10,6 +10,8 @@ vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} PATCHES "0001_cmake.patch" + "0002_replace_tr1_with_cpp11.patch" + "0003_fix_osx_support.patch" ) vcpkg_configure_cmake( diff --git a/versions/l-/libe57.json b/versions/l-/libe57.json index 3c4557dc51129f..2e71fa2adffd3a 100644 --- a/versions/l-/libe57.json +++ b/versions/l-/libe57.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "b69915ef88c52cb0149b277d027df105304bf930", + "git-tree": "3c91fa9a7668ff1f4aecc7b91480c13858b08a5e", "version-semver": "1.1.312", "port-version": 0 } From b8906a5c7f6d1c1438814dcc240be8a2b1942c6c Mon Sep 17 00:00:00 2001 From: maz-1 Date: Thu, 24 Jun 2021 17:22:56 +0800 Subject: [PATCH 09/10] fix osx include and linker problem --- ports/libe57/0003_fix_osx_support.patch | 188 ++++++++++++++++++------ versions/l-/libe57.json | 2 +- 2 files changed, 141 insertions(+), 49 deletions(-) diff --git a/ports/libe57/0003_fix_osx_support.patch b/ports/libe57/0003_fix_osx_support.patch index 833c32ec2c7850..2b1f1da7fe054b 100644 --- a/ports/libe57/0003_fix_osx_support.patch +++ b/ports/libe57/0003_fix_osx_support.patch @@ -1,53 +1,145 @@ -diff -Naur a/src/refimpl/E57FoundationImpl.cpp b/src/refimpl/E57FoundationImpl.cpp +diff -x '.*' -Naur a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2021-06-24 16:56:37.000000000 +0800 ++++ b/CMakeLists.txt 2021-06-24 17:30:28.000000000 +0800 +@@ -163,6 +163,13 @@ + include/time_conversion/gnss_error.h + ) + ++# fix dependency introduced by xerces ++if(APPLE) ++ find_library(CORE_FOUNDATION CoreFoundation REQUIRED) ++ find_library(CORE_SERVICES CoreServices REQUIRED) ++ set(EXTRA_LINK_FLAGS_OSX ${CORE_FOUNDATION} ${CORE_SERVICES}) ++endif() ++ + # + # Example programs + # +@@ -174,6 +181,7 @@ + E57RefImpl + ${XML_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ++ ${EXTRA_LINK_FLAGS_OSX} + ) + add_executable( DemoRead01 + src/examples/DemoRead01.cpp +@@ -182,6 +190,7 @@ + E57RefImpl + ${XML_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ++ ${EXTRA_LINK_FLAGS_OSX} + ) + + # +@@ -203,6 +212,7 @@ + ${XML_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} + ${LAS2E57_EXTRA_LINK} ++ ${EXTRA_LINK_FLAGS_OSX} + ) + add_executable( e57fields + src/tools/e57fields.cpp +@@ -211,6 +221,7 @@ + E57RefImpl + ${XML_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ++ ${EXTRA_LINK_FLAGS_OSX} + ) + add_executable( e57xmldump + src/tools/e57xmldump.cpp +@@ -219,6 +230,7 @@ + E57RefImpl + ${XML_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ++ ${EXTRA_LINK_FLAGS_OSX} + ) + add_executable( e57validate + src/tools/e57validate.cpp +@@ -227,6 +239,7 @@ + E57RefImpl + ${XML_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ++ ${EXTRA_LINK_FLAGS_OSX} + ) + add_executable( e57unpack + src/tools/e57unpack.cpp +@@ -236,6 +249,7 @@ + ${XML_LIBRARIES} + ${Boost_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ++ ${EXTRA_LINK_FLAGS_OSX} + ) + + # +diff -x '.*' -Naur a/src/refimpl/E57FoundationImpl.cpp b/src/refimpl/E57FoundationImpl.cpp --- a/src/refimpl/E57FoundationImpl.cpp 2012-04-12 21:44:42.000000000 +0800 -+++ b/src/refimpl/E57FoundationImpl.cpp 2021-06-16 23:13:28.656574600 +0800 -@@ -57,6 +57,11 @@ - # include - # define O_BINARY (0) - # define _unlink unlink -+#elif defined( __APPLE__ ) -+# include -+# include -+# define O_BINARY (0) -+# define _unlink unlink - #else - # error "no supported OS platform defined" - #endif -@@ -4764,6 +4769,8 @@ - # endif - #elif defined(LINUX) - int64_t result = ::lseek64(fd_, offset, whence); -+#elif defined( __APPLE__ ) -+ int64_t result = ::lseek(fd_, offset, whence); - #else - # error "no supported OS platform defined" - #endif -diff -Naur a/src/refimpl/E57Simple.cpp b/src/refimpl/E57Simple.cpp ++++ b/src/refimpl/E57FoundationImpl.cpp 2021-06-24 17:04:57.000000000 +0800 +@@ -57,6 +57,12 @@ + # include + # define O_BINARY (0) + # define _unlink unlink ++#elif defined( __APPLE__ ) ++# include ++# include ++# include ++# define O_BINARY (0) ++# define _unlink unlink + #else + # error "no supported OS platform defined" + #endif +@@ -4764,6 +4770,8 @@ + # endif + #elif defined(LINUX) + int64_t result = ::lseek64(fd_, offset, whence); ++#elif defined( __APPLE__ ) ++ int64_t result = ::lseek(fd_, offset, whence); + #else + # error "no supported OS platform defined" + #endif +diff -x '.*' -Naur a/src/refimpl/E57Simple.cpp b/src/refimpl/E57Simple.cpp --- a/src/refimpl/E57Simple.cpp 2011-05-14 05:40:11.000000000 +0800 -+++ b/src/refimpl/E57Simple.cpp 2021-06-16 23:14:48.228582600 +0800 ++++ b/src/refimpl/E57Simple.cpp 2021-06-24 16:58:24.000000000 +0800 @@ -799,6 +799,9 @@ - # define __LARGE64_FILES - # include - # include -+#elif defined( __APPLE__ ) -+# include -+# include - #else - # error "no supported OS platform defined" - #endif -diff -Naur a/src/refimpl/E57SimpleImpl.cpp b/src/refimpl/E57SimpleImpl.cpp + # define __LARGE64_FILES + # include + # include ++#elif defined( __APPLE__ ) ++# include ++# include + #else + # error "no supported OS platform defined" + #endif +diff -x '.*' -Naur a/src/refimpl/E57SimpleImpl.cpp b/src/refimpl/E57SimpleImpl.cpp --- a/src/refimpl/E57SimpleImpl.cpp 2012-04-12 23:15:46.000000000 +0800 -+++ b/src/refimpl/E57SimpleImpl.cpp 2021-06-16 23:16:10.941588400 +0800 ++++ b/src/refimpl/E57SimpleImpl.cpp 2021-06-24 16:58:24.000000000 +0800 @@ -74,6 +74,12 @@ - # include - # include - # include -+#elif defined(__APPLE__) -+# include -+# include -+# include -+# include -+# include - #else - # error "no supported OS platform defined" - #endif + # include + # include + # include ++#elif defined(__APPLE__) ++# include ++# include ++# include ++# include ++# include + #else + # error "no supported OS platform defined" + #endif +diff -x '.*' -Naur a/src/tools/las2e57.cpp b/src/tools/las2e57.cpp +--- a/src/tools/las2e57.cpp 2012-04-04 19:09:11.000000000 +0800 ++++ b/src/tools/las2e57.cpp 2021-06-24 17:11:11.000000000 +0800 +@@ -404,12 +404,12 @@ + int64_t startIndex; + BoundingBox bbox; + +- GroupRecord(int64_t id); ++ GroupRecord(int64_t id = 0); + void addMember(double coords[3], int64_t recordIndex); + void dump(int indent = 0, std::ostream& os = std::cout); + }; + +-GroupRecord::GroupRecord(int64_t id_arg = 0) ++GroupRecord::GroupRecord(int64_t id_arg) + : id(id_arg), + count(0), + startIndex(0), diff --git a/versions/l-/libe57.json b/versions/l-/libe57.json index 2e71fa2adffd3a..5957a66e2649c9 100644 --- a/versions/l-/libe57.json +++ b/versions/l-/libe57.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "3c91fa9a7668ff1f4aecc7b91480c13858b08a5e", + "git-tree": "6052285151b46ee824225f3777ce9eb1334a213f", "version-semver": "1.1.312", "port-version": 0 } From 1c7981483dcfe96e1b793162076d2f8073a4e567 Mon Sep 17 00:00:00 2001 From: maz-1 Date: Tue, 6 Jul 2021 19:56:12 +0800 Subject: [PATCH 10/10] [libe57] remove deprecated functions --- ports/libe57/0001_cmake.patch | 130 +++++++++++++++++++++------------- ports/libe57/portfile.cmake | 47 ++++-------- ports/libe57/vcpkg.json | 8 +++ versions/l-/libe57.json | 2 +- 4 files changed, 105 insertions(+), 82 deletions(-) diff --git a/ports/libe57/0001_cmake.patch b/ports/libe57/0001_cmake.patch index b00324eda4192f..47001bbe466be9 100644 --- a/ports/libe57/0001_cmake.patch +++ b/ports/libe57/0001_cmake.patch @@ -2,53 +2,87 @@ diff -Naur a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt 2012-04-04 13:09:12.000000000 +0800 +++ b/CMakeLists.txt 2021-06-16 01:14:35.669163100 +0800 @@ -31,6 +31,8 @@ - set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/c_flag_overrides.cmake) - set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_flag_overrides.cmake) - -+set(CMAKE_POSITION_INDEPENDENT_CODE ON) -+ - # Set a private module find path - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") - + set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/c_flag_overrides.cmake) + set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_flag_overrides.cmake) + ++set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++ + # Set a private module find path + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") + @@ -81,17 +83,17 @@ - endif(NOT Boost_FOUND) - - set(Xerces_USE_STATIC_LIBS On) --find_package(Xerces QUIET) --if (NOT Xerces_FOUND) -+find_package(XercesC QUIET) -+if (NOT XercesC_FOUND) - set(XERCES_ROOT CACHE PATH "Location of the xerces library") - message(FATAL_ERROR - "Unable to find xerces library. - Please set the the XERCES_ROOT to point to the root of the xerces directory." - ) --endif (NOT Xerces_FOUND) -+endif (NOT XercesC_FOUND) - --set(XML_LIBRARIES ${Xerces_LIBRARY}) --set(XML_INCLUDE_DIRS ${Xerces_INCLUDE_DIR}) -+set(XML_LIBRARIES ${XercesC_LIBRARY}) -+set(XML_INCLUDE_DIRS ${XercesC_INCLUDE_DIR}) - - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - add_definitions(-DLINUX) + endif(NOT Boost_FOUND) + + set(Xerces_USE_STATIC_LIBS On) +-find_package(Xerces QUIET) +-if (NOT Xerces_FOUND) ++find_package(XercesC QUIET) ++if (NOT XercesC_FOUND) + set(XERCES_ROOT CACHE PATH "Location of the xerces library") + message(FATAL_ERROR + "Unable to find xerces library. + Please set the the XERCES_ROOT to point to the root of the xerces directory." + ) +-endif (NOT Xerces_FOUND) ++endif (NOT XercesC_FOUND) + +-set(XML_LIBRARIES ${Xerces_LIBRARY}) +-set(XML_INCLUDE_DIRS ${Xerces_INCLUDE_DIR}) ++set(XML_LIBRARIES ${XercesC_LIBRARY}) ++set(XML_INCLUDE_DIRS ${XercesC_INCLUDE_DIR}) + + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + add_definitions(-DLINUX) @@ -187,12 +189,18 @@ - add_executable( las2e57 - src/tools/las2e57.cpp - ) -+ -+if (MSVC) -+ set(LAS2E57_EXTRA_LINK bcrypt) -+endif(MSVC) -+ - target_link_libraries( las2e57 - E57RefImpl - LASReader - time_conversion - ${XML_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} -+ ${LAS2E57_EXTRA_LINK} - ) - add_executable( e57fields - src/tools/e57fields.cpp + add_executable( las2e57 + src/tools/las2e57.cpp + ) ++ ++if (MSVC) ++ set(LAS2E57_EXTRA_LINK bcrypt) ++endif(MSVC) ++ + target_link_libraries( las2e57 + E57RefImpl + LASReader + time_conversion + ${XML_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ++ ${LAS2E57_EXTRA_LINK} + ) + add_executable( e57fields + src/tools/e57fields.cpp +@@ -270,15 +270,32 @@ + install( + FILES + include/E57Foundation.h ++ include/E57Simple.h ++ include/LASReader.h + DESTINATION include/e57 + ) ++install( ++ FILES ++ include/time_conversion/time_conversion.h ++ include/time_conversion/basictypes.h ++ include/time_conversion/constants.h ++ include/time_conversion/gnss_error.h ++ DESTINATION include/e57/time_conversion ++) + + install( + FILES + CHANGES.TXT + README.TXT + src/refimpl/E57RefImplConfig.cmake +- DESTINATION . ++ DESTINATION share/e57refimpl ++) ++ ++install( ++ FILES ++ README.TXT ++ RENAME copyright ++ DESTINATION share/libe57 + ) + + #include (InstallRequiredSystemLibraries) diff --git a/ports/libe57/portfile.cmake b/ports/libe57/portfile.cmake index ebcc286c1aee5b..1f7bfd9ea5c3f4 100644 --- a/ports/libe57/portfile.cmake +++ b/ports/libe57/portfile.cmake @@ -1,51 +1,32 @@ -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/E57RefImpl_src-1.1.312) -vcpkg_download_distfile(ARCHIVE - URLS "https://downloads.sourceforge.net/project/e57-3d-imgfmt/E57Refimpl-src/E57RefImpl_src-1.1.312.zip" - FILENAME "E57RefImpl_src-1.1.312.zip" - SHA512 c729cc3094131f115ddf9b8c24a9420c4ab9d16a4343acfefb42f997f4bf25247cd5563126271df2af95f103093b7f6b360dbade52c9e66ec39dd2f06e041eb7 -) +set(VERSION 1.1.312) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/E57RefImpl_src-${VERSION}) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - "0001_cmake.patch" - "0002_replace_tr1_with_cpp11.patch" - "0003_fix_osx_support.patch" +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO e57-3d-imgfmt + FILENAME "E57RefImpl_src-${VERSION}.zip" + SHA512 c729cc3094131f115ddf9b8c24a9420c4ab9d16a4343acfefb42f997f4bf25247cd5563126271df2af95f103093b7f6b360dbade52c9e66ec39dd2f06e041eb7 + PATCHES + "0001_cmake.patch" + "0002_replace_tr1_with_cpp11.patch" + "0003_fix_osx_support.patch" ) -vcpkg_configure_cmake( +vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA ) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/share/libe57) -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() +vcpkg_cmake_install() +vcpkg_cmake_config_fixup() vcpkg_copy_pdbs() vcpkg_copy_tools( TOOL_NAMES e57fields e57unpack e57validate e57xmldump las2e57 AUTO_CLEAN ) - -file(INSTALL ${SOURCE_PATH}/README.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(INSTALL ${SOURCE_PATH}/src/refimpl/E57RefImplConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/e57refimpl/) - -file(INSTALL ${SOURCE_PATH}/include/E57Simple.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57) -file(INSTALL ${SOURCE_PATH}/include/LASReader.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57) -file(INSTALL ${SOURCE_PATH}/include/time_conversion/time_conversion.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57/time_conversion) -file(INSTALL ${SOURCE_PATH}/include/time_conversion/basictypes.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57/time_conversion) -file(INSTALL ${SOURCE_PATH}/include/time_conversion/constants.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57/time_conversion) -file(INSTALL ${SOURCE_PATH}/include/time_conversion/gnss_error.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/e57/time_conversion) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -file(REMOVE ${CURRENT_PACKAGES_DIR}/CHANGES.TXT) -file(REMOVE ${CURRENT_PACKAGES_DIR}/E57RefImplConfig.cmake) -file(REMOVE ${CURRENT_PACKAGES_DIR}/README.TXT) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/CHANGES.TXT) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/E57RefImplConfig.cmake) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/README.TXT) \ No newline at end of file diff --git a/ports/libe57/vcpkg.json b/ports/libe57/vcpkg.json index df4b257067199d..4f802910afd420 100644 --- a/ports/libe57/vcpkg.json +++ b/ports/libe57/vcpkg.json @@ -16,6 +16,14 @@ "name": "icu", "platform": "linux" }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, "xerces-c" ] } diff --git a/versions/l-/libe57.json b/versions/l-/libe57.json index 5957a66e2649c9..d9be12351d6f3e 100644 --- a/versions/l-/libe57.json +++ b/versions/l-/libe57.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "6052285151b46ee824225f3777ce9eb1334a213f", + "git-tree": "50300e4d95248be2c168fee27a31c5506c7b840d", "version-semver": "1.1.312", "port-version": 0 }