Skip to content

Commit

Permalink
Use download url/hash in blank plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ypujante committed May 27, 2023
1 parent 557e5b4 commit 3a01655
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
28 changes: 24 additions & 4 deletions blank-plugin/fetch_jamba.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand All @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions create-plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion jamba.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a01655

Please sign in to comment.