Standalone Linux build

This commit is contained in:
Samuel Sloniker 2024-07-28 16:13:50 -07:00
parent d8964a7a0c
commit 0b0708f704

View File

@ -1,19 +1,20 @@
#!/bin/sh
arch=$(uname -m)
distDir=navpoint-linux-$arch
distName=navpoint-linux-$arch
rm -rf dist/$distDir
mkdir -p dist/$distDir
rm -rf dist/$distName-bundle
mkdir -p dist/$distName-bundle
pyinstaller -w -F --hidden-import tornado.web --add-data README.md:files --add-data GPL-3.0.txt:files --add-data CC-BY-SA-4.0.txt:files main.py
mv dist/main dist/$distDir/navpoint
cp icon.png dist/$distDir/navpoint.png
cp GPL-3.0.txt CC-BY-SA-4.0.txt dist/$distDir/
pandoc -s --metadata "title=Navpoint Desktop" README.md | grep -v 'h1 id="navpoint-desktop"' > dist/$distDir/README.html
cp dist/main dist/$distName-standalone
mv dist/main dist/$distName-bundle/navpoint
cp icon.png dist/$distName-bundle/navpoint.png
cp GPL-3.0.txt CC-BY-SA-4.0.txt dist/$distName-bundle/
pandoc -s --metadata "title=Navpoint Desktop" README.md | grep -v 'h1 id="navpoint-desktop"' > dist/$distName-bundle/README.html
cat > dist/$distDir/navpoint.desktop << HERE
cat > dist/$distName-bundle/navpoint.desktop << HERE
[Desktop Entry]
Type=Application
Terminal=false
@ -24,7 +25,7 @@ Categories=Application;Network
StartupWMClass=navpoint
HERE
cat > dist/$distDir/install.sh << HERE
cat > dist/$distName-bundle/install.sh << HERE
#!/bin/sh
binary_target=~/.local/bin/
@ -40,8 +41,8 @@ cp navpoint.desktop \$desktop_target/navpoint.desktop
cp navpoint.png \$icon_target/navpoint.png
HERE
chmod +x dist/$distDir/install.sh
chmod +x dist/$distName-bundle/install.sh
cd dist
tar -czf $distDir.tar.gz $distDir
tar -czf $distName-bundle.tar.gz $distName-bundle