diff --git a/blank-plugin/fetch_jamba.cmake b/blank-plugin/fetch_jamba.cmake index c67c57d..9a0b453 100644 --- a/blank-plugin/fetch_jamba.cmake +++ b/blank-plugin/fetch_jamba.cmake @@ -9,10 +9,13 @@ else() set(FETCHCONTENT_SOURCE_DIR_JAMBA "") endif() -set(JAMBA_GIT_REPO "https://github.com/pongasoft/jamba" CACHE STRING "Jamba git repository url" FORCE) -set(JAMBA_GIT_TAG [-jamba_git_hash-] CACHE STRING "Jamba git tag" FORCE) +set(JAMBA_GIT_REPO "https://github.com/pongasoft/jamba" CACHE STRING "Jamba git repository url") +set(JAMBA_GIT_TAG [-jamba_git_hash-] CACHE STRING "Jamba git tag") +set(JAMBA_DOWNLOAD_URL "${JAMBA_GIT_REPO}/archive/refs/tags/[-jamba_git_hash-].zip" CACHE STRING "Jamba download url") +set(JAMBA_DOWNLOAD_URL_HASH "[-jamba_download_url_hash-]" CACHE STRING "Jamba download url hash") -FetchContent_Declare(jamba +if(JAMBA_DOWNLOAD_URL STREQUAL "" OR JAMBA_DOWNLOAD_URL_HASH STREQUAL "") + FetchContent_Declare(jamba GIT_REPOSITORY ${JAMBA_GIT_REPO} GIT_TAG ${JAMBA_GIT_TAG} GIT_CONFIG advice.detachedHead=false @@ -24,6 +27,23 @@ FetchContent_Declare(jamba INSTALL_COMMAND "" TEST_COMMAND "" ) + set(JAMBA_FETCH_SOURCE "${JAMBA_GIT_REPO}/tree/${JAMBA_GIT_TAG}") +else() + FetchContent_Declare(jamba + URL "${JAMBA_DOWNLOAD_URL}" + URL_HASH "${JAMBA_DOWNLOAD_URL_HASH}" + DOWNLOAD_EXTRACT_TIMESTAMP true + SOURCE_DIR "${CMAKE_BINARY_DIR}/jamba" + BINARY_DIR "${CMAKE_BINARY_DIR}/jamba-build" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) + set(JAMBA_FETCH_SOURCE "${JAMBA_DOWNLOAD_URL}") +endif() + + FetchContent_GetProperties(jamba) @@ -32,7 +52,7 @@ if(NOT jamba_POPULATED) if(FETCHCONTENT_SOURCE_DIR_JAMBA) message(STATUS "Using jamba from local ${FETCHCONTENT_SOURCE_DIR_JAMBA}") else() - message(STATUS "Fetching jamba ${JAMBA_GIT_REPO}/tree/${JAMBA_GIT_TAG}") + message(STATUS "Fetching jamba from ${JAMBA_FETCH_SOURCE}") endif() FetchContent_Populate(jamba) diff --git a/create-plugin.py b/create-plugin.py index 6659107..7b2e889 100755 --- a/create-plugin.py +++ b/create-plugin.py @@ -39,6 +39,7 @@ parser.add_argument("-d", "--directory", help="The directory for the project") parser.add_argument("-j", "--project", help="The name of the project") parser.add_argument("-g", "--jambagithash", help="The git hash for jamba") +parser.add_argument("--jamba_download_url_hash", help="The hash for jamba download url (SHA256=xxx)") parser.add_argument("-s", "--downloadsdk", help="Download the VST SDK", action="store_true") args = parser.parse_args() @@ -138,6 +139,8 @@ def config(plugin): plugin['jamba_git_hash'] = subprocess.run(['git', 'describe', '--tags', jambaGitSha], cwd=blank_plugin_root, capture_output=True, text=True).stdout.rstrip() +plugin['jamba_download_url_hash'] = args.jamba_download_url_hash if args.jamba_download_url_hash else '' + config(plugin) diff --git a/jamba.cmake b/jamba.cmake index b3e3a0f..16187b3 100644 --- a/jamba.cmake +++ b/jamba.cmake @@ -46,7 +46,7 @@ endif() #------------------------------------------------------------------------ set(JAMBA_MAJOR_VERSION 7) set(JAMBA_MINOR_VERSION 0) -set(JAMBA_PATCH_VERSION 0) +set(JAMBA_PATCH_VERSION 1) execute_process(COMMAND git describe --long --dirty --abbrev=10 --tags RESULT_VARIABLE result OUTPUT_VARIABLE JAMBA_GIT_VERSION