From ac51a7c3d11486f3929748077386050576a39f81 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Tue, 23 Mar 2021 19:01:18 +0100 Subject: [PATCH] Add new option DEP_DOWNLOAD_DIR and go with URLs everywhere --- deps/Blosc/Blosc.cmake | 11 +++++++---- deps/Boost/Boost.cmake | 23 +++++++++++++++++++++-- deps/CGAL/CGAL.cmake | 8 ++++---- deps/CMakeLists.txt | 20 +++----------------- deps/Cereal/Cereal.cmake | 2 +- deps/GMP/GMP.cmake | 3 ++- deps/MPFR/MPFR.cmake | 2 ++ deps/OpenCSG/OpenCSG.cmake | 6 ++++-- deps/OpenEXR/OpenEXR.cmake | 4 +++- deps/OpenSSL/OpenSSL.cmake | 1 + deps/PNG/PNG.cmake | 6 ++++-- deps/Qhull/Qhull.cmake | 6 ++---- deps/TBB/TBB.cmake | 2 +- deps/ZLIB/ZLIB.cmake | 10 ++++++---- deps/wxWidgets/wxWidgets.cmake | 6 ++++-- 15 files changed, 65 insertions(+), 45 deletions(-) diff --git a/deps/Blosc/Blosc.cmake b/deps/Blosc/Blosc.cmake index 08895019f..ec8d0abc4 100644 --- a/deps/Blosc/Blosc.cmake +++ b/deps/Blosc/Blosc.cmake @@ -7,11 +7,14 @@ else() endif() prusaslicer_add_cmake_project(Blosc - GIT_REPOSITORY https://github.com/Blosc/c-blosc.git - GIT_TAG e63775855294b50820ef44d1b157f4de1cc38d3e #v1.17.0 + # GIT_REPOSITORY https://github.com/Blosc/c-blosc.git + # GIT_TAG e63775855294b50820ef44d1b157f4de1cc38d3e #v1.17.0 + URL https://github.com/Blosc/c-blosc/archive/refs/tags/v1.17.0.zip + URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9 DEPENDS ${ZLIB_PKG} - PATCH_COMMAND ${GIT_EXECUTABLE} reset --hard && ${GIT_EXECUTABLE} clean -df && - ${GIT_EXECUTABLE} apply --whitespace=nowarn ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch + PATCH_COMMAND #${GIT_EXECUTABLE} reset --hard && ${GIT_EXECUTABLE} clean -df && + #${GIT_EXECUTABLE} apply --whitespace=nowarn ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch + ${GIT_EXECUTABLE} apply --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED=${_build_shared} diff --git a/deps/Boost/Boost.cmake b/deps/Boost/Boost.cmake index 747e63df6..8d50e3185 100644 --- a/deps/Boost/Boost.cmake +++ b/deps/Boost/Boost.cmake @@ -117,15 +117,34 @@ set(_build_cmd ${_build_cmd} set(_install_cmd ${_build_cmd} --prefix=${_prefix} install) - - ExternalProject_Add( dep_Boost URL "https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz" URL_HASH SHA256=882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9 + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Boost CONFIGURE_COMMAND "${_bootstrap_cmd}" PATCH_COMMAND ${_patch_command} BUILD_COMMAND "${_build_cmd}" BUILD_IN_SOURCE ON INSTALL_COMMAND "${_install_cmd}" ) + +if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") + # Patch the boost::polygon library with a custom one. + ExternalProject_Add(dep_boost_polygon + EXCLUDE_FROM_ALL ON + # GIT_REPOSITORY "https://github.com/prusa3d/polygon" + # GIT_TAG prusaslicer_gmp + URL https://github.com/prusa3d/polygon/archive/679b55115a1b106d918de8c7adf6ff0478abda1e.zip + URL_HASH SHA256=b3f288fcd3cee925753d1352783cefc98a5cab777dd0a5a985493a9b2d931752 + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/boost_polygon + DEPENDS dep_Boost + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CMAKE_CURRENT_BINARY_DIR}/dep_boost_polygon-prefix/src/dep_boost_polygon/include/boost/polygon" + "${DESTDIR}/usr/local/include/boost/polygon" + ) + # Only override boost::Polygon Voronoi implementation with Vojtech's GMP hacks on 64bit platforms. + list(APPEND _dep_list "dep_boost_polygon") +endif () \ No newline at end of file diff --git a/deps/CGAL/CGAL.cmake b/deps/CGAL/CGAL.cmake index 7703cc849..bee64d75f 100644 --- a/deps/CGAL/CGAL.cmake +++ b/deps/CGAL/CGAL.cmake @@ -1,10 +1,10 @@ prusaslicer_add_cmake_project( CGAL - GIT_REPOSITORY https://github.com/CGAL/cgal.git - GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0 + # GIT_REPOSITORY https://github.com/CGAL/cgal.git + # GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0 # For whatever reason, this keeps downloading forever (repeats downloads if finished) - # URL https://github.com/CGAL/cgal/archive/releases/CGAL-5.0.zip - # URL_HASH SHA256=bd9327be903ab7ee379a8a7a0609eba0962f5078d2497cf8e13e8e1598584154 + URL https://github.com/CGAL/cgal/archive/releases/CGAL-5.0.zip + URL_HASH SHA256=bd9327be903ab7ee379a8a7a0609eba0962f5078d2497cf8e13e8e1598584154 DEPENDS dep_Boost dep_GMP dep_MPFR ) diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 3b159a5f7..a3bcea25a 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -32,6 +32,7 @@ if (NPROC EQUAL 0) endif () set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory") +set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Path for downloaded source packages.") option(DEP_DEBUG "Build debug variants (only applicable on Windows)" ON) @@ -46,6 +47,7 @@ endif() # option(DEP_BUILD_IGL_STATIC "Build IGL as a static library. Might cause link errors and increase binary size." OFF) message(STATUS "PrusaSlicer deps DESTDIR: ${DESTDIR}") +message(STATUS "PrusaSlicer dowload dir for source packages: ${DEP_DOWNLOAD_DIR}") message(STATUS "PrusaSlicer deps debug build: ${DEP_DEBUG}") find_package(Git REQUIRED) @@ -71,6 +73,7 @@ function(prusaslicer_add_cmake_project projectname) dep_${projectname} EXCLUDE_FROM_ALL ON INSTALL_DIR ${DESTDIR}/usr/local + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname} ${_gen} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local @@ -187,23 +190,6 @@ set(_dep_list ${EXPAT_PKG} ) -if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") - # Patch the boost::polygon library with a custom one. - ExternalProject_Add(dep_boost_polygon - EXCLUDE_FROM_ALL ON - GIT_REPOSITORY "https://github.com/prusa3d/polygon" - GIT_TAG prusaslicer_gmp - DEPENDS dep_Boost - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory - "${CMAKE_CURRENT_BINARY_DIR}/dep_boost_polygon-prefix/src/dep_boost_polygon/include/boost/polygon" - "${DESTDIR}/usr/local/include/boost/polygon" - ) - # Only override boost::Polygon Voronoi implementation with Vojtech's GMP hacks on 64bit platforms. - list(APPEND _dep_list "dep_boost_polygon") -endif () - if (MSVC) # Experimental #list(APPEND _dep_list "dep_qhull") diff --git a/deps/Cereal/Cereal.cmake b/deps/Cereal/Cereal.cmake index 73aeedd05..28912ff4f 100644 --- a/deps/Cereal/Cereal.cmake +++ b/deps/Cereal/Cereal.cmake @@ -1,6 +1,6 @@ prusaslicer_add_cmake_project(Cereal URL "https://github.com/USCiLab/cereal/archive/v1.2.2.tar.gz" -# URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae + URL_HASH SHA256=1921f26d2e1daf9132da3c432e2fd02093ecaedf846e65d7679ddf868c7289c4 CMAKE_ARGS -DJUST_INSTALL_CEREAL=on ) \ No newline at end of file diff --git a/deps/GMP/GMP.cmake b/deps/GMP/GMP.cmake index 4b965ae13..6b0f97085 100644 --- a/deps/GMP/GMP.cmake +++ b/deps/GMP/GMP.cmake @@ -43,8 +43,9 @@ else () endif () ExternalProject_Add(dep_GMP - # URL https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 URL https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2 + URL_HASH SHA256=eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP BUILD_IN_SOURCE ON CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" ${_gmp_build_tgt} BUILD_COMMAND make -j diff --git a/deps/MPFR/MPFR.cmake b/deps/MPFR/MPFR.cmake index a4e30e645..c29bb39ad 100644 --- a/deps/MPFR/MPFR.cmake +++ b/deps/MPFR/MPFR.cmake @@ -27,6 +27,8 @@ else () ExternalProject_Add(dep_MPFR URL http://ftp.vim.org/ftp/gnu/mpfr/mpfr-3.1.6.tar.bz2 https://www.mpfr.org/mpfr-3.1.6/mpfr-3.1.6.tar.bz2 # mirrors are allowed + URL_HASH SHA256=cf4f4b2d80abb79e820e78c8077b6725bbbb4e8f41896783c899087be0e94068 + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR BUILD_IN_SOURCE ON CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt} BUILD_COMMAND make -j diff --git a/deps/OpenCSG/OpenCSG.cmake b/deps/OpenCSG/OpenCSG.cmake index fda74cd45..4d980fecd 100644 --- a/deps/OpenCSG/OpenCSG.cmake +++ b/deps/OpenCSG/OpenCSG.cmake @@ -1,7 +1,9 @@ prusaslicer_add_cmake_project(OpenCSG - GIT_REPOSITORY https://github.com/floriankirsch/OpenCSG.git - GIT_TAG 83e274457b46c9ad11a4ee599203250b1618f3b9 #v1.4.2 + # GIT_REPOSITORY https://github.com/floriankirsch/OpenCSG.git + # GIT_TAG 83e274457b46c9ad11a4ee599203250b1618f3b9 #v1.4.2 + URL https://github.com/floriankirsch/OpenCSG/archive/refs/tags/opencsg-1-4-2-release.zip + URL_HASH SHA256=51afe0db79af8386e2027d56d685177135581e0ee82ade9d7f2caff8deab5ec5 PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in ./CMakeLists.txt DEPENDS dep_GLEW ) diff --git a/deps/OpenEXR/OpenEXR.cmake b/deps/OpenEXR/OpenEXR.cmake index e099e5213..046223fed 100644 --- a/deps/OpenEXR/OpenEXR.cmake +++ b/deps/OpenEXR/OpenEXR.cmake @@ -1,5 +1,7 @@ prusaslicer_add_cmake_project(OpenEXR - GIT_REPOSITORY https://github.com/openexr/openexr.git + # GIT_REPOSITORY https://github.com/openexr/openexr.git + URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip + URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de DEPENDS ${ZLIB_PKG} GIT_TAG v2.5.5 CMAKE_ARGS diff --git a/deps/OpenSSL/OpenSSL.cmake b/deps/OpenSSL/OpenSSL.cmake index a9fba205f..9b716f6de 100644 --- a/deps/OpenSSL/OpenSSL.cmake +++ b/deps/OpenSSL/OpenSSL.cmake @@ -19,6 +19,7 @@ ExternalProject_Add(dep_OpenSSL EXCLUDE_FROM_ALL ON URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0l.tar.gz" URL_HASH SHA256=e2acf0cf58d9bff2b42f2dc0aee79340c8ffe2c5e45d3ca4533dd5d4f5775b1d + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL BUILD_IN_SOURCE ON CONFIGURE_COMMAND ./Configure ${_cross_arch} "--prefix=${DESTDIR}/usr/local" diff --git a/deps/PNG/PNG.cmake b/deps/PNG/PNG.cmake index e07afec6d..fe74885ac 100644 --- a/deps/PNG/PNG.cmake +++ b/deps/PNG/PNG.cmake @@ -6,8 +6,10 @@ else () endif () prusaslicer_add_cmake_project(PNG - GIT_REPOSITORY https://github.com/glennrp/libpng.git - GIT_TAG v1.6.35 + # GIT_REPOSITORY https://github.com/glennrp/libpng.git + # GIT_TAG v1.6.35 + URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip + URL_HASH SHA256=3d22d46c566b1761a0e15ea397589b3a5f36ac09b7c785382e6470156c04247f DEPENDS ${ZLIB_PKG} CMAKE_ARGS -DPNG_SHARED=OFF diff --git a/deps/Qhull/Qhull.cmake b/deps/Qhull/Qhull.cmake index fa18c7815..2385f6748 100644 --- a/deps/Qhull/Qhull.cmake +++ b/deps/Qhull/Qhull.cmake @@ -1,9 +1,7 @@ include(GNUInstallDirs) prusaslicer_add_cmake_project(Qhull - # URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz" - # URL_HASH SHA256=619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0 - GIT_REPOSITORY https://github.com/qhull/qhull.git - GIT_TAG 7afedcc73666e46a9f1d74632412ebecf53b1b30 # v7.3.2 plus the mac build patch + URL "https://github.com/qhull/qhull/archive/v8.0.0.zip" + URL_HASH SHA256=7edae57142989690bc432893da47db5b7069a150c82ba113e46977904ca326ef CMAKE_ARGS -DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR} ) diff --git a/deps/TBB/TBB.cmake b/deps/TBB/TBB.cmake index 463010e45..7315716e0 100644 --- a/deps/TBB/TBB.cmake +++ b/deps/TBB/TBB.cmake @@ -11,7 +11,7 @@ prusaslicer_add_cmake_project( ) if (MSVC) - add_debug_dep(dep_tbb) + add_debug_dep(dep_TBB) endif () diff --git a/deps/ZLIB/ZLIB.cmake b/deps/ZLIB/ZLIB.cmake index 574f5b134..06f944081 100644 --- a/deps/ZLIB/ZLIB.cmake +++ b/deps/ZLIB/ZLIB.cmake @@ -1,8 +1,10 @@ prusaslicer_add_cmake_project(ZLIB - GIT_REPOSITORY https://github.com/madler/zlib.git - GIT_TAG v1.2.11 - PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df && - ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-Respect-BUILD_SHARED_LIBS.patch + # GIT_REPOSITORY https://github.com/madler/zlib.git + # GIT_TAG v1.2.11 + URL https://github.com/madler/zlib/archive/refs/tags/v1.2.11.zip + URL_HASH SHA256=f5cc4ab910db99b2bdbba39ebbdc225ffc2aa04b4057bc2817f1b94b6978cfc3 + PATCH_COMMAND #${GIT_EXECUTABLE} checkout -f -- . && git clean -df && + ${GIT_EXECUTABLE} apply --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-Respect-BUILD_SHARED_LIBS.patch CMAKE_ARGS -DSKIP_INSTALL_FILES=ON # Prevent installation of man pages et al. -DCMAKE_POSITION_INDEPENDENT_CODE=ON diff --git a/deps/wxWidgets/wxWidgets.cmake b/deps/wxWidgets/wxWidgets.cmake index a060faedc..3847ff6cd 100644 --- a/deps/wxWidgets/wxWidgets.cmake +++ b/deps/wxWidgets/wxWidgets.cmake @@ -10,8 +10,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") endif() prusaslicer_add_cmake_project(wxWidgets - GIT_REPOSITORY "https://github.com/prusa3d/wxWidgets" - GIT_TAG tm_cross_compile #${_wx_git_tag} + # GIT_REPOSITORY "https://github.com/prusa3d/wxWidgets" + # GIT_TAG tm_cross_compile #${_wx_git_tag} + URL https://github.com/prusa3d/wxWidgets/archive/refs/heads/tm_cross_compile.zip + URL_HASH SHA256=592aa716a4e8d609b74cdbd08a943e628f3c32b3ca6e4f76fb5f3d5698898dc1 DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} CMAKE_ARGS -DwxBUILD_PRECOMP=ON