| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | #!/usr/bin/bash
 | 
					
						
							|  |  |  | #  SPDX-License-Identifier: MIT | 
					
						
							|  |  |  | # | 
					
						
							| 
									
										
										
										
											2024-04-17 15:35:49 +00:00
										 |  |  | #  ES-DE Frontend | 
					
						
							| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | #  create_AppImage_SteamDeck.sh | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #  Runs the complete process of building a Linux AppImage specific to the Valve Steam Deck. | 
					
						
							| 
									
										
										
										
											2022-09-27 16:01:01 +00:00
										 |  |  | #  The SDL library is also built and included in the AppImage. | 
					
						
							| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2023-01-16 16:40:44 +00:00
										 |  |  | #  This script has only been tested on Ubuntu 20.04 LTS and 22.04 LTS. | 
					
						
							| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | # | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-27 16:01:01 +00:00
										 |  |  | # How many CPU threads to use for the compilation. | 
					
						
							|  |  |  | JOBS=4 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-06 10:52:57 +00:00
										 |  |  | SDL_RELEASE_TAG=release-2.30.7 | 
					
						
							|  |  |  | SDL_SHARED_LIBRARY=libSDL2-2.0.so.0.3000.7 | 
					
						
							| 
									
										
										
										
											2022-09-27 16:01:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | echo "Building Steam Deck AppImage..." | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if [ ! -f .clang-format ]; then | 
					
						
							|  |  |  |   echo "You need to run this script from the root of the repository." | 
					
						
							|  |  |  |   exit | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if [ ! -f appimagetool-x86_64.AppImage ]; then | 
					
						
							|  |  |  |   echo -e "Can't find appimagetool-x86_64.AppImage, downloading the latest version...\n" | 
					
						
							|  |  |  |   wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | chmod a+x appimagetool-x86_64.AppImage | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if [ ! -f linuxdeploy-x86_64.AppImage ]; then | 
					
						
							|  |  |  |   echo -e "Can't find linuxdeploy-x86_64.AppImage, downloading the latest version...\n" | 
					
						
							|  |  |  |   wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | chmod a+x linuxdeploy-x86_64.AppImage | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-27 16:01:01 +00:00
										 |  |  | if [ ! -f external/SDL/build/${SDL_SHARED_LIBRARY} ]; then | 
					
						
							| 
									
										
										
										
											2023-01-31 17:44:45 +00:00
										 |  |  |   echo | 
					
						
							|  |  |  |   echo "Building the SDL library..." | 
					
						
							|  |  |  |   cd external | 
					
						
							|  |  |  |   rm -rf SDL | 
					
						
							|  |  |  |   git clone https://github.com/libsdl-org/SDL.git | 
					
						
							|  |  |  |   cd SDL | 
					
						
							|  |  |  |   git checkout $SDL_RELEASE_TAG | 
					
						
							| 
									
										
										
										
											2023-01-26 19:36:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-31 17:44:45 +00:00
										 |  |  |   mkdir build | 
					
						
							|  |  |  |   cd build | 
					
						
							|  |  |  |   cmake -DCMAKE_BUILD_TYPE=Release -S .. -B . | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if [ $(grep PKG_PIPEWIRE_VERSION:INTERNAL= CMakeCache.txt) = "PKG_PIPEWIRE_VERSION:INTERNAL=" ]; then | 
					
						
							| 
									
										
										
										
											2022-09-27 16:01:01 +00:00
										 |  |  |     echo | 
					
						
							| 
									
										
										
										
											2023-01-31 17:44:45 +00:00
										 |  |  |     echo -e "The SDL library is not configured with PipeWire support, aborting." | 
					
						
							|  |  |  |     exit | 
					
						
							|  |  |  |   fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   make -j${JOBS} | 
					
						
							|  |  |  |   cd ../../.. | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   echo | 
					
						
							|  |  |  |   echo -e "The SDL library has already been built, skipping this step\n" | 
					
						
							| 
									
										
										
										
											2022-09-27 16:01:01 +00:00
										 |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | rm -rf ./AppDir | 
					
						
							|  |  |  | mkdir AppDir | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | rm -f CMakeCache.txt | 
					
						
							| 
									
										
										
										
											2022-08-20 09:28:20 +00:00
										 |  |  | cmake -DAPPIMAGE_BUILD=on -DSTEAM_DECK=on . | 
					
						
							| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | make clean | 
					
						
							| 
									
										
										
										
											2022-09-27 16:01:01 +00:00
										 |  |  | make -j${JOBS} | 
					
						
							| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | make install DESTDIR=AppDir | 
					
						
							|  |  |  | cd AppDir | 
					
						
							| 
									
										
										
										
											2023-12-16 11:30:13 +00:00
										 |  |  | ln -s usr/bin/es-de AppRun | 
					
						
							|  |  |  | ln -s usr/share/pixmaps/es-de.svg . | 
					
						
							|  |  |  | ln -s usr/share/applications/org.es_de.frontend.desktop . | 
					
						
							|  |  |  | ln -s es-de.svg .DirIcon | 
					
						
							| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | cd usr/bin | 
					
						
							| 
									
										
										
										
											2023-12-16 11:30:13 +00:00
										 |  |  | ln -s ../share/es-de/resources . | 
					
						
							|  |  |  | ln -s ../share/es-de/themes . | 
					
						
							| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | cd ../../.. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-05 17:10:00 +00:00
										 |  |  | ./linuxdeploy-x86_64.AppImage -l /lib/x86_64-linux-gnu/libOpenGL.so.0 -l /lib/x86_64-linux-gnu/libGLdispatch.so.0 -l /lib/x86_64-linux-gnu/libgio-2.0.so.0 --appdir AppDir | 
					
						
							| 
									
										
										
										
											2022-09-27 16:01:01 +00:00
										 |  |  | cp external/SDL/build/${SDL_SHARED_LIBRARY} AppDir/usr/lib/libSDL2-2.0.so.0 | 
					
						
							| 
									
										
										
										
											2022-04-03 11:58:37 +00:00
										 |  |  | ./appimagetool-x86_64.AppImage AppDir | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-16 11:30:13 +00:00
										 |  |  | mv ES-DE-x86_64.AppImage ES-DE_x64_SteamDeck.AppImage | 
					
						
							|  |  |  | echo -e "\nCreated AppImage ES-DE_x64_SteamDeck.AppImage" |