restrict package finding to flatpak only

This commit is contained in:
Aidan Case 2024-03-06 18:14:29 -06:00
parent 611d0fe57b
commit b97dcd88b7
2 changed files with 15 additions and 86 deletions

22
deps/CMakeLists.txt vendored
View file

@ -42,8 +42,8 @@ endif ()
set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory")
set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/../DL_CACHE CACHE PATH "Path for downloaded source packages.")
set(REMOVE_DESTDIR_POSTPEND FALSE CACHE BOOL "Used in flatpak to remove the '/usr/local' ending in destdir")
if (NOT REMOVE_DESTDIR_POSTPEND)
set(FLATPAK FALSE CACHE BOOL "Toggles /usr/local path for building deps, the flatpak just shoves everything into /app")
if (NOT FLATPAK)
set(DESTDIR "${DESTDIR}/usr/local/")
endif()
@ -208,20 +208,28 @@ else()
include("deps-linux.cmake")
endif()
if(FLATPAK)
# flatpak bundles some deps with the layer, so attempt to find them first
find_package(ZLIB)
find_package(PNG)
find_package(EXPAT)
find_package(CURL)
find_package(JPEG)
find_package(TIFF)
find_package(Freetype)
endif()
set(ZLIB_PKG "")
find_package(ZLIB)
if (NOT ZLIB_FOUND)
include(ZLIB/ZLIB.cmake)
set(ZLIB_PKG dep_ZLIB)
endif ()
set(PNG_PKG "")
find_package(PNG)
if (NOT PNG_FOUND)
include(PNG/PNG.cmake)
set(PNG_PKG dep_PNG)
endif ()
set(EXPAT_PKG "")
find_package(EXPAT)
if (NOT EXPAT_FOUND)
include(EXPAT/EXPAT.cmake)
set(EXPAT_PKG dep_EXPAT)
@ -251,7 +259,6 @@ include(CGAL/CGAL.cmake)
include(NLopt/NLopt.cmake)
set(CURL_PKG "")
find_package(CURL)
if (NOT CURL_FOUND)
message(WARNING "no curl package found, building openssl and curl")
include(OpenSSL/OpenSSL.cmake)
@ -261,14 +268,12 @@ if (NOT CURL_FOUND)
endif ()
set(JPEG_PKG "")
find_package(JPEG)
if (NOT JPEG_FOUND)
include(JPEG/JPEG.cmake)
set(JPEG_PKG dep_JPEG)
endif()
set(TIFF_PKG "")
find_package(TIFF)
if (NOT TIFF_FOUND)
include(TIFF/TIFF.cmake)
set(TIFF_PKG "dep_TIFF")
@ -277,7 +282,6 @@ endif()
include(wxWidgets/wxWidgets.cmake)
set(FREETYPE_PKG "")
find_package(Freetype)
if(NOT FREETYPE_FOUND)
include(FREETYPE/FREETYPE.cmake)
set(FREETYPE_PKG "dep_FREETYPE")

View file

@ -106,82 +106,6 @@ modules:
cleanup:
- /
# - name: boost
# buildsystem: simple
# build-commands:
# - ./bootstrap.sh --prefix=/app --with-libraries=system,iostreams,filesystem,thread,log,locale,regex,date_time
# - ./b2 headers
# - ./b2 -j$FLATPAK_BUILDER_N_JOBS install variant=release cxxstd=17 --layout=system
# sources:
# - type: archive
# url: https://freefr.dl.sourceforge.net/project/boost/boost/1.78.0/boost_1_78_0.zip
# sha256: f22143b5528e081123c3c5ed437e92f648fe69748e95fa6e2bd41484e2986cc3
# cleanup:
# - /include
# - /lib/cmake
#- name: glfw
# buildsystem: cmake-ninja
# config-opts:
# - -DCMAKE_BUILD_TYPE=RelWithDebInfo
# - -DBUILD_SHARED_LIBS:BOOL=ON
# - -DGLFW_USE_WAYLAND=OFF
# sources:
# - type: git
# url: https://github.com/glfw/glfw.git
# tag: 3.3.9
# - type: patch
# path: patches/glfw-Don-t-crash-on-calls-to-focus-or-icon.patch
# cleanup:
# - /include
# - /lib/cmake
# - /lib/pkgconfig
#- name: wxwidgets
# buildsystem: cmake-ninja
# config-opts:
# - -DwxBUILD_PRECOMP=ON
# - -DwxBUILD_TOOLKIT=gtk3
# - -DwxBUILD_DEBUG_LEVEL=0
# - -DwxBUILD_SAMPLES=OFF
# - -DwxBUILD_SHARED=OFF
# - -DwxUSE_MEDIACTRL=ON
# - -DwxUSE_DETECT_SM=OFF
# - -DwxUSE_UNICODE=ON
# - -DwxUSE_PRIVATE_FONTS=1
# - -DwxUSE_OPENGL=ON
# - -DwxUSE_WEBREQUEST=ON
# - -DwxUSE_WEBVIEW=ON
# - -DwxUSE_REGEX=sys
# - -DwxUSE_LIBSDL=OFF
# - -DwxUSE_XTEST=OFF
# - -DwxUSE_STC=OFF
# - -DwxUSE_AUI=ON
# - -DwxUSE_LIBPNG=sys
# - -DwxUSE_ZLIB=sys
# - -DwxUSE_LIBJPEG=sys
# - -DwxUSE_LIBTIFF=sys
# - -DwxUSE_NANOSVG=OFF
# - -DwxUSE_EXPAT=sys
# sources:
# - type: archive
# url: https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.5/wxWidgets-3.1.5.tar.bz2
# sha256: d7b3666de33aa5c10ea41bb9405c40326e1aeb74ee725bb88f90f1d50270a224
# # https://github.com/bambulab/BambuStudio/issues/3279
# - type: patch
# path: patches/disable-gstplayer.patch
# # https://github.com/wxWidgets/wxWidgets/issues/23630
# - type: patch
# path: patches/0001-Add-support-for-building-WebView-with-libwebkit2gtk-.patch
# # wx-config/build fixes between 3.1.5 and 3.1.6
# - type: patch
# path: patches/wxwidgets-not-found.patch
# #- type: patch
# # path: patches/wxwidgets-system-def.patch
# cleanup:
# - /include
# - /lib/cmake
- name: orca_deps
buildsystem: simple
build-commands:
@ -194,7 +118,7 @@ modules:
-DCMAKE_PREFIX_PATH=/app \
-DDESTDIR=/app \
-DCMAKE_INSTALL_LIBDIR=/app/lib \
-DREMOVE_DESTDIR_POSTPEND=ON \
-DFLATPAK=ON \
-DCMAKE_INSTALL_PREFIX=/app
cmake --build .
@ -332,6 +256,7 @@ modules:
-DSLIC3R_BUILD_TESTS=OFF \
-DSLIC3R_DESKTOP_INTEGRATION=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DFLATPAK=ON \
-DBBL_RELEASE_TO_PUBLIC=1
CXXFLAGS=-std=gnu++20 cmake --build . --target install -j$FLATPAK_BUILDER_N_JOBS