| 
									
										
										
										
											2019-01-29 22:58:21 +01:00
										 |  |  | # Build the image using the --build-arg option, e.g.: | 
					
						
							|  |  |  | # docker build -t boret/myimage:0.1 --build-arg=mxe_sha=123ABC456 . | 
					
						
							| 
									
										
										
										
											2019-01-25 10:45:54 +13:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-16 08:34:10 +13:00
										 |  |  | # We need to stick with 22.04 for now because the latest MXE version | 
					
						
							|  |  |  | # (db430dc676e6f5d77604af150b8acc1403af4fd7) does not build a working | 
					
						
							|  |  |  | # version of QtWebKit, which breaks printing in Subsurface. | 
					
						
							|  |  |  | FROM ubuntu:22.04 as base | 
					
						
							| 
									
										
										
										
											2020-10-28 14:19:45 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-21 01:07:33 +13:00
										 |  |  | # update and set up the packages we need for the build | 
					
						
							|  |  |  | RUN apt-get update  &&  \ | 
					
						
							| 
									
										
										
										
											2024-05-07 19:27:42 +12:00
										 |  |  |     apt-get dist-upgrade -y && \ | 
					
						
							| 
									
										
										
										
											2024-01-21 01:07:33 +13:00
										 |  |  |     apt-get install -y \ | 
					
						
							| 
									
										
										
										
											2019-01-25 10:45:54 +13:00
										 |  |  |     autoconf \ | 
					
						
							|  |  |  |     automake \ | 
					
						
							|  |  |  |     autopoint \ | 
					
						
							|  |  |  |     bash \ | 
					
						
							|  |  |  |     binutils \ | 
					
						
							|  |  |  |     bzip2 \ | 
					
						
							| 
									
										
										
										
											2020-05-30 12:21:22 +01:00
										 |  |  |     ca-certificates \ | 
					
						
							| 
									
										
										
										
											2019-01-25 10:45:54 +13:00
										 |  |  |     g++ \ | 
					
						
							|  |  |  |     g++-multilib \ | 
					
						
							|  |  |  |     gettext \ | 
					
						
							|  |  |  |     git \ | 
					
						
							|  |  |  |     intltool \ | 
					
						
							|  |  |  |     libltdl-dev \ | 
					
						
							|  |  |  |     libssl-dev \ | 
					
						
							| 
									
										
										
										
											2020-05-30 12:21:22 +01:00
										 |  |  |     libtool \ | 
					
						
							| 
									
										
										
										
											2019-01-25 10:45:54 +13:00
										 |  |  |     libtool-bin \ | 
					
						
							|  |  |  |     make \ | 
					
						
							|  |  |  |     openssl \ | 
					
						
							|  |  |  |     p7zip-full \ | 
					
						
							|  |  |  |     patch \ | 
					
						
							|  |  |  |     perl \ | 
					
						
							|  |  |  |     pkg-config \ | 
					
						
							|  |  |  |     sed \ | 
					
						
							|  |  |  |     unzip \ | 
					
						
							|  |  |  |     wget \ | 
					
						
							| 
									
										
										
										
											2024-01-21 01:07:33 +13:00
										 |  |  |     lzip && \ | 
					
						
							|  |  |  |     apt-get clean | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | FROM base as build | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # set up the packages we need additionally for this cross build | 
					
						
							|  |  |  | RUN apt-get install -y \ | 
					
						
							|  |  |  |     bison \ | 
					
						
							|  |  |  |     flex \ | 
					
						
							|  |  |  |     gperf \ | 
					
						
							|  |  |  |     libc6-dev-i386 \ | 
					
						
							|  |  |  |     libgdk-pixbuf2.0-dev \ | 
					
						
							|  |  |  |     libxml-parser-perl \ | 
					
						
							|  |  |  |     python3 \ | 
					
						
							|  |  |  |     python3-mako \ | 
					
						
							| 
									
										
										
										
											2024-10-22 12:07:49 +13:00
										 |  |  |     python3-setuptools \ | 
					
						
							| 
									
										
										
										
											2024-01-21 01:07:33 +13:00
										 |  |  |     python-is-python3 \ | 
					
						
							|  |  |  |     ruby \ | 
					
						
							| 
									
										
										
										
											2019-01-25 10:45:54 +13:00
										 |  |  |     xz-utils \ | 
					
						
							| 
									
										
										
										
											2019-05-17 15:55:17 -07:00
										 |  |  |     scons | 
					
						
							| 
									
										
										
										
											2019-11-24 13:35:09 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-16 08:34:10 +13:00
										 |  |  | # Default to 'master' if no build argument is passed in | 
					
						
							|  |  |  | ARG mxe_sha=master | 
					
						
							|  |  |  | # Very often master is broken, so we pass in a known good SHA | 
					
						
							| 
									
										
										
										
											2024-01-21 01:07:33 +13:00
										 |  |  | ENV _ver=${mxe_sha} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WORKDIR /win | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-28 14:19:45 -07:00
										 |  |  | # checkout MXE at the right version | 
					
						
							| 
									
										
										
										
											2024-01-21 01:07:33 +13:00
										 |  |  | RUN git clone https://github.com/mxe/mxe && \ | 
					
						
							|  |  |  |     cd mxe && \ | 
					
						
							|  |  |  |     git checkout ${_ver} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WORKDIR /win/mxe | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Move the settings into place to build everything that we need | 
					
						
							|  |  |  | ADD settings.mk . | 
					
						
							| 
									
										
										
										
											2020-10-28 14:19:45 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-30 12:21:22 +01:00
										 |  |  | # Patch the qtconnectivity build to explicilty enable native-win32-bluetooth and ensure another | 
					
						
							|  |  |  | # backend is not picked | 
					
						
							| 
									
										
										
										
											2024-01-21 01:07:33 +13:00
										 |  |  | ADD qtconnectivity-1.patch src/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-28 14:19:45 -07:00
										 |  |  | # separate download from build so that we can redo the build | 
					
						
							| 
									
										
										
										
											2024-01-21 01:07:33 +13:00
										 |  |  | RUN make -j download 2>&1 | tee mxe-build.log | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | RUN make -j 2>&1 | tee -a mxe-build.log | 
					
						
							| 
									
										
										
										
											2020-10-28 14:19:45 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | # for some reason smtk2ssrf needs a static build of mdbtools | 
					
						
							| 
									
										
										
										
											2024-01-21 01:07:33 +13:00
										 |  |  | RUN make MXE_TARGETS=x86_64-w64-mingw32.static glib mdbtools -j 2>&1 | tee -a mxe-build.log | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | RUN rm -rf pkg log docs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | FROM base as final | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WORKDIR /win | 
					
						
							| 
									
										
										
										
											2020-10-28 14:19:45 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-21 01:07:33 +13:00
										 |  |  | COPY --from=build /win/mxe mxe |