Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Commit

Permalink
Добавил поддержку десктоп файла приложения
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSyabro committed Feb 3, 2023
1 parent 0b488a5 commit 4bd1eb4
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 113 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.flatpak-builder/
.flatpak-builder
build/
81 changes: 0 additions & 81 deletions 0001.patch

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# ZeroBrane Studio Flatpak manifest
Flatpak manifest для упаковки и установки ZeroBrane Studio из устанвоочного скрипта.
На данный момент 2 проблемы: не иконок приложения и нет значка меню
30 changes: 0 additions & 30 deletions com.github.MrSyabro.ZeroBraneStudio.yml

This file was deleted.

55 changes: 55 additions & 0 deletions com.zerobrane.studio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Automatically generated from com.github.MrSyabro.zbstudio.yml, do not modify */
{
"app-id": "com.zerobrane.studio",
"runtime": "org.freedesktop.Platform",
"runtime-version": "22.08",
"sdk": "org.freedesktop.Sdk",
"command": "zbstudio",
"finish-args": [
"--share=ipc",
"--socket=x11",
"--socket=wayland",
"--share=network",
"--filesystem=home",
"--device=dri"
],
"modules": [
{
"name": "zbstudio",
"buildsystem": "simple",
"build-commands": [
"pwd",
"sh ZeroBraneStudioEduPack-1.90-linux.sh --keep --noexec --nox11",
"patch -t ZeroBraneStudio-linux/install.sh install.sh.patch",
"patch -t ZeroBraneStudio-linux/app/zbstudio.sh zbstudio.sh.patch",
"patch -t ZeroBraneStudio-linux/app/zbstudio/res/zbstudio.appdata.xml zbstudio.appdata.xml.patch",
"patch -t ZeroBraneStudio-linux/app/zbstudio/res/zbstudio.desktop zbstudio.desktop.patch",
"mkdir -p /app/bin /app/share/applications /app/share/appdata",
"cd ZeroBraneStudio-linux && sh install.sh"
],
"sources": [
{
"type": "file",
"url": "https://download.zerobrane.com/ZeroBraneStudioEduPack-1.90-linux.sh",
"sha256": "89444484475b47124abed531046515d9a4ae51b0310e4c00d90a9db6b6475951"
},
{
"type": "file",
"path": "zbstudio.sh.patch"
},
{
"type": "file",
"path": "zbstudio.appdata.xml.patch"
},
{
"type": "file",
"path": "zbstudio.desktop.patch"
},
{
"type": "file",
"path": "install.sh.patch"
}
]
}
]
}
54 changes: 54 additions & 0 deletions install.sh.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
3c3
< INSTALL_PATH=/opt/zbstudio
---
> INSTALL_PATH=/app/opt/zbstudio
14c14
< sudo rm -r $INSTALL_PATH
---
> rm -r $INSTALL_PATH
17,19c17
< INITIAL_USER=`whoami`
< sudo mkdir -p $INSTALL_PATH
< sudo chown -R $INITIAL_USER $INSTALL_PATH
---
> mkdir -p $INSTALL_PATH
21c19
< sudo cp -rp app/* $INSTALL_PATH
---
> cp -rp app/* $INSTALL_PATH
25c23,24
< sudo xdg-icon-resource install --novendor --size $ICON_SIZE $INSTALL_PATH/zbstudio/res/icons/${ICON_SIZE}x${ICON_SIZE}/apps/zbstudio.png "zbstudio"
---
> mkdir -p /app/share/icons/hicolor/${ICON_SIZE}x${ICON_SIZE}/apps/
> cp -rp $INSTALL_PATH/zbstudio/res/icons/${ICON_SIZE}x${ICON_SIZE}/apps/zbstudio.png /app/share/icons/hicolor/${ICON_SIZE}x${ICON_SIZE}/apps/com.zerobrane.studio.png
30c29,30
< sudo xdg-desktop-menu install --novendor $INSTALL_PATH/zbstudio/res/zbstudio.desktop
---
> cp -rp $INSTALL_PATH/zbstudio/res/zbstudio.desktop /app/share/applications/com.zerobrane.studio.desktop
> cp -rp $INSTALL_PATH/zbstudio/res/zbstudio.appdata.xml /app/share/appdata/com.zerobrane.studio.appdata.xml
33c33
< sudo update-menus
---
> update-menus
36,37c36,37
< if [ -e "/usr/bin/zbstudio" ]; then
< sudo rm /usr/bin/zbstudio
---
> if [ -e "/app/bin/zbstudio" ]; then
> rm /app/bin/zbstudio
39,40c39,40
< sudo ln -s $INSTALL_PATH/zbstudio.sh /usr/bin/zbstudio
< sudo chmod +x $INSTALL_PATH/zbstudio.sh
---
> ln -s $INSTALL_PATH/zbstudio.sh /app/bin/zbstudio
> chmod +x $INSTALL_PATH/zbstudio.sh
42c42
< echo $VERSION | sudo tee $INSTALL_PATH/VERSION >/dev/null
---
> echo $VERSION | tee $INSTALL_PATH/VERSION >/dev/null
44,45c44,45
< sudo cp uninstall.sh /usr/bin/zbstudio-uninstall
< sudo chmod +x /usr/bin/zbstudio-uninstall
---
> cp uninstall.sh /app/bin/zbstudio-uninstall
> chmod +x /app/bin/zbstudio-uninstall
4 changes: 4 additions & 0 deletions zbstudio.appdata.xml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
3c3
< <id type="desktop">zbstudio.desktop</id>
---
> <id type="desktop">com.zerobrane.studio</id>
4 changes: 4 additions & 0 deletions zbstudio.desktop.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
8c8
< Icon=zbstudio
---
> Icon=com.zerobrane.studio
4 changes: 4 additions & 0 deletions zbstudio.sh.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
6c6
< (cd "/opt/zbstudio"; bin/linux/$ARCH/lua src/main.lua zbstudio -cwd "$CWD" "$@" 2>/dev/null) &
---
> (cd "/app/opt/zbstudio"; bin/linux/$ARCH/lua src/main.lua zbstudio -cwd "$CWD" "$@" 2>/dev/null) &

0 comments on commit 4bd1eb4

Please sign in to comment.