diff options
author | Eddie.website | 2024-03-06 05:57:06 -0500 |
---|---|---|
committer | Eddie.website | 2024-03-06 05:57:06 -0500 |
commit | c1c687fc2610ba52b78459356f0a8a6f2c3f0fce (patch) | |
tree | 28a5e53b3230ff63e23aeb3b04af17092ff697ab /PKGBUILD | |
parent | e069af8df07d5812dfc950ff2bf6a015694d0d24 (diff) | |
download | aur-eddie-cli-git.tar.gz |
2.24.2
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 211 |
1 files changed, 138 insertions, 73 deletions
@@ -1,109 +1,174 @@ # Maintainer: Eddie.website <maintainer@eddie.website> # Based on work by Uncle Hunto <unclehunto äτ ÝãΗ00 Ð0τ ÇÖΜ> and Beini <bane aτ iki dot fi> -# Current issues: -# - msbuild vs xbuild -# - target framework not v4.8 pkgname=eddie-cli-git -pkgver=2.23.2 +pkgver=2.24.2 pkgrel=1 -pkgdesc='Eddie - VPN tunnel - CLI - beta' -arch=('i686' 'x86_64') +pkgdesc='Eddie - VPN tunnel - CLI' +arch=('x86_64' 'aarch64' 'armv7l') url=https://eddie.website license=(GPLv3) -depends=(mono curl openvpn sudo) +depends=(curl openvpn sudo) optdepends=('stunnel: VPN over SSL' 'openssh: VPN over SSH') -makedepends=('cmake') +makedepends=(cmake 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 net7 -case "$CARCH" in - i686) _pkgarch="x86" - ;; - x86_64) _pkgarch="x64" - ;; -esac -build() { - export TERM=xterm # Fix Mono bug "Magic number is wrong". - # Compile C# sources - # Forced target framework, otherwise throw - # warning : TargetFrameworkVersion 'v4.8' not supported by this toolset (ToolsVersion: 14.0). - # even on recent Manjaro (updated 2022-04-19) +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 - # throw - # xbuild tool is deprecated and will be removed in future updates, use msbuild instead - # but never understand right dependencies that works on every Arch distro cd "Eddie" - if [ "cli" = "cli" ]; then - xbuild /verbosity:minimal /p:TargetFrameworkVersion="v4.5" /p:Configuration="Release" /p:Platform="$_pkgarch" src/eddie.linux.cli.sln - elif [ "cli" = "ui" ]; then - xbuild /verbosity:minimal /p:TargetFrameworkVersion="v4.5" /p:Configuration="Release" /p:Platform="$_pkgarch" src/eddie2.linux.ui.sln + + # 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.net7.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 = "net7" ]; 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"; + RULESETPATH="src/ruleset/norules.ruleset" + SOLUTIONPATH="src/App.Forms.Linux//App.Forms.Linux.sln" + + # clean temporary files from net7 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/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 - # Compile C sources - chmod +x src/linux_postbuild.sh - chmod +x src/Lib.Platform.Linux.Native/build.sh - chmod +x src/UI.GTK.Linux.Tray/build.sh + # Generate changelog + curl "https://eddie.website/changelog/?software=client&format=debian&hidden=yes" -o "changelog" + gzip -n -9 "changelog" if [ "cli" = "cli" ]; then - src/linux_postbuild.sh "src/App.CLI.Linux/bin/$_pkgarch/Release/" ui $_pkgarch Release - elif [ "cli" = "ui" ]; then - src/linux_postbuild.sh "src/App.Forms.Linux/bin/$_pkgarch/Release/" ui $_pkgarch Release + # Generate man + "src/App.CLI.Linux/bin/Release/net7.0/${RID}/publish/eddie-cli" --path.resources="../../../../../../resources" --help --help.format=man >"eddie-cli.8" + gzip -n -9 "eddie-cli.8" fi + } package() { - cd "Eddie" - install -Dm755 "src/App.CLI.Linux.Elevated/bin/eddie-cli-elevated" "$pkgdir/usr/lib/eddie-cli/eddie-cli-elevated" - install -Dm644 "src/Lib.Core/bin/$_pkgarch/Release/Lib.Core.dll" "$pkgdir/usr/lib/eddie-cli/Lib.Core.dll" - install -Dm644 "src/Lib.Platform.Linux/bin/$_pkgarch/Release/Lib.Platform.Linux.dll" "$pkgdir/usr/lib/eddie-cli/Lib.Platform.Linux.dll" - install -Dm644 "src/Lib.Platform.Linux.Native/bin/libLib.Platform.Linux.Native.so" "$pkgdir/usr/lib/eddie-cli/libLib.Platform.Linux.Native.so" + cd "Eddie" + install -Dm755 "repository/linux_arch/bundle/eddie-cli/usr/bin/eddie-cli" "$pkgdir/usr/bin/eddie-cli" - sed -i 's/{@lib}/lib/g' "$pkgdir/usr/bin/eddie-cli" - install -Dm644 "common/manifest.json" "$pkgdir/usr/share/eddie-cli/manifest.json" - install -Dm644 "common/libraries.txt" "$pkgdir/usr/share/eddie-cli/libraries.txt" - install -Dm644 "common/gpl3.txt" "$pkgdir/usr/share/eddie-cli/gpl3.txt" - install -Dm644 "common/cacert.pem" "$pkgdir/usr/share/eddie-cli/cacert.pem" - install -Dm644 "common/icon.png" "$pkgdir/usr/share/eddie-cli/icon.png" - install -Dm644 "common/icon_gray.png" "$pkgdir/usr/share/eddie-cli/icon_gray.png" - install -Dm644 "common/icon.png" "$pkgdir/usr/share/eddie-cli/tray.png" - install -Dm644 "common/icon_gray.png" "$pkgdir/usr/share/eddie-cli/tray_gray.png" - install -Dm644 "common/iso-3166.json" "$pkgdir/usr/share/eddie-cli/iso-3166.json" - install -Dm644 "common/lang/inv.json" "$pkgdir/usr/share/eddie-cli/lang/inv.json" - install -Dm644 "common/providers/AirVPN.json" "$pkgdir/usr/share/eddie-cli/providers/AirVPN.json" - install -Dm644 "common/providers/OpenVPN.json" "$pkgdir/usr/share/eddie-cli/providers/OpenVPN.json" - install -Dm644 "common/providers/WireGuard.json" "$pkgdir/usr/share/eddie-cli/providers/WireGuard.json" + + 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" - sed -i 's/{@lib}/lib/g' "$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/net7.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/net7.0/${RID}/eddie-cli-elevated" "$pkgdir/usr/lib/eddie-cli/eddie-cli-elevated" + install -Dm755 "src/App.CLI.Linux/bin/Release/net7.0/${RID}/publish/eddie-cli" "$pkgdir/usr/lib/eddie-cli/eddie-cli" if [ "cli" = "cli" ]; then - install -Dm755 "src/App.CLI.Linux/bin/$_pkgarch/Release/App.CLI.Linux.exe" "$pkgdir/usr/lib/eddie-cli/eddie-cli.exe" + install -Dm644 "eddie-cli.8.gz" "$pkgdir/usr/share/man/man8/eddie-cli.8.gz" elif [ "cli" = "ui" ]; then - install -Dm755 "src/App.Forms.Linux/bin/$_pkgarch/Release/App.Forms.Linux.exe" "$pkgdir/usr/lib/eddie-cli/eddie-cli.exe" - install -Dm644 "src/App.Forms.Linux/bin/$_pkgarch/Release/Lib.Forms.dll" "$pkgdir/usr/lib/eddie-cli/Lib.Forms.dll" - install -Dm644 "src/App.Forms.Linux/bin/$_pkgarch/Release/Lib.Forms.Skin.dll" "$pkgdir/usr/lib/eddie-cli/Lib.Forms.Skin.dll" - install -Dm755 "src/UI.GTK.Linux.Tray/bin/eddie-tray" "$pkgdir/usr/lib/eddie-cli/eddie-tray" + FRAMEWORK="net4" # Forced for now + if [ $FRAMEWORK = "net7" ]; 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 - - # remember: the day when common/webui is need, i need a script that generate 'install' line above for each file, include dir is unresolved - - # Generate changelog - curl "https://eddie.website/changelog/?software=client&format=debian&hidden=yes" -o "$pkgdir/usr/share/doc/eddie-cli/changelog" - gzip -n -9 "$pkgdir/usr/share/doc/eddie-cli/changelog" + fi - # Generate man - mkdir -p "$pkgdir/usr/share/man/man8/" - mono "$pkgdir/usr/lib/eddie-cli/eddie-cli.exe" --cli --path.resources="$pkgdir/usr/share/eddie-cli/" --help --help.format=man >"$pkgdir/usr/share/man/man8/eddie-cli.8" - gzip -n -9 "$pkgdir/usr/share/man/man8/eddie-cli.8" + # 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}') @@ -111,13 +176,13 @@ package() { 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-cli.png" \ - "repository/linux_arch/bundle/eddie-cli/usr/share/applications/eddie-cli.desktop" + --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-cli/usr/share/applications/eddie-cli.desktop" + "repository/linux_arch/bundle/eddie-ui/usr/share/applications/eddie-ui.desktop" fi fi } |