mirror of
				https://github.com/jcefmaven/jcefbuild.git
				synced 2025-11-04 16:33:40 +08:00 
			
		
		
		
	Patch jetbrains download url
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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 <input> <patch>
 | 
			
		||||
#Small script to patch our cmake download locations
 | 
			
		||||
#Usage: python patch_cmake.py <file>
 | 
			
		||||
 | 
			
		||||
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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user