Skip to content

Commit

Permalink
Packaging: Linux AppImage - Part 1 (onivim#405)
Browse files Browse the repository at this point in the history
* Update script

* Copy desktop file

* Add icon512

* Create AppImage

* Add AppRun
  • Loading branch information
bryphe authored Jul 13, 2019
1 parent 711023a commit 9773ae0
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ typings/
_build/
_esy/
_release/
_staging/

.DS_Store
setup.txt
Expand Down
Binary file added assets/images/icon512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions scripts/linux/AppRun
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
HERE=$(dirname $(readlink -f "${0}"))
export PATH="${HERE}/usr/bin":$PATH
export LD_LIBRARY_PATH="${HERE}/usr/lib/":$LD_LIBRARY_PATH
${HERE}/usr/bin/Oni2 $@

6 changes: 6 additions & 0 deletions scripts/linux/Onivim2.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
Name=Onivim2
Exec=Oni2
Icon=Onivim2
Type=Application
Categories=Development;
31 changes: 31 additions & 0 deletions scripts/linux/package-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
echo "cur bin $cur__bin"

rm -rf _release
rm -rf _staging

mkdir -p _release/linux
mkdir -p _staging

cp -r $cur__bin _release/linux

wget -O _staging/linuxdeploy-x86_64.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x _staging/linuxdeploy-x86_64.AppImage

wget -O _staging/appimagetool-x86_64.AppImage https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
chmod +x _staging/appimagetool-x86_64.AppImage

cp scripts/linux/Onivim2.desktop _release/linux/Onivim2.desktop
cp assets/images/icon512.png _release/linux/Onivim2.png

./_staging/linuxdeploy-x86_64.AppImage -e _release/linux/bin/Oni2_editor --appdir _release/Onivim2.AppDir -d _release/linux/Onivim2.desktop -i _release/linux/Onivim2.png

cp scripts/linux/Onivim2.desktop _release/Onivim2.AppDir/Onivim2.desktop
cp scripts/linux/AppRun _release/Onivim2.AppDir/AppRun
chmod +x _release/Onivim2.AppDir/AppRun
cp assets/images/icon512.png _release/Onivim2.AppDir/Onivim2.png

cp _release/linux/bin/*.* _release/Onivim2.AppDir/usr/bin
cp _release/linux/bin/Oni2 _release/Onivim2.AppDir/usr/bin/Oni2

ARCH=x86_64 _staging/appimagetool-x86_64.AppImage _release/Onivim2.AppDir _release/Onivim2-x86_64.AppImage

6 changes: 4 additions & 2 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ const getNodePath = () => {
return path.join(rootDirectory, "vendor", nodeDir, "linux-x64", "node");
}
}

if (process.platform == "darwin") {
if (process.platform == "linux") {
const result = cp.spawnSync("esy", ["scripts/linux/package-linux.sh"], { cwd: process.cwd(), env: process.env, stdio: 'inherit'});
console.log(result.output.toString());
} else if (process.platform == "darwin") {

const executables = [
"Oni2",
Expand Down

0 comments on commit 9773ae0

Please sign in to comment.