Skip to content

Commit

Permalink
[collada-dom] fix emscripten build (#29562)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Pospelove and Cheney-W committed Feb 10, 2023
1 parent 371892c commit a65000b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 12 deletions.
23 changes: 23 additions & 0 deletions ports/collada-dom/fix-emscripten.patch
Original file line number Diff line number Diff line change
@@ -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);

18 changes: 9 additions & 9 deletions ports/collada-dom/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

vcpkg_fixup_pkgconfig()
file(INSTALL "${SOURCE_PATH}/licenses/license_e.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

vcpkg_fixup_pkgconfig()
13 changes: 11 additions & 2 deletions ports/collada-dom/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
{
"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",
"libxml2",
"minizip",
"pcre",
"uriparser",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@
},
"collada-dom": {
"baseline": "2.5.0",
"port-version": 6
"port-version": 7
},
"colmap": {
"baseline": "2022-03-14",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/collada-dom.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1e2fef9034d7819a290b57709aa115628cede76a",
"version": "2.5.0",
"port-version": 7
},
{
"git-tree": "c33581459a51d5ef7cc436a8aebb9d330224a6f3",
"version-string": "2.5.0",
Expand Down

0 comments on commit a65000b

Please sign in to comment.