aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libe57
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libe57
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libe57')
-rw-r--r--vcpkg/ports/libe57/0001_cmake.patch107
-rw-r--r--vcpkg/ports/libe57/0002_replace_tr1_with_cpp11.patch95
-rw-r--r--vcpkg/ports/libe57/0003_fix_osx_support.patch145
-rw-r--r--vcpkg/ports/libe57/portfile.cmake35
-rw-r--r--vcpkg/ports/libe57/vcpkg.json33
5 files changed, 415 insertions, 0 deletions
diff --git a/vcpkg/ports/libe57/0001_cmake.patch b/vcpkg/ports/libe57/0001_cmake.patch
new file mode 100644
index 0000000..e4963ae
--- /dev/null
+++ b/vcpkg/ports/libe57/0001_cmake.patch
@@ -0,0 +1,107 @@
+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/")
+
+@@ -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
+@@ -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)
+--- a/src/refimpl/E57RefImplConfig.cmake 2011-10-06 16:01:00.000000000 +0800
++++ b/src/refimpl/E57RefImplConfig.cmake 2022-03-01 16:48:29.117485600 +0800
+@@ -49,6 +49,8 @@
+ # NOTE: You will also need to include the boost and xerces libraries to your
+ # project.
+
++get_filename_component(E57RefImpl_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)
++
+ IF (NOT "${E57RefImpl_DIR}/include" EQUAL "${E57RefImpl_INCLUDE_DIR}")
+ SET(E57RefImpl_LIBRARY_DEBUG E57RefImpl_LIBRARY_DEBUG-NOTFOUND)
+ SET(E57RefImpl_LIBRARY_RELEASE E57RefImpl_LIBRARY_RELEASE-NOTFOUND)
+@@ -78,6 +80,6 @@
+ NAMES libE57RefImpl-d
+ E57RefImpl-d
+- HINTS ${E57RefImpl_DIR}/lib
++ HINTS ${E57RefImpl_DIR}/debug/lib
+ DOC "E57 debug library"
+ )
+
diff --git a/vcpkg/ports/libe57/0002_replace_tr1_with_cpp11.patch b/vcpkg/ports/libe57/0002_replace_tr1_with_cpp11.patch
new file mode 100644
index 0000000..f0f7792
--- /dev/null
+++ b/vcpkg/ports/libe57/0002_replace_tr1_with_cpp11.patch
@@ -0,0 +1,95 @@
+diff --color -Naur a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2013-04-03 22:24:08.000000000 +0800
++++ b/CMakeLists.txt 2022-03-01 17:23:01.210728200 +0800
+@@ -36,8 +36,9 @@
+ # If you find any errors or have suggestion to improve the build script:
+ # patches are most welcome! Please send them to the development mailing list.
+
++cmake_minimum_required(VERSION 3.1)
+
+-cmake_minimum_required(VERSION 2.8.2)
++set(CMAKE_CXX_STANDARD 14)
+
+ # 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 --color -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 2022-03-01 17:24:17.904911600 +0800
+@@ -30,11 +30,7 @@
+ #include <iomanip>
+ #include <float.h>
+ #include <map>
+-#if defined(_MSC_VER)
+-# include <memory>
+-#else
+-# include <tr1/memory>
+-#endif
++#include <memory>
+ #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<vector<int64_t> > iBuffer;
+- shared_ptr<vector<double> > dBuffer;
+- shared_ptr<vector<string> > sBuffer;
++ std::shared_ptr<vector<int64_t> > iBuffer;
++ std::shared_ptr<vector<double> > dBuffer;
++ std::shared_ptr<vector<string> > sBuffer;
+
+ /// The precalculated parts of the element path name.
+ /// The only part that is missing is the record number which goes in between.
+diff --color -Naur a/src/tools/e57unpack.cpp b/src/tools/e57unpack.cpp
+--- a/src/tools/e57unpack.cpp 2013-04-03 22:24:08.000000000 +0800
++++ b/src/tools/e57unpack.cpp 2022-03-01 17:25:15.206260200 +0800
+@@ -45,12 +45,8 @@
+ #include <stdexcept>
+ using std::runtime_error;
+
+-#if defined(_MSC_VER)
+-# include <memory>
+-#else
+-# include <tr1/memory>
+-#endif
+-using std::tr1::shared_ptr;
++#include <memory>
++using std::shared_ptr;
+
+ #include <string>
+ using std::string;
+diff --color -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 2022-03-01 17:25:46.220771800 +0800
+@@ -66,11 +66,7 @@
+
+
+ ================================================================*/
+-#if defined(_MSC_VER)
+-# include <unordered_map>
+-#else
+-# include <tr1/unordered_map>
+-using std::tr1::unordered_map;
+-#endif
++#include <unordered_map>
++using std::unordered_map;
+ #include <cstring>
+ using std::strlen;
+@@ -694,7 +691,7 @@
+ void dump(int indent = 0, std::ostream& os = std::cout);
+ //================
+ private:
+- typedef std::tr1::unordered_map<int64_t, LineGroup> GroupsMap;
++ typedef std::unordered_map<int64_t, LineGroup> GroupsMap;
+
+ bool isDefined_;
+ bool isByRow_;
diff --git a/vcpkg/ports/libe57/0003_fix_osx_support.patch b/vcpkg/ports/libe57/0003_fix_osx_support.patch
new file mode 100644
index 0000000..2b1f1da
--- /dev/null
+++ b/vcpkg/ports/libe57/0003_fix_osx_support.patch
@@ -0,0 +1,145 @@
+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-24 17:04:57.000000000 +0800
+@@ -57,6 +57,12 @@
+ # include <fcntl.h>
+ # define O_BINARY (0)
+ # define _unlink unlink
++#elif defined( __APPLE__ )
++# include <sys/types.h>
++# include <unistd.h>
++# include <fcntl.h>
++# 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-24 16:58:24.000000000 +0800
+@@ -799,6 +799,9 @@
+ # define __LARGE64_FILES
+ # include <sys/types.h>
+ # include <unistd.h>
++#elif defined( __APPLE__ )
++# include <sys/types.h>
++# include <unistd.h>
+ #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-24 16:58:24.000000000 +0800
+@@ -74,6 +74,12 @@
+ # include <boost/uuid/uuid.hpp>
+ # include <boost/uuid/uuid_generators.hpp>
+ # include <boost/uuid/uuid_io.hpp>
++#elif defined(__APPLE__)
++# include <sys/types.h>
++# include <unistd.h>
++# include <boost/uuid/uuid.hpp>
++# include <boost/uuid/uuid_generators.hpp>
++# include <boost/uuid/uuid_io.hpp>
+ #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/vcpkg/ports/libe57/portfile.cmake b/vcpkg/ports/libe57/portfile.cmake
new file mode 100644
index 0000000..31db434
--- /dev/null
+++ b/vcpkg/ports/libe57/portfile.cmake
@@ -0,0 +1,35 @@
+set(VERSION 1.1.332)
+set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src/E57RefImpl_src-${VERSION}")
+
+vcpkg_from_sourceforge(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO e57-3d-imgfmt
+ FILENAME "E57RefImpl_src-${VERSION}.zip"
+ SHA512 86adb88cff32d72905e923b1205d609a2bce2eabd78995c59a7957395b233766a5ce31481db08977117abc1a70bbed90d2ce0cdb9897704a8c63d992e91a3907
+ PATCHES
+ "0001_cmake.patch"
+ "0002_replace_tr1_with_cpp11.patch"
+ "0003_fix_osx_support.patch"
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+if(NOT VCPKG_BUILD_TYPE)
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/share/libe57")
+endif()
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup()
+vcpkg_copy_pdbs()
+
+vcpkg_copy_tools(
+ TOOL_NAMES e57fields e57unpack e57validate e57xmldump las2e57
+ AUTO_CLEAN
+)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+file(REMOVE "${CURRENT_PACKAGES_DIR}/share/e57refimpl/CHANGES.TXT")
+file(REMOVE "${CURRENT_PACKAGES_DIR}/share/e57refimpl/README.TXT")
diff --git a/vcpkg/ports/libe57/vcpkg.json b/vcpkg/ports/libe57/vcpkg.json
new file mode 100644
index 0000000..1cfc4b7
--- /dev/null
+++ b/vcpkg/ports/libe57/vcpkg.json
@@ -0,0 +1,33 @@
+{
+ "name": "libe57",
+ "version-semver": "1.1.332",
+ "port-version": 5,
+ "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/",
+ "license": "BSL-1.0",
+ "supports": "!android",
+ "dependencies": [
+ "boost-crc",
+ "boost-filesystem",
+ "boost-format",
+ "boost-math",
+ "boost-program-options",
+ "boost-system",
+ "boost-thread",
+ "boost-uuid",
+ "boost-variant",
+ {
+ "name": "icu",
+ "platform": "linux"
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ "xerces-c"
+ ]
+}