blob: c7eff95944b51d507693f66a84adb2f61a9ec57c (
plain)
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
183
184
185
186
187
188
189
190
191
|
# Maintainer: Eddie.website <maintainer@eddie.website>
# Based on work by Uncle Hunto <unclehunto äτ ÝãΗ00 Ð0τ ÇÖΜ> and Beini <bane aτ iki dot fi>
pkgname=eddie-cli-git
pkgver=2.24.5
pkgrel=1
pkgdesc='Eddie - VPN tunnel - CLI'
arch=('x86_64' 'aarch64' 'armv7l')
url=https://eddie.website
license=(GPLv3)
depends=(curl openvpn sudo)
optdepends=('stunnel: VPN over SSL' 'openssh: VPN over SSH')
makedepends=(git cmake patchelf dotnet-sdk)
provides=('eddie-cli')
conflicts=('airvpn' 'airvpn-beta-bin' 'airvpn-git')
install=eddie-cli.install
source=('git+https://github.com/AirVPN/Eddie.git')
sha1sums=('SKIP')
options=('!strip') # Incompatible with net8
ARCH=$CARCH
RID=linux-$CARCH
if [ "$RID" = "linux-x86_64" ]; then
ARCH=x64
RID=linux-x64
elif [ "$RID" = "linux-aarch64" ]; then
RID=linux-arm64
elif [ "$RID" = "linux-armv7l" ]; then
RID=linux-arm
fi
build() {
CONFIG=Release
cd "Eddie"
# CLI
if true; then
chmod +x src/App.CLI.Linux/postbuild.sh
chmod +x src/Lib.Platform.Linux.Native/build.sh
cd "src/App.CLI.Linux/"
dotnet publish App.CLI.Linux.net8.csproj --configuration ${CONFIG} --runtime ${RID} --self-contained true -p:PublishTrimmed=true -p:EnableCompressionInSingleFile=true
cd "../../"
fi
# UI
if [ "cli" = "ui" ]; then
FRAMEWORK="net4" # Forced for now
if [ $FRAMEWORK = "net8" ]; then
chmod +x src/App.UI.Linux/build.sh
"src/App.UI.Linux/build.sh" Release
elif [ $FRAMEWORK = "net4" ]; then
# Note: x64 in path hardcoded, correct, net4 build are CIL
export TERM=xterm # Fix Mono bug "Magic number is wrong".
#TARGETFRAMEWORK="v4.8"; # Removed for https://aur.archlinux.org/packages/eddie-ui#comment-920114
RULESETPATH="src/ruleset/norules.ruleset"
SOLUTIONPATH="src/App.Forms.Linux//App.Forms.Linux.sln"
# clean temporary files from net8 compilation above, otherwise throw 'Your project does not reference ".NETFramework,Version=v4.8"'
rm -rf "src/Lib.Core/bin"
rm -rf "src/Lib.Core/obj"
rm -rf "src/Lib.Platform.Linux/bin"
rm -rf "src/Lib.Platform.Linux/obj"
# msbuild is available when monodevelop is installed (reccomended)
# xbuild is available when mono-complete is installed (deprecated)
#msbuild /verbosity:minimal /p:Configuration=${CONFIG} /p:Platform=x64 /p:TargetFrameworkVersion=${TARGETFRAMEWORK} /t:Rebuild "${SOLUTIONPATH}" /p:DefineConstants="EDDIEMONO4LINUX"
msbuild /verbosity:minimal /p:Configuration=${CONFIG} /p:Platform=x64 /t:Rebuild "${SOLUTIONPATH}" /p:DefineConstants="EDDIEMONO4LINUX"
# msbuild/Mono under Linux don't honor the postbuild event, called manually
"src/App.Forms.Linux/postbuild.sh" "src/App.Forms.Linux/bin/x64/${CONFIG}/" ${ARCH} ${CONFIG}
# mkbundle
if [ $ARCH = "x64" ]; then
MKBUNDLECROSSTARGET="mono-6.8.0-debian-10-x64"
elif [ $ARCH = "armv7l" ]; then
MKBUNDLECROSSTARGET="mono-6.0.0-raspbian-9-arm"
elif [ $ARCH = "aarch64" ]; then
MKBUNDLECROSSTARGET="mono-6.6.0-debian-10-arm64"
else
MKBUNDLECROSSTARGET="mono-6.8.0-debian-10-${ARCH}"
fi
# Issue here, check with 'mkbundle --list-targets'
#mkdir -p /home/pi/.mono/targets/${MKBUNDLECROSSTARGET}/lib/mono # Not sure if need
if [[ ! -d ${HOME}/.mono/targets/${MKBUNDLECROSSTARGET} ]]; then
echo Download mkbundle target. If break here, check with 'mkbundle --list-targets' and fix build.sh MKBUNDLECROSSTARGET
mkbundle --fetch-target ${MKBUNDLECROSSTARGET}
fi
# Update config
cp ${HOME}/.mono/targets/${MKBUNDLECROSSTARGET}/etc/mono/config src/App.Forms.Linux/bin/x64/Release/mkbundle.config
sed -i 's/\$mono_libdir\///g' src/App.Forms.Linux/bin/x64/Release/mkbundle.config
cd src/App.Forms.Linux/bin/x64/Release/
mkbundle App.Forms.Linux.exe -o eddie-ui --cross ${MKBUNDLECROSSTARGET} --i18n all --config mkbundle.config --library ../../../../../repository/linux_portable/mkbundle/${ARCH}/libMonoPosixHelper.so --library ../../../../../repository/linux_portable/mkbundle/${ARCH}/libgdiplus.so.0 --library /usr/lib/libmono-native.so
cd ../../../../..
fi
fi
# Generate changelog
curl "https://eddie.website/changelog/?software=client&format=debian&hidden=yes" -o "changelog"
gzip -n -9 -f "changelog"
if [ "cli" = "cli" ]; then
# Generate man
"src/App.CLI.Linux/bin/Release/net8.0/${RID}/publish/eddie-cli" --path.resources="../../../../../../resources" --help --help.format=man >"eddie-cli.8"
gzip -n -9 -f "eddie-cli.8"
fi
}
package() {
cd "Eddie"
install -Dm755 "repository/linux_arch/bundle/eddie-cli/usr/bin/eddie-cli" "$pkgdir/usr/bin/eddie-cli"
install -Dm644 "resources/eddie-vpn.txt" "$pkgdir/usr/share/eddie-cli/eddie-vpn.txt"
install -Dm644 "resources/manifest.json" "$pkgdir/usr/share/eddie-cli/manifest.json"
install -Dm644 "resources/libraries.txt" "$pkgdir/usr/share/eddie-cli/libraries.txt"
install -Dm644 "resources/gpl3.txt" "$pkgdir/usr/share/eddie-cli/gpl3.txt"
install -Dm644 "resources/cacert.pem" "$pkgdir/usr/share/eddie-cli/cacert.pem"
install -Dm644 "resources/iso-3166.json" "$pkgdir/usr/share/eddie-cli/iso-3166.json"
install -Dm644 "resources/lang/inv.json" "$pkgdir/usr/share/eddie-cli/lang/inv.json"
install -Dm644 "resources/icons/appindicator.png" "$pkgdir/usr/share/eddie-cli/icons/appindicator.png"
install -Dm644 "resources/icons/appindicator-gray.png" "$pkgdir/usr/share/eddie-cli/icons/appindicator-gray.png"
install -Dm644 "resources/icons/notifyicon.ico" "$pkgdir/usr/share/eddie-cli/icons/notifyicon.ico"
install -Dm644 "resources/icons/notifyicon-gray.ico" "$pkgdir/usr/share/eddie-cli/icons/notifyicon-gray.ico"
install -Dm644 "resources/icons/icon.png" "$pkgdir/usr/share/eddie-cli/icons/icon.png"
install -Dm644 "resources/icons/icon-gray.png" "$pkgdir/usr/share/eddie-cli/icons/icon-gray.png"
install -Dm644 "resources/providers/OpenVPN.json" "$pkgdir/usr/share/eddie-cli/providers/OpenVPN.json"
install -Dm644 "resources/providers/WireGuard.json" "$pkgdir/usr/share/eddie-cli/providers/WireGuard.json"
install -Dm644 "resources/providers/AirVPN.json" "$pkgdir/usr/share/eddie-cli/providers/AirVPN.json"
install -Dm644 "repository/linux_arch/bundle/eddie-cli/usr/share/doc/eddie-cli/copyright" "$pkgdir/usr/share/doc/eddie-cli/copyright"
install -Dm644 "repository/linux_arch/bundle/eddie-cli/usr/share/polkit-1/actions/org.airvpn.eddie.cli.elevated.policy" "$pkgdir/usr/share/polkit-1/actions/org.airvpn.eddie.cli.elevated.policy"
install -Dm644 "changelog.gz" "$pkgdir/usr/share/doc/eddie-cli/changelog.gz"
install -Dm755 "src/App.CLI.Linux/bin/Release/net8.0/${RID}/libLib.Platform.Linux.Native.so" "$pkgdir/usr/lib/eddie-cli/libLib.Platform.Linux.Native.so"
install -Dm755 "src/App.CLI.Linux/bin/Release/net8.0/${RID}/eddie-cli-elevated" "$pkgdir/usr/lib/eddie-cli/eddie-cli-elevated"
install -Dm755 "src/App.CLI.Linux/bin/Release/net8.0/${RID}/eddie-cli-elevated-service" "$pkgdir/usr/lib/eddie-cli/eddie-cli-elevated-service"
install -Dm755 "src/App.CLI.Linux/bin/Release/net8.0/${RID}/publish/eddie-cli" "$pkgdir/usr/lib/eddie-cli/eddie-cli"
if [ "cli" = "cli" ]; then
install -Dm644 "eddie-cli.8.gz" "$pkgdir/usr/share/man/man8/eddie-cli.8.gz"
elif [ "cli" = "ui" ]; then
FRAMEWORK="net4" # Forced for now
if [ $FRAMEWORK = "net8" ]; then
echo TODO
elif [ $FRAMEWORK = "net4" ]; then
install -Dm755 "src/App.Forms.Linux.Tray/bin/eddie-tray" "$pkgdir/usr/lib/eddie-cli/eddie-tray"
install -Dm755 "src/App.Forms.Linux/bin/x64/Release/eddie-ui" "$pkgdir/usr/lib/eddie-cli/eddie-ui"
fi
install -Dm644 "repository/linux_arch/bundle/eddie-cli/usr/share/pixmaps/eddie-cli.png" "$pkgdir/usr/share/pixmaps/eddie-cli.png"
fi
# Unknown if this is need today, 2023-12-12
if [ "cli" = "ui" ]; then
## Fix .desktop file for KDE
_desktop_session=$(printf "%s" "$DESKTOP_SESSION" | awk -F "/" '{print $NF}')
if [ "$_desktop_session" = "plasma" ]; then
msg2 "Installing desktop file for KDE..."
desktop-file-install -m 644 --set-comment="OpenVPN UI" \
--dir="$pkgdir/usr/share/applications/" \
--set-icon="/usr/share/pixmaps/eddie-ui.png" \
"repository/linux_arch/bundle/eddie-ui/usr/share/applications/eddie-ui.desktop"
else
msg2 "Installing desktop file..."
desktop-file-install -m 644 --set-comment="OpenVPN UI" \
--dir="$pkgdir/usr/share/applications/" \
"repository/linux_arch/bundle/eddie-ui/usr/share/applications/eddie-ui.desktop"
fi
fi
}
|