From aba3ebebfe0d20c339cc13a7d8408be037e46385 Mon Sep 17 00:00:00 2001 From: Justin Donofrio Date: Sun, 6 Oct 2024 13:31:42 -0400 Subject: [PATCH] Fix build scripts --- distros/arch/PKGBUILD | 6 +----- .../onthespot/onthespot-0.7.1.ebuild | 4 ++-- scripts/build_appimage.sh | 18 +++++++----------- scripts/build_linux.sh | 6 +++--- scripts/build_mac.sh | 6 +++--- scripts/build_windows.bat | 4 ++-- src/onthespot/__init__.py | 2 +- ...desktop => org.onthespot.OnTheSpot.desktop} | 0 8 files changed, 19 insertions(+), 27 deletions(-) mode change 100644 => 100755 scripts/build_appimage.sh mode change 100644 => 100755 scripts/build_linux.sh mode change 100644 => 100755 scripts/build_mac.sh rename src/onthespot/resources/{org.eu.casualsnek.onthespot.desktop => org.onthespot.OnTheSpot.desktop} (100%) diff --git a/distros/arch/PKGBUILD b/distros/arch/PKGBUILD index 3507b67..e6ef80d 100644 --- a/distros/arch/PKGBUILD +++ b/distros/arch/PKGBUILD @@ -19,17 +19,13 @@ build() { python -m build --wheel --no-isolation } -pkgver() { - grep "self.version = *" "$PWD/onthespot-$_branch/src/onthespot/otsconfig.py" | sed 's/self.version = //g;s/ //g' -} - package() { cd "onthespot-$_branch" python -m installer --destdir="$pkgdir" dist/*.whl install -dm 755 "$pkgdir/usr/share/applications" install -dm 755 "$pkgdir/usr/share/icons/hicolor/"{256x256,scalable}"/apps/" install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" - install -Dm 644 "src/onthespot/resources/org.eu.casualsnek.onthespot.desktop" "$pkgdir/usr/share/applications/" + install -Dm 644 "src/onthespot/resources/org.onthespot.OnTheSpot.desktop" "$pkgdir/usr/share/applications/" install -Dm 644 "src/onthespot/resources/icons/onthespot.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/onthespot.svg" install -Dm 644 "src/onthespot/resources/icons/onthespot.png" "$pkgdir/usr/share/icons/hicolor/256x256/apps/onthespot.png" } diff --git a/distros/gentoo/media-sound/onthespot/onthespot-0.7.1.ebuild b/distros/gentoo/media-sound/onthespot/onthespot-0.7.1.ebuild index b1a95da..2e7087d 100644 --- a/distros/gentoo/media-sound/onthespot/onthespot-0.7.1.ebuild +++ b/distros/gentoo/media-sound/onthespot/onthespot-0.7.1.ebuild @@ -42,6 +42,6 @@ RDEPEND=" src_install() { distutils-r1_src_install - domenu "${S}"/src/onthespot/resources/org.eu.casualsnek.onthespot.desktop - newicon -s 256 "${S}"/src/onthespot/resources/onthespot.svg onthespot.svg + domenu "${S}"/src/onthespot/resources/org.onthespot.OnTheSpot.desktop + newicon -s 256 "${S}"/src/onthespot/resources/onthespot.png onthespot.png } diff --git a/scripts/build_appimage.sh b/scripts/build_appimage.sh old mode 100644 new mode 100755 index 36fc3a4..ea573e0 --- a/scripts/build_appimage.sh +++ b/scripts/build_appimage.sh @@ -8,7 +8,7 @@ FOLDER_NAME=$(basename "$PWD") if [ "$FOLDER_NAME" == "scripts" ]; then echo "You are in the scripts folder. Changing to the parent directory..." cd .. -elif [ "$FOLDER_NAME" != "onthespot" ]; then +elif [ "$FOLDER_NAME" != "OnTheSpot" ]; then echo "Make sure that you are inside the project folder. Current folder is: $FOLDER_NAME" exit 1 fi @@ -22,10 +22,10 @@ echo " => Fetching Dependencies" mkdir -p build && cd build # Download AppImage Tool and Python AppImage -wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage +wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage chmod +x appimagetool-x86_64.AppImage -wget -q https://github.com/niess/python-appimage/releases/download/python3.12/python3.12.3-cp312-cp312-manylinux2014_x86_64.AppImage +wget https://github.com/niess/python-appimage/releases/download/python3.12/python3.12.3-cp312-cp312-manylinux2014_x86_64.AppImage chmod +x python3.12.3-cp312-cp312-manylinux2014_x86_64.AppImage # Extract Python AppImage @@ -40,7 +40,7 @@ build/OnTheSpot.AppDir/AppRun -m build # Upgrade pip and install necessary dependencies echo " => Upgrading pip and installing necessary dependencies..." -build/OnTheSpot.AppDir/AppRun -m pip install --upgrade pip wheel winsdk pyinstaller +build/OnTheSpot.AppDir/AppRun -m pip install --upgrade pip wheel pyinstaller # Prepare OnTheSpot AppImage echo " => Preparing OnTheSpot AppImage" @@ -52,8 +52,8 @@ OnTheSpot.AppDir/AppRun -m pip install ../dist/onthespot-*-py3-none-any.whl rm OnTheSpot.AppDir/AppRun OnTheSpot.AppDir/.DirIcon OnTheSpot.AppDir/python.png OnTheSpot.AppDir/python3.12.3.desktop # Copy resources -cp ../src/onthespot/resources/icons/onthespot.svg OnTheSpot.AppDir/onthespot.svg -cp ../src/onthespot/resources/org.eu.casualsnek.onthespot.desktop OnTheSpot.AppDir/org.eu.casualsnek.onthespot.desktop +cp ../src/onthespot/resources/icons/onthespot.png OnTheSpot.AppDir/onthespot.png +cp ../src/onthespot/resources/org.onthespot.OnTheSpot.desktop OnTheSpot.AppDir/org.onthespot.OnTheSpot.desktop # Create AppRun script cat << 'EOF' > OnTheSpot.AppDir/AppRun @@ -75,14 +75,10 @@ chmod +x OnTheSpot.AppDir/AppRun # FFmpeg notice echo ' => ffmpeg and ffplay need to be manually added to OnTheSpot.AppDir/usr/bin.' echo ' => Binaries can be found at https://johnvansickle.com/ffmpeg/' - -# Ask user about ffmpeg binaries read -p ' => Done adding ffmpeg binaries? (y/n): ' ffmpeg if [[ "$ffmpeg" == "y" ]]; then echo " => Building OnTheSpot AppImage" - ./appimagetool-x86_64.AppImage OnTheSpot.AppDir + ./appimagetool-x86_64.AppImage --appimage-extract-and-run OnTheSpot.AppDir mv OnTheSpot-x86_64.AppImage ../dist/OnTheSpot-x86_64.AppImage echo " => Done!" -else - echo " => Exiting without building AppImage." fi diff --git a/scripts/build_linux.sh b/scripts/build_linux.sh old mode 100644 new mode 100755 index bad0acf..c464bbf --- a/scripts/build_linux.sh +++ b/scripts/build_linux.sh @@ -8,7 +8,7 @@ FOLDER_NAME=$(basename "$PWD") if [ "$FOLDER_NAME" == "scripts" ]; then echo "You are in the scripts folder. Changing to the parent directory..." cd .. -elif [ "$FOLDER_NAME" != "onthespot" ]; then +elif [ "$FOLDER_NAME" != "OnTheSpot" ]; then echo "Make sure that you are inside the project folder. Current folder is: $FOLDER_NAME" exit 1 fi @@ -27,7 +27,7 @@ source ./venv/bin/activate # Upgrade pip and install dependencies using Bash echo " => Upgrading pip and installing necessary dependencies..." -venv/bin/pip install --upgrade pip wheel winsdk pyinstaller +venv/bin/pip install --upgrade pip wheel pyinstaller # Install project-specific dependencies echo " => Installing project-specific dependencies..." @@ -40,8 +40,8 @@ if [ -f "ffbin_nix/ffmpeg" ]; then NAME="onthespot_linux_ffm" else echo " => FFmpeg binary not found. Building without it." - NAME="onthespot_linux" FFBIN="" + NAME="onthespot_linux" fi # Run PyInstaller diff --git a/scripts/build_mac.sh b/scripts/build_mac.sh old mode 100644 new mode 100755 index ebb6711..4fdd80b --- a/scripts/build_mac.sh +++ b/scripts/build_mac.sh @@ -8,7 +8,7 @@ FOLDER_NAME=$(basename "$PWD") if [ "$FOLDER_NAME" == "scripts" ]; then echo "You are in the scripts folder. Changing to the parent directory..." cd .. -elif [ "$FOLDER_NAME" != "onthespot" ]; then +elif [ "$FOLDER_NAME" != "OnTheSpot" ]; then echo "Make sure that you are inside the project folder. Current folder is: $FOLDER_NAME" exit 1 fi @@ -27,7 +27,7 @@ source ./venv/bin/activate # Upgrade pip and install dependencies echo " => Upgrading pip and installing dependencies using Bash..." -venv/bin/pip install --upgrade pip wheel winsdk pyinstaller +venv/bin/pip install --upgrade pip wheel pyinstaller # Install project-specific dependencies echo " => Installing project-specific dependencies..." @@ -40,8 +40,8 @@ if [ -f "ffbin_mac/ffmpeg" ]; then NAME="onthespot_mac_ffm" else echo " => FFmpeg binary not found. Building without it." - NAME="onthespot_mac" FFBIN="" + NAME="onthespot_mac" fi # Run PyInstaller to create the app diff --git a/scripts/build_windows.bat b/scripts/build_windows.bat index 65db8bd..cf93414 100644 --- a/scripts/build_windows.bat +++ b/scripts/build_windows.bat @@ -8,7 +8,7 @@ for %%F in ("%cd%") do set FOLDER_NAME=%%~nxF if /i "%FOLDER_NAME%"=="scripts" ( echo You are in the scripts folder. Changing to the parent directory... cd .. -) else if /i not "%FOLDER_NAME%"=="onthespot" ( +) else if /i not "%FOLDER_NAME%"=="OnTheSpot" ( echo Make sure that you are inside the project folder. Current folder is: %FOLDER_NAME% timeout /t 10 >nul exit /b 1 @@ -130,4 +130,4 @@ rmdir /s /q venvwin 2>nul rmdir /s /q ffbin_win 2>nul echo =^> Done! -timeout /t 10 >nul \ No newline at end of file +timeout /t 10 >nul diff --git a/src/onthespot/__init__.py b/src/onthespot/__init__.py index b735bf5..ecb207f 100755 --- a/src/onthespot/__init__.py +++ b/src/onthespot/__init__.py @@ -60,7 +60,7 @@ def main(): _dialog = MiniDialog() window = MainWindow(_dialog, start_url) - app.setDesktopFileName('org.eu.casualsnek.onthespot') + app.setDesktopFileName('org.onthespot.OnTheSpot') app.exec() logger.info('Good bye ..') diff --git a/src/onthespot/resources/org.eu.casualsnek.onthespot.desktop b/src/onthespot/resources/org.onthespot.OnTheSpot.desktop similarity index 100% rename from src/onthespot/resources/org.eu.casualsnek.onthespot.desktop rename to src/onthespot/resources/org.onthespot.OnTheSpot.desktop