diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 967f47aac2..8672a50310 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -155,7 +155,7 @@ if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE) endif () function(orcaslicer_add_cmake_project projectname) - cmake_parse_arguments(P_ARGS "FORWARD_CONFIG" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN}) + cmake_parse_arguments(P_ARGS "FORWARD_CONFIG" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND;SOURCE_DIR" "CMAKE_ARGS" ${ARGN}) # MSVC is true for clang-cl as well, so the sub-build toolchain has to key on the # generator. A non-Visual-Studio superbuild passes its own generator down, and with @@ -196,12 +196,18 @@ function(orcaslicer_add_cmake_project projectname) set(_build_j "-j${NPROC}") endif () + set(_source_dir_arg "") + if (P_ARGS_SOURCE_DIR) + set(_source_dir_arg SOURCE_DIR ${P_ARGS_SOURCE_DIR}) + endif () + if (NOT IS_CROSS_COMPILE OR NOT APPLE) ExternalProject_Add( dep_${projectname} EXCLUDE_FROM_ALL ON INSTALL_DIR ${DESTDIR} DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname} + ${_source_dir_arg} ${_gen} CMAKE_ARGS -DCMAKE_POLICY_VERSION_MINIMUM=3.5 @@ -234,12 +240,14 @@ if (NOT IS_CROSS_COMPILE OR NOT APPLE) # note for future devs: shared libs may actually create a size reduction # but orcaslicer_deps tends to get really funny regarding linking after that (notably boost) # so, as much as I would like to use that, it's not happening - ExternalProject_Add_Step(dep_${projectname} free_download_space - DEPENDEES download # do after download - COMMENT "Freeing Space: Removing source archive" - WORKING_DIRECTORY ${DEP_DOWNLOAD_DIR} - COMMAND ${CMAKE_COMMAND} -E rm -rf ${projectname} - ) + if (NOT P_ARGS_SOURCE_DIR) + ExternalProject_Add_Step(dep_${projectname} free_download_space + DEPENDEES download # do after download + COMMENT "Freeing Space: Removing source archive" + WORKING_DIRECTORY ${DEP_DOWNLOAD_DIR} + COMMAND ${CMAKE_COMMAND} -E rm -rf ${projectname} + ) + endif () ExternalProject_Add_Step(dep_${projectname} free_build_space DEPENDEES install # do after install COMMENT "Freeing Space: Removing source and build files" @@ -253,6 +261,7 @@ else() EXCLUDE_FROM_ALL ON INSTALL_DIR ${DESTDIR} DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname} + ${_source_dir_arg} ${_gen} CMAKE_ARGS -DCMAKE_POLICY_VERSION_MINIMUM=3.5 diff --git a/deps/DataChannel/DataChannel.cmake b/deps/DataChannel/DataChannel.cmake index 23c256b365..c5ab8a8f1a 100644 --- a/deps/DataChannel/DataChannel.cmake +++ b/deps/DataChannel/DataChannel.cmake @@ -5,12 +5,13 @@ # It vendors plog, usrsctp and libjuice as git submodules, which a plain # GitHub tag tarball does not include. The flatpak sandbox has no network # access during the build, so there the manifest itself clones the repo -# (submodules and all) straight into this ExternalProject's default source -# dir before the sandbox closes; with no download method given here and that -# dir already non-empty, ExternalProject_Add silently uses it as-is instead -# of trying its own (network) git step. +# (submodules and all) into the dependency download directory before the +# sandbox closes. ExternalProject_Add is pointed at that existing checkout +# instead of being given its own network-dependent download method. if (FLATPAK) - set(_datachannel_source "") + set(_datachannel_source + SOURCE_DIR ${DEP_DOWNLOAD_DIR}/DataChannel + ) else() set(_datachannel_source GIT_REPOSITORY https://github.com/paullouisageneau/libdatachannel.git diff --git a/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml b/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml index e6aa25d88c..7cd432ee68 100644 --- a/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml +++ b/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml @@ -326,16 +326,13 @@ modules: dest: external-packages/FFMPEG # libdatachannel v0.24.5 - # Use git instead of archive: it vendors plog, usrsctp and libjuice as - # git submodules, which a plain GitHub tag tarball does not include. - # Cloned (with submodules) straight into the ExternalProject source dir - # that deps/DataChannel/DataChannel.cmake expects, since the sandboxed - # build step has no network to do this itself. + # The Git checkout includes the submodules that are missing from the + # GitHub source archive. DataChannel.cmake consumes it as SOURCE_DIR. - type: git url: https://github.com/paullouisageneau/libdatachannel.git tag: v0.24.5 commit: 443f6934d9007eb7076ab7825ba330f355fcbead - dest: deps/build_flatpak/dep_DataChannel-prefix/src/dep_DataChannel + dest: external-packages/DataChannel # --------------------------------------------------------------- # Fallback archives for deps normally provided by the GNOME SDK.