diff --git a/DockerfileLinuxARMPrebuild b/DockerfileLinuxARMPrebuild index 4231212..b1ce7cd 100644 --- a/DockerfileLinuxARMPrebuild +++ b/DockerfileLinuxARMPrebuild @@ -19,6 +19,9 @@ WORKDIR /builder #Copy existing sources, if any COPY jcef /jcef +#Copy cmake patching script +COPY scripts/patch_cmake.py . + #Copy and launch run script COPY scripts/run_linux_prebuild.sh . RUN chmod +x run_linux_prebuild.sh diff --git a/compile_macosx.sh b/compile_macosx.sh index 44843e6..fd6a829 100755 --- a/compile_macosx.sh +++ b/compile_macosx.sh @@ -45,6 +45,9 @@ else cd jcef fi +#CMake patching +python3 ../scripts/patch_cmake.py cmake/DownloadCEF.cmake + # Create and enter the `jcef_build` directory. # The `jcef_build` directory name is required by other JCEF tooling # and should not be changed. diff --git a/scripts/patch_cmake.py b/scripts/patch_cmake.py index 548e168..7f25445 100644 --- a/scripts/patch_cmake.py +++ b/scripts/patch_cmake.py @@ -1,35 +1,18 @@ -#Small script to patch CMakeLists.txt files with custom build options -#Will replace file contents between two markers ("Determine the platform" -#and "Add this project's cmake") -#Usage: python patch_cmake.py +#Small script to patch our cmake download locations +#Usage: python patch_cmake.py import sys input = sys.argv[1] -patch = sys.argv[2] -print("Patching "+input+" to accept further build architectures...") +print("Patching "+input+" to use spotify for downloads again...") f = open(input, "r") -p = open(patch, "r") result = "" -inpatch = False for x in f: - if x.startswith("# Determine the platform"): - inpatch = True - for y in p: - result += y - elif x.startswith("# Add this project's cmake"): - inpatch = False - if inpatch == False: - #Patch minimum cmake version to not break our builds on linux - if x.startswith("cmake_minimum_required"): - result += "cmake_minimum_required(VERSION 3.13)\n" - else: - result += x + result += x.replace("https://cache-redirector.jetbrains.com/intellij-jbr/", "https://cef-builds.spotifycdn.com/") f.close() -p.close() f = open(input, "w") f.write(result) diff --git a/scripts/run_linux.sh b/scripts/run_linux.sh index e773556..4f20b95 100644 --- a/scripts/run_linux.sh +++ b/scripts/run_linux.sh @@ -28,6 +28,9 @@ else cd /jcef fi +#CMake patching +python3 /builder/patch_cmake.py cmake/DownloadCEF.cmake + # Create and enter the `jcef_build` directory. # The `jcef_build` directory name is required by other JCEF tooling # and should not be changed. diff --git a/scripts/run_linux_prebuild.sh b/scripts/run_linux_prebuild.sh index 56ce161..e014b77 100644 --- a/scripts/run_linux_prebuild.sh +++ b/scripts/run_linux_prebuild.sh @@ -25,6 +25,9 @@ else cd /jcef fi +#CMake patching +python3 /builder/patch_cmake.py cmake/DownloadCEF.cmake + # Create and enter the `jcef_build` directory. # The `jcef_build` directory name is required by other JCEF tooling # and should not be changed. diff --git a/scripts/run_windows.bat b/scripts/run_windows.bat index 263394f..3c615ab 100644 --- a/scripts/run_windows.bat +++ b/scripts/run_windows.bat @@ -12,6 +12,8 @@ if exist "jcef\README.md" (echo "Found existing files to build" && cd jcef) ^ else (echo "Did not find files to build - cloning..." && GOTO :CLONE) :BUILD +:: CMakeLists patching +python C:/patch_cmake.py cmake/DownloadCEF.cmake :: Prepare build dir mkdir jcef_build && cd jcef_build