From 855659adc17e579e9879974c6d57aabc20bed8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 4 Mar 2023 22:53:10 +0100 Subject: [PATCH 1/2] Automatically download OpenSFX for Linux builds Allow skipping of download if prepopulated --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97b23a10f7..59a5492d8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,6 +163,7 @@ endif () # If OS is Linux, import OpenSoundEffects and OpenMusic if(UNIX AND NOT APPLE) set(DOWNLOAD_OPENMSX ON) + set(DOWNLOAD_OPENSFX ON) endif() # LIST of supported flags, use SET_CHECK_CXX_FLAGS() to apply to target. @@ -456,6 +457,7 @@ if (NOT MACOS_BUNDLE OR (MACOS_BUNDLE AND WITH_TESTS)) include(${ROOT_DIR}/cmake/download.cmake) download_openrct2_zip( ZIP_VERSION ${OPENSFX_VERSION} + SKIP_IF_EXISTS ${CMAKE_SOURCE_DIR}/data/assetpack/openrct2.sound.parkap DOWNLOAD_DIR \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/ ZIP_URL ${OPENSFX_URL} SHA1 ${OPENSFX_SHA1} From 645f620c2cfeb1d255e19406aa14bd0cab9787b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 5 Mar 2023 23:06:01 +0100 Subject: [PATCH 2/2] Scope zipversion cache files to their downloads --- cmake/download.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/download.cmake b/cmake/download.cmake index 17a9d25833..b129048a37 100644 --- a/cmake/download.cmake +++ b/cmake/download.cmake @@ -9,8 +9,8 @@ function(download_openrct2_zip) if (NOT EXISTS ${DOWNLOAD_OPENRCT2_DOWNLOAD_DIR}) set(DOWNLOAD_ZIP 1) else () - if (EXISTS "${DOWNLOAD_OPENRCT2_DOWNLOAD_DIR}/zipversion") - file(READ "${DOWNLOAD_OPENRCT2_DOWNLOAD_DIR}/zipversion" DOWNLOAD_OPENRCT2_CACHED_VERSION) + if (EXISTS "${DOWNLOAD_OPENRCT2_DOWNLOAD_DIR}/${ZIP_FILE_NAME}.zipversion") + file(READ "${DOWNLOAD_OPENRCT2_DOWNLOAD_DIR}/${ZIP_FILE_NAME}.zipversion" DOWNLOAD_OPENRCT2_CACHED_VERSION) if (NOT ${DOWNLOAD_OPENRCT2_CACHED_VERSION} STREQUAL ${DOWNLOAD_OPENRCT2_ZIP_VERSION}) message("Cache ${DOWNLOAD_OPENRCT2_DOWNLOAD_DIR} not up to date") set(DOWNLOAD_ZIP 1) @@ -42,7 +42,7 @@ function(download_openrct2_zip) ) endif() file(WRITE - "${DOWNLOAD_OPENRCT2_DOWNLOAD_DIR}/zipversion" + "${DOWNLOAD_OPENRCT2_DOWNLOAD_DIR}/${ZIP_FILE_NAME}.zipversion" "${DOWNLOAD_OPENRCT2_ZIP_VERSION}" ) file(REMOVE "${DOWNLOAD_OPENRCT2_DOWNLOAD_DIR}/${ZIP_FILE_NAME}")