From 21d35c7ec14e76cd24f3537dbd120950b05d980c Mon Sep 17 00:00:00 2001 From: justuser Date: Fri, 11 Oct 2024 20:53:32 +0300 Subject: [PATCH] init files --- build.sh | 4 ++++ clean.sh | 4 ++++ download.sh | 24 ++++++++++++++++++++++++ install.sh | 9 +++++++++ install_requirements.sh | 7 +++++++ main.sh | 36 ++++++++++++++++++++++++++++++++++++ org.flatpak.ByeDPI.yml | 31 +++++++++++++++++++++++++++++++ uninstall.sh | 1 + 8 files changed, 116 insertions(+) create mode 100755 build.sh create mode 100755 clean.sh create mode 100755 download.sh create mode 100755 install.sh create mode 100755 install_requirements.sh create mode 100755 main.sh create mode 100644 org.flatpak.ByeDPI.yml create mode 100755 uninstall.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..f97b897 --- /dev/null +++ b/build.sh @@ -0,0 +1,4 @@ +echo "---" +echo "Строим пакет..." +echo "---" +flatpak-builder build-dir --force-clean org.flatpak.ByeDPI.yml diff --git a/clean.sh b/clean.sh new file mode 100755 index 0000000..63430fd --- /dev/null +++ b/clean.sh @@ -0,0 +1,4 @@ +rm -rf build +rm -rf build-dir +rm -rf .flatpak-builder +rm *.tar.gz diff --git a/download.sh b/download.sh new file mode 100755 index 0000000..a712ce5 --- /dev/null +++ b/download.sh @@ -0,0 +1,24 @@ +echo "---" +echo "Скачивание бинарного файла..." +echo "---" +# Fetch the latest release information from the GitHub API +response=$(curl -s https://api.github.com/repos/hufrea/byedpi/releases/latest) +# Extract the release tag and the desired file name +release_tag=$(echo "$response" | grep -o '"tag_name": "[^"]*' | sed 's/"tag_name": "//') +file_name=$(echo "$response" | grep -o 'byedpi-[^"]*x86_64\.tar\.gz' | head -n 1) +# Construct the download link +download_link="https://github.com/hufrea/byedpi/releases/download/$release_tag/$file_name" + +wget $download_link + +echo "---" +echo "Создаём папку для сборки..." +echo "---" +mkdir build + +echo "---" +echo "Распаковываем и достаём файлы..." +echo "---" +tar -xvf *.tar.gz +chmod +x "ciadpi-x86_64" +mv "ciadpi-x86_64" build/ diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..018c0de --- /dev/null +++ b/install.sh @@ -0,0 +1,9 @@ +flatpak-builder --user --install --force-clean build-dir org.flatpak.ByeDPI.yml + +echo "------------" +echo "Установка завершена!" +echo "Запуск: flatpak run org.flatpak.ByeDPI --help" +echo "" +echo "Пример использования:" +echo "flatpak run org.flatpak.ByeDPI --disorder 1 --auto=torst --tlsrec 1+s --debug 1" +echo "------------" diff --git a/install_requirements.sh b/install_requirements.sh new file mode 100755 index 0000000..a5cad0a --- /dev/null +++ b/install_requirements.sh @@ -0,0 +1,7 @@ +echo "Установите пакеты: flatpak-builder" +read -p "Продолжить..." + +echo "---" +echo "Установка SDK..." +echo "---" +flatpak install flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08 diff --git a/main.sh b/main.sh new file mode 100755 index 0000000..c8fa724 --- /dev/null +++ b/main.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +show_help() { + echo "$0 [down-only / build-only / install-only]" + echo "" + echo "down-only только скачать файл" + echo "build-only только построить пакет" + echo "install-only только установить пакет" + echo "clean очистка всех файлов сборки" + echo "uninstall удалить приложение" + exit 1 +} + +if [ "$#" == 0 ]; then + # INSTALL + ./install_requirements.sh + ./download.sh + ./install.sh +elif [ "$#" == 1 ]; then + arg=$1 + if [ $arg == "down-only" ]; then + ./download.sh + elif [ $arg == "build-only" ]; then + ./build.sh + elif [ $arg == "install-only" ]; then + ./install.sh + elif [ $arg == "clean" ]; then + ./clean.sh + elif [ $arg == "uninstall" ]; then + ./uninstall.sh + else + show_help + fi +else + show_help +fi diff --git a/org.flatpak.ByeDPI.yml b/org.flatpak.ByeDPI.yml new file mode 100644 index 0000000..1932645 --- /dev/null +++ b/org.flatpak.ByeDPI.yml @@ -0,0 +1,31 @@ +id: org.flatpak.ByeDPI +runtime: org.freedesktop.Platform +runtime-version: '23.08' +sdk: org.freedesktop.Sdk +command: "/app/ciadpi-x86_64" +finish-args: + # X11 + XShm access + #- --share=ipc + #- --socket=fallback-x11 + # Wayland access + #- --socket=wayland + # Needs to talk to the network: + - --share=network + # Audio + #- --socket=pulseaudio + # GPU + #- --device=dri + # Persist dir + #- --persist=.catangens-minecraft + # Open files (NOT WORK) + #- --talk-name=org.freedesktop.portal.FileChooser.OpenFile +modules: + - name: ByeDPI + buildsystem: simple + build-commands: + - cp -r ciadpi-x86_64 /app/ + sources: + - type: dir + path: "build" + #- type: file + # path: test.sh diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..74c6f0b --- /dev/null +++ b/uninstall.sh @@ -0,0 +1 @@ +flatpak remove org.flatpak.ByeDPI