forked from vpelss/bridgecommand_AppImage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstructions.txt
More file actions
190 lines (134 loc) · 5.34 KB
/
instructions.txt
File metadata and controls
190 lines (134 loc) · 5.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
How to create an AppImage for easy deployment!
Using https://github.com/bridgecommand/bc for demonstration.
See the following for appimage information
https://appimage.org/
https://docs.appimage.org/
# 1. Making bridgecommand:
sudo apt install git make cmake gcc g++ git
sudo apt install cmake mesa-common-dev libxxf86vm-dev freeglut3-dev libxext-dev libxcursor-dev portaudio19-dev libsndfile1-dev libopenxr-dev
#fetch sources
git clone --depth 1 https://github.com/bridgecommand/bc.git
# the flags below are the bare minimum that is needed, the app might define additional variables that might have to be set
cmake -Bbc/bin -Sbc/src -DCMAKE_INSTALL_PREFIX=/usr
# build the application using all CPU cores
make -C bc/bin -j$(nproc)
# 2. Create AppDir filesystem
mkdir -p AppDir/usr/bin
cp -r bc/bin AppDir/usr
#can clean up AppDir/usr/bin first if we like
rm -r AppDir/usr/bin/BridgeCommand.app
rm -r AppDir/usr/bin/CMakeFiles
rm -r AppDir/usr/bin/controller
rm -r AppDir/usr/bin/createDeb
rm -r AppDir/usr/bin/editor
rm -r AppDir/usr/bin/iniEditor
rm -r AppDir/usr/bin/launcher
rm -r AppDir/usr/bin/libs
rm -r AppDir/usr/bin/multiplayerHub
rm -r AppDir/usr/bin/repeater
rm -r AppDir/usr/bin/*.exe
rm -r AppDir/usr/bin/*.dll
#get our preconfiged files
git clone --depth 1 https://github.com/vpelss/bridgecommand_AppImage.git
#place AppRun script in AppDir
cp bridgecommand_AppImage/AppRun AppDir
#place bridgecommand.desktop in AppDir
cp bridgecommand_AppImage/bridgecommand.desktop AppDir
#place bridgecommand.png in AppDir
cp bridgecommand_AppImage/bridgecommand.png AppDir
#set permissions
chmod +x AppDir/AppRun
chmod +x AppDir/usr/bin/bridgecommand*
chmod +x AppDir/bridgecommand.desktop
# 3. Get linuxdeploy and create our AppImage file
# get linuxdeploy's AppImage if you don’t have it
# https://github.com/linuxdeploy/linuxdeploy
# https://github.com/linuxdeploy/linuxdeploy/releases/
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
#if building for ARM / aarch64 (pi 4) you will need to build it and package it on a PI 4 using linuxdeploy-aarch64.AppImage
#for PI 4 wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-aarch64.AppImage
#chmod +x linuxdeploy-aarch64.AppImage
#run linuxdeploy and fix up generate an AppDir (add lib) and build AppImage
ARCH=x86_64 ./linuxdeploy-x86_64.AppImage -v 0 --appdir AppDir --output appimage
chmod 777 Bridge_Command-x86_64.AppImage
#run it
./Bridge_Command-x86_64.AppImage
------------------
How to make AppDir/AppRun :
#!/bin/bash
SELF=$(readlink -f "$0") #will set SELF to our AppRun path with AppRun appended
echo ${SELF}
HERE=${SELF%/*} #will set HERE to path without AppRun
echo ${HERE}
EXEC="${HERE}/usr/bin" #set path to bin folder. eg: /tmp/.mount_Bridge6DxuEO/usr/bin
cd ${EXEC}
echo ${EXEC}
ls -l
exec ./bridgecommand #run our app
------------------------
Mount AppImage for examination:
my.AppImage --appimage-mount
/tmp/mount_myXXXX
# now, use another terminal or file manager to inspect the contents in the directory printed by --appimage-mount
OR
> mkdir mountpoint
> my.AppImage --appimage-offset
> 123456
> sudo mount my.AppImage mountpoint/ -o offset=123456
# you can now inspect the contents
> sudo umount mountpoint/
Analog to mounting AppImages, there is a simple command line switch to extract the contents of type 2 AppImages without external tools. Just call the AppImage with the parameter --appimage-extract. This will cause the runtime to create a new directory called squashfs-root, containing the contents of the AppImage’s AppDir.
------------------------
Setting up git:
generate :
ssh-keygen -t ed25519 -C "vpelss@gmail.com"
I renamed files ‘github’ and ‘github.pub’
I run every time as I did not set up linux environment:
git config --global user.email "vpelss@gmail.com"
git config --global user.name "Vince Pelss"
git remote add origin git@github.com:vpelss/bridgecommand_AppImage.git
git remote set-url origin git@github.com:vpelss/bridgecommand_AppImage.git
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/github
I took github.pub and added it to github ‘deploy keys’
test access:
ssh -T git@github.com
git remote -v
then we can:
git clone --depth 1 https://github.com/vpelss/bridgecommand_Appimage.git #don’t need old stuff
change files:
git add -f *
git commit -m ‘new’ -a
git push -f -v --mirror
---------------------
NEEDS WORK
If you want to generate an AppImage manually, you can:
runtime:
#!/bin/sh
clear
HOMEPATH="`pwd`"
EXTRACTFILE=`mktemp`
echo ${EXTRACTFILE}
DIRPATH=`mktemp -u`
echo ${DIRPATH}
tail -n +${NUMBEROFLINES} "$0" > ${EXTRACTFILE} #${NUMBEROFLINES} replaced from buildit.sh
unsquashfs -d ${DIRPATH} ${EXTRACTFILE}
BINPATH="${DIRPATH}/usr/bin"
cd ${BINPATH}
echo ${BINPATH}
`${BINPATH}/bridgecommand` #run our app
rm ${EXTRACTFILE}
rm -r ${DIRPATH}
exit 1
mksquashfs Your.AppDir Your.squashfs -root-owned -noappend
cat runtime > Your.AppImage
cat Your.squashfs >> Your.AppImage
chmod a+x Your.AppImage
https://stackoverflow.com/questions/10491704/embed-a-executable-binary-in-a-shell-script
https://articles.singee.me/embed-bin-in-shell-script?locale=en
https://www.geeksforgeeks.org/piping-in-unix-or-linux/
It works:
https://makeself.io/
git clone https://github.com/megastep/makeself.git
eg: makeself/makeself.sh --threads=0 AppDir myimage.sh label ./AppRun