3 #**********************************************************************
4 # Copyright (C) 2022 - The Geeqie Team
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along
19 # with this program; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #**********************************************************************
23 ## @brief Compile linuxdeploy for use on arm
25 ## There is no AppImage for linuxdeploy on arm. It must be compiled
28 ## This is just a hack until AppImages are available on github.
34 if [ "$arch" != "aarch64" ]
39 sudo apt install libfuse2
40 sudo apt install libgirepository1.0-dev
42 rm -rf /tmp/linuxdeploy-*
50 cd "$HOME"/bin || exit
52 if [ ! -f appimagetool-aarch64.AppImage ]
54 wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage
55 chmod +x appimagetool-aarch64.AppImage
58 if [ ! -f linuxdeploy-plugin.sh ]
60 wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
61 chmod +x linuxdeploy-plugin-gtk.sh
64 if [ ! -d linuxdeploy-download ]
66 git clone --recursive https://github.com/linuxdeploy/linuxdeploy.git
67 mv linuxdeploy linuxdeploy-download
70 cd linuxdeploy-download || exit
72 # Use arm architecture
73 sed -i 's/"x86_64"/"aarch64"/g' ./ci/build.sh
74 sed -i 's/"x86_64"/"aarch64"/g' ./ci/build-static-binutils.sh
75 sed -i 's/"x86_64"/"aarch64"/g' ./ci/build-static-patchelf.sh
78 sed -i 's/TEMP_BASE=\/dev\/shm/TEMP_BASE=\/tmp/' ./ci/build.sh
80 # Do not erase working directory
81 sed -i 's/trap cleanup EXIT//' ./ci/build.sh
83 # Fix possible error in current (2022-12-13) version
84 sed -i 's/\/\/ system headers/#include <array>/' ./src/subprocess/subprocess.cpp
85 sed -i 's/\/\/ system headers/#include <array>/' ./src/plugin/plugin_process_handler.cpp
88 sed -i 's/wget/\#/g' ./ci/build.sh
91 sed -i 's/set\ \-e/\#/' .ci/build.sh
93 cp src/core/copyright/copyright.h src/core
97 ARCH=aarch64 bash linuxdeploy-download/ci/build.sh
99 find /tmp/linuxdeploy-build* -type f -name linuxdeploy -exec cp {} "$HOME"/bin/ \;
100 find /tmp/linuxdeploy-build* -type f -name patchelf -exec cp {} "$HOME"/bin \;
102 if [ ! -d linuxdeploy-plugin-appimage ]
104 git clone --recursive https://github.com/linuxdeploy/linuxdeploy-plugin-appimage.git
107 cd linuxdeploy-plugin-appimage || exit
110 sed -i 's/TEMP_BASE=\/dev\/shm/TEMP_BASE=\/tmp/' ./ci/build-appimage.sh
112 # Do not erase working directory
113 sed -i 's/trap cleanup EXIT//' ./ci/build-appimage.sh
115 # Use arm architecture
116 sed -i 's/"x86_64"/"aarch64"/g' ./ci/build-appimage.sh
119 sed -i 's/wget/\#/g' ./ci/build-appimage.sh
122 sed -i 's/set\ \-e/\#/' ./ci/build-appimage.sh
126 ARCH=aarch64 bash linuxdeploy-plugin-appimage/ci/build-appimage.sh