diff options
Diffstat (limited to 'unmaintained/openjfx12/crosscompile.patch')
-rw-r--r-- | unmaintained/openjfx12/crosscompile.patch | 224 |
1 files changed, 224 insertions, 0 deletions
diff --git a/unmaintained/openjfx12/crosscompile.patch b/unmaintained/openjfx12/crosscompile.patch new file mode 100644 index 0000000000..4c8004ee88 --- /dev/null +++ b/unmaintained/openjfx12/crosscompile.patch | |||
@@ -0,0 +1,224 @@ | |||
1 | --- old/build.gradle | ||
2 | +++ new/build.gradle | ||
3 | @@ -2509,6 +2509,12 @@ | ||
4 | |||
5 | } | ||
6 | |||
7 | +def pkgConfigEnv = [ | ||
8 | + PKG_CONFIG_PATH: "$PKG_CONFIG_PATH", | ||
9 | + PKG_CONFIG_SYSROOT_DIR: "$PKG_CONFIG_SYSROOT_DIR" | ||
10 | +] | ||
11 | + | ||
12 | + | ||
13 | project(":media") { | ||
14 | configurations { | ||
15 | media | ||
16 | @@ -2614,6 +2620,7 @@ | ||
17 | |||
18 | doLast { | ||
19 | exec { | ||
20 | + environment(pkgConfigEnv) | ||
21 | commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}") | ||
22 | args("JAVA_HOME=${JDK_HOME}", "GENERATED_HEADERS_DIR=${generatedHeadersDir}", | ||
23 | "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=jfxmedia", | ||
24 | @@ -2643,6 +2650,7 @@ | ||
25 | enabled = IS_COMPILE_MEDIA | ||
26 | doLast { | ||
27 | exec { | ||
28 | + environment(pkgConfigEnv) | ||
29 | commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/gstreamer-lite") | ||
30 | args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=gstreamer-lite", | ||
31 | IS_64 ? "ARCH=x64" : "ARCH=x32", "CC=${mediaProperties.compiler}", | ||
32 | @@ -2661,6 +2669,7 @@ | ||
33 | |||
34 | doLast { | ||
35 | exec { | ||
36 | + environment(pkgConfigEnv) | ||
37 | commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/fxplugins") | ||
38 | args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=fxplugins", | ||
39 | IS_64 ? "ARCH=x64" : "ARCH=x32", | ||
40 | @@ -2789,6 +2798,7 @@ | ||
41 | } | ||
42 | exec { | ||
43 | workingDir("$libavDir") | ||
44 | + environment(pkgConfigEnv) | ||
45 | commandLine("make") | ||
46 | } | ||
47 | } | ||
48 | @@ -2857,6 +2867,7 @@ | ||
49 | } | ||
50 | exec { | ||
51 | workingDir("$libavDir") | ||
52 | + environment(pkgConfigEnv) | ||
53 | commandLine("make") | ||
54 | } | ||
55 | } | ||
56 | @@ -2928,6 +2939,7 @@ | ||
57 | } | ||
58 | exec { | ||
59 | workingDir("$libavDir") | ||
60 | + environment(pkgConfigEnv) | ||
61 | commandLine("make") | ||
62 | } | ||
63 | } | ||
64 | @@ -2962,6 +2974,7 @@ | ||
65 | File dir = file(libavDir) | ||
66 | if (dir.exists()) { | ||
67 | exec { | ||
68 | + environment(pkgConfigEnv) | ||
69 | commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin") | ||
70 | args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}", | ||
71 | "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", | ||
72 | @@ -2976,6 +2989,7 @@ | ||
73 | File dir = file(libavDir) | ||
74 | if (dir.exists()) { | ||
75 | exec { | ||
76 | + environment(pkgConfigEnv) | ||
77 | commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin") | ||
78 | args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}", | ||
79 | "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", | ||
80 | @@ -2990,6 +3004,7 @@ | ||
81 | File dir = file(libavDir) | ||
82 | if (dir.exists()) { | ||
83 | exec { | ||
84 | + environment(pkgConfigEnv) | ||
85 | commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin") | ||
86 | args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}", | ||
87 | "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", | ||
88 | @@ -3001,6 +3016,7 @@ | ||
89 | } else { | ||
90 | // Building fxavcodec plugin (libav plugin) | ||
91 | exec { | ||
92 | + environment(pkgConfigEnv) | ||
93 | commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin") | ||
94 | args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}", | ||
95 | "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", | ||
96 | @@ -3199,7 +3215,7 @@ | ||
97 | exec { | ||
98 | workingDir("$webkitOutputDir") | ||
99 | commandLine("perl", "$projectDir/src/main/native/Tools/Scripts/set-webkit-configuration", "--$webkitConfig") | ||
100 | - environment(["WEBKIT_OUTPUTDIR" : webkitOutputDir]) | ||
101 | + environment(["WEBKIT_OUTPUTDIR" : webkitOutputDir, "CC" : CC, "CXX" : CXX, "AR" : AR]) | ||
102 | } | ||
103 | |||
104 | exec { | ||
105 | @@ -3245,6 +3261,9 @@ | ||
106 | "JAVA_HOME" : JDK_HOME, | ||
107 | "WEBKIT_OUTPUTDIR" : webkitOutputDir, | ||
108 | "PYTHONDONTWRITEBYTECODE" : "1", | ||
109 | + "CC" : CC, | ||
110 | + "CXX" : CXX, | ||
111 | + "AR" : AR | ||
112 | ]) | ||
113 | |||
114 | def targetCpuBitDepthSwitch = "" | ||
115 | --- old/buildSrc/linux.gradle | ||
116 | +++ new/buildSrc/linux.gradle | ||
117 | @@ -54,11 +54,13 @@ | ||
118 | commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c", | ||
119 | "-ffunction-sections", "-fdata-sections", | ||
120 | IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : ["-O2", "-DNDEBUG"]].flatten() | ||
121 | +ccFlags.addAll(ext.EXTRA_CXXFLAGS.split(" ")) | ||
122 | def ccFlagsGTK3 = ccFlags | ||
123 | //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"]) | ||
124 | def linkFlags = ["-static-libgcc", "-static-libstdc++", "-shared", commonFlags, | ||
125 | "-z", "relro", | ||
126 | "-Wl,--gc-sections"].flatten() | ||
127 | +linkFlags.addAll(ext.EXTRA_LDFLAGS.split(" ")) | ||
128 | |||
129 | if (IS_DEBUG_NATIVE) { | ||
130 | linkFlags += "-g" | ||
131 | @@ -77,11 +79,17 @@ | ||
132 | def gtk3LinkFlags = [ ]; | ||
133 | LINUX.buildGTK3 = true | ||
134 | |||
135 | +def pkgConfigEnv = [ | ||
136 | + PKG_CONFIG_PATH: "$PKG_CONFIG_PATH", | ||
137 | + PKG_CONFIG_SYSROOT_DIR: "$PKG_CONFIG_SYSROOT_DIR" | ||
138 | +] | ||
139 | + | ||
140 | // Create $buildDir/linux_tools.properties file and load props from it | ||
141 | setupTools("linux_gtk2", | ||
142 | { propFile -> | ||
143 | ByteArrayOutputStream results1 = new ByteArrayOutputStream(); | ||
144 | exec { | ||
145 | + environment(pkgConfigEnv) | ||
146 | commandLine("${toolchainDir}pkg-config", "--cflags", "gtk+-2.0", "gthread-2.0", "xtst") | ||
147 | setStandardOutput(results1); | ||
148 | } | ||
149 | @@ -89,6 +97,7 @@ | ||
150 | |||
151 | ByteArrayOutputStream results3 = new ByteArrayOutputStream(); | ||
152 | exec { | ||
153 | + environment(pkgConfigEnv) | ||
154 | commandLine("${toolchainDir}pkg-config", "--libs", "gtk+-2.0", "gthread-2.0", "xtst") | ||
155 | setStandardOutput(results3); | ||
156 | } | ||
157 | @@ -110,6 +119,7 @@ | ||
158 | { propFile -> | ||
159 | ByteArrayOutputStream results2 = new ByteArrayOutputStream(); | ||
160 | exec { | ||
161 | + environment(pkgConfigEnv) | ||
162 | commandLine("${toolchainDir}pkg-config", "--cflags", "gtk+-3.0", "gthread-2.0", "xtst") | ||
163 | setStandardOutput(results2); | ||
164 | ignoreExitValue(true) | ||
165 | @@ -118,6 +128,7 @@ | ||
166 | |||
167 | ByteArrayOutputStream results4 = new ByteArrayOutputStream(); | ||
168 | exec { | ||
169 | + environment(pkgConfigEnv) | ||
170 | commandLine("${toolchainDir}pkg-config", "--libs", "gtk+-3.0", "gthread-2.0", "xtst") | ||
171 | setStandardOutput(results4); | ||
172 | ignoreExitValue(true) | ||
173 | @@ -144,6 +155,7 @@ | ||
174 | { propFile -> | ||
175 | ByteArrayOutputStream results = new ByteArrayOutputStream(); | ||
176 | exec { | ||
177 | + environment(pkgConfigEnv) | ||
178 | commandLine "${toolchainDir}pkg-config", "--cflags", "pangoft2" | ||
179 | standardOutput = results | ||
180 | } | ||
181 | @@ -151,6 +163,7 @@ | ||
182 | |||
183 | results = new ByteArrayOutputStream(); | ||
184 | exec { | ||
185 | + environment(pkgConfigEnv) | ||
186 | commandLine "${toolchainDir}pkg-config", "--libs", "pangoft2" | ||
187 | standardOutput = results | ||
188 | } | ||
189 | @@ -175,6 +188,7 @@ | ||
190 | { propFile -> | ||
191 | ByteArrayOutputStream results = new ByteArrayOutputStream(); | ||
192 | exec { | ||
193 | + environment(pkgConfigEnv) | ||
194 | commandLine "${toolchainDir}pkg-config", "--cflags", "freetype2" | ||
195 | standardOutput = results | ||
196 | } | ||
197 | @@ -182,6 +196,7 @@ | ||
198 | |||
199 | results = new ByteArrayOutputStream(); | ||
200 | exec { | ||
201 | + environment(pkgConfigEnv) | ||
202 | commandLine "${toolchainDir}pkg-config", "--libs", "freetype2" | ||
203 | standardOutput = results | ||
204 | } | ||
205 | @@ -199,8 +214,8 @@ | ||
206 | } | ||
207 | ) | ||
208 | |||
209 | -def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "${toolchainDir}gcc"; | ||
210 | -def linker = IS_COMPILE_PARFAIT ? "parfait-g++" : "${toolchainDir}g++"; | ||
211 | +def compiler = ext.CC; | ||
212 | +def linker = ext.CXX; | ||
213 | |||
214 | LINUX.glass = [:] | ||
215 | LINUX.glass.variants = ["glass", "glassgtk2"] | ||
216 | @@ -316,7 +331,7 @@ | ||
217 | LINUX.media = [:] | ||
218 | LINUX.media.compiler = compiler | ||
219 | LINUX.media.linker = linker | ||
220 | -LINUX.media.ar = "${toolchainDir}ar" | ||
221 | +LINUX.media.ar = ext.AR | ||
222 | |||
223 | LINUX.webkit = [:] | ||
224 | LINUX.webkit.compiler = compiler | ||