[collada-dom] fix emscripten build (#29562)

* add patch

* .

* update-hash

* fix

* reformat

* fix hash

* remove-patch-prefix

* upd-hash

* upd

* .

* Update ports/collada-dom/portfile.cmake

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* Update ports/collada-dom/portfile.cmake

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* Update ports/collada-dom/portfile.cmake

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* Update ports/collada-dom/vcpkg.json

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* Update collada-dom.json

* Update collada-dom.json

* fix

---------

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
This commit is contained in:
Leonid Pospelov 2023-02-11 01:31:29 +06:00 committed by GitHub
parent 371892cc20
commit a65000bd39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 12 deletions

View File

@ -0,0 +1,23 @@
diff --git a/dom/src/dae/daeUtils.cpp b/dom/src/dae/daeUtils.cpp
index 7e3dc9a..dc94b5b 100644
--- a/dom/src/dae/daeUtils.cpp
+++ b/dom/src/dae/daeUtils.cpp
@@ -152,7 +152,7 @@ char cdom::getFileSeparator() {
const string& cdom::getSystemTmpDir() {
#ifdef WIN32
static string tmpDir = string(getenv("TMP")) + getFileSeparator();
-#elif defined(__linux__) || defined(__linux)
+#elif defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__)
static string tmpDir = "/tmp/";
#elif defined __APPLE_CC__
static string tmpDir = string(getenv("TMPDIR"));
@@ -171,7 +171,7 @@ string cdom::getRandomFileName() {
std::string tmp(tmpnam(&tmpbuffer[0]));
#ifdef WIN32
randomSegment = tmp.substr(tmp.find_last_of('\\')+1);
-#elif defined(__linux__) || defined(__linux)
+#elif defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__)
randomSegment = tmp.substr(tmp.find_last_of('/')+1);
#elif defined __APPLE_CC__
randomSegment = tmp.substr(tmp.find_last_of('/')+1);

View File

@ -9,20 +9,20 @@ vcpkg_from_github(
use-uriparser.patch
use-vcpkg-minizip.patch
fix-shared-keyword.patch
fix-emscripten.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/collada_dom-2.5)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/collada_dom-2.5)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# Handle copyright
file(INSTALL ${SOURCE_PATH}/licenses/license_e.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/licenses/license_e.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_fixup_pkgconfig()

View File

@ -1,9 +1,10 @@
{
"name": "collada-dom",
"version-string": "2.5.0",
"port-version": 6,
"version": "2.5.0",
"port-version": 7,
"description": "The COLLADA Document Object Model (DOM) is an application programming interface (API) that provides a C++ object representation of a COLLADA XML instance document.",
"homepage": "https://github.com/rdiankov/collada-dom",
"license": null,
"dependencies": [
"boost-filesystem",
"boost-system",
@ -11,6 +12,14 @@
"minizip",
"pcre",
"uriparser",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}

View File

@ -1606,7 +1606,7 @@
},
"collada-dom": {
"baseline": "2.5.0",
"port-version": 6
"port-version": 7
},
"colmap": {
"baseline": "2022-03-14",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1e2fef9034d7819a290b57709aa115628cede76a",
"version": "2.5.0",
"port-version": 7
},
{
"git-tree": "c33581459a51d5ef7cc436a8aebb9d330224a6f3",
"version-string": "2.5.0",