From 4bd1eb40913e9b80f39de3d75335d8004ac6cdb4 Mon Sep 17 00:00:00 2001 From: MrSyabro Date: Fri, 3 Feb 2023 22:51:03 +0200 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA=D1=83=20=D0=B4?= =?UTF-8?q?=D0=B5=D1=81=D0=BA=D1=82=D0=BE=D0=BF=20=D1=84=D0=B0=D0=B9=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- 0001.patch | 81 ------------------------- README.md | 1 - com.github.MrSyabro.ZeroBraneStudio.yml | 30 --------- com.zerobrane.studio.json | 55 +++++++++++++++++ install.sh.patch | 54 +++++++++++++++++ zbstudio.appdata.xml.patch | 4 ++ zbstudio.desktop.patch | 4 ++ zbstudio.sh.patch | 4 ++ 9 files changed, 122 insertions(+), 113 deletions(-) delete mode 100644 0001.patch delete mode 100644 com.github.MrSyabro.ZeroBraneStudio.yml create mode 100644 com.zerobrane.studio.json create mode 100644 install.sh.patch create mode 100644 zbstudio.appdata.xml.patch create mode 100644 zbstudio.desktop.patch create mode 100644 zbstudio.sh.patch diff --git a/.gitignore b/.gitignore index 06e0644..3458fb8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -.flatpak-builder/ +.flatpak-builder build/ \ No newline at end of file diff --git a/0001.patch b/0001.patch deleted file mode 100644 index 77f8388..0000000 --- a/0001.patch +++ /dev/null @@ -1,81 +0,0 @@ -diff --git a/ZeroBraneStudio-linux/app/zbstudio.sh b/ZeroBraneStudio-linux/app/zbstudio.sh -index c2af13f..d20bd2e 100755 ---- a/ZeroBraneStudio-linux/app/zbstudio.sh -+++ b/ZeroBraneStudio-linux/app/zbstudio.sh -@@ -3,4 +3,4 @@ - if [[ "$(uname -m)" == "x86_64" ]]; then ARCH="x64"; else ARCH="x86"; fi - CWD="$PWD" # save the current directory, as it's going to change - --(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) & -diff --git a/ZeroBraneStudio-linux/install.sh b/ZeroBraneStudio-linux/install.sh -index 32d13d4..b9fb89f 100755 ---- a/ZeroBraneStudio-linux/install.sh -+++ b/ZeroBraneStudio-linux/install.sh -@@ -1,50 +1,40 @@ - #!/bin/bash - --INSTALL_PATH=/opt/zbstudio -+INSTALL_PATH=/app/opt/zbstudio - - VERSION=$1 - - echo Installing ZeroBrane Studio $VERSION... -+mkdir -p /app/bin - - if [ -d "$INSTALL_PATH" ]; then - if [ -e "$INSTALL_PATH/cfg/user.lua" ]; then - echo "Copying cfg/user.lua file..." -- cp "$INSTALL_PATH/cfg/user.lua" "app/cfg/user.lua" -+ cp "$INSTALL_PATH/cfg/user.lua" "ZeroBraneStudio-linux/app/cfg/user.lua" - fi -- sudo rm -r $INSTALL_PATH -+ rm -r $INSTALL_PATH - fi - - INITIAL_USER=`whoami` --sudo mkdir -p $INSTALL_PATH --sudo chown -R $INITIAL_USER $INSTALL_PATH -+mkdir -p $INSTALL_PATH -+mkdir -p /app/bin -+chown -R $INITIAL_USER $INSTALL_PATH - --sudo cp -rp app/* $INSTALL_PATH -- --for ICON_SIZE in 16 22 24 32 48 64 256 --do -- sudo xdg-icon-resource install --novendor --size $ICON_SIZE $INSTALL_PATH/zbstudio/res/icons/${ICON_SIZE}x${ICON_SIZE}/apps/zbstudio.png "zbstudio" --done -+cp -rp ZeroBraneStudio-linux/app/* $INSTALL_PATH - -+cp -rp /app/share/icons/hicolor/ $INSTALL_PATH/zbstudio/res/icons/* - UPDATE_MENUS="`which update-menus 2>/dev/null`" - --sudo xdg-desktop-menu install --novendor $INSTALL_PATH/zbstudio/res/zbstudio.desktop -+cp -p /app/share/applications/ $INSTALL_PATH/zbstudio/res/zbstudio.desktop - - if [ -x "$UPDATE_MENUS" ]; then -- sudo update-menus -+ update-menus - fi - --if [ -e "/usr/bin/zbstudio" ]; then -- sudo rm /usr/bin/zbstudio -+if [ -e "/app/bin/zbstudio" ]; then -+ rm /app/bin/zbstudio - fi --sudo ln -s $INSTALL_PATH/zbstudio.sh /usr/bin/zbstudio --sudo chmod +x $INSTALL_PATH/zbstudio.sh -- --echo $VERSION | sudo tee $INSTALL_PATH/VERSION >/dev/null -- --sudo cp uninstall.sh /usr/bin/zbstudio-uninstall --sudo chmod +x /usr/bin/zbstudio-uninstall -+ln -s $INSTALL_PATH/zbstudio.sh /app/bin/zbstudio -+chmod +x $INSTALL_PATH/zbstudio.sh - --echo Done. --echo --echo To uninstall ZeroBrane Studio at a later time, run: --echo -e ' zbstudio-uninstall' -+echo $VERSION | tee $INSTALL_PATH/VERSION >/dev/null diff --git a/README.md b/README.md index 62cf7bf..53506be 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # ZeroBrane Studio Flatpak manifest Flatpak manifest для упаковки и установки ZeroBrane Studio из устанвоочного скрипта. -На данный момент 2 проблемы: не иконок приложения и нет значка меню diff --git a/com.github.MrSyabro.ZeroBraneStudio.yml b/com.github.MrSyabro.ZeroBraneStudio.yml deleted file mode 100644 index 5f2e036..0000000 --- a/com.github.MrSyabro.ZeroBraneStudio.yml +++ /dev/null @@ -1,30 +0,0 @@ -app-id: com.github.MrSyabro.ZeroBraneStudio -runtime: org.freedesktop.Platform -runtime-version: '21.08' -sdk: org.freedesktop.Sdk -command: zbstudio -finish-args: - # X11 + XShm access - - --share=ipc - - --socket=x11 - # Wayland access - - --socket=wayland - # Needs to talk to the network: - - --share=network - # Needs to save files locally - - --filesystem=home - - --device=dri -modules: - - name: zbstudio - buildsystem: simple - build-commands: - - pwd - - sh ZeroBraneStudioEduPack-1.90-linux.sh --keep --noexec --nox11 - - patch < 0001.patch - - sh ZeroBraneStudio-linux/install.sh - sources: - - type: file - url: https://download.zerobrane.com/ZeroBraneStudioEduPack-1.90-linux.sh - sha256: 89444484475b47124abed531046515d9a4ae51b0310e4c00d90a9db6b6475951 - - type: file - path: 0001.patch \ No newline at end of file diff --git a/com.zerobrane.studio.json b/com.zerobrane.studio.json new file mode 100644 index 0000000..03e3eda --- /dev/null +++ b/com.zerobrane.studio.json @@ -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" + } + ] + } + ] +} \ No newline at end of file diff --git a/install.sh.patch b/install.sh.patch new file mode 100644 index 0000000..d358650 --- /dev/null +++ b/install.sh.patch @@ -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 diff --git a/zbstudio.appdata.xml.patch b/zbstudio.appdata.xml.patch new file mode 100644 index 0000000..430c911 --- /dev/null +++ b/zbstudio.appdata.xml.patch @@ -0,0 +1,4 @@ +3c3 +< zbstudio.desktop +--- +> com.zerobrane.studio diff --git a/zbstudio.desktop.patch b/zbstudio.desktop.patch new file mode 100644 index 0000000..de691b5 --- /dev/null +++ b/zbstudio.desktop.patch @@ -0,0 +1,4 @@ +8c8 +< Icon=zbstudio +--- +> Icon=com.zerobrane.studio diff --git a/zbstudio.sh.patch b/zbstudio.sh.patch new file mode 100644 index 0000000..5b2c8c5 --- /dev/null +++ b/zbstudio.sh.patch @@ -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) &