Skip to content

Commit

Permalink
Fix build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Oct 6, 2024
1 parent 512a942 commit aba3ebe
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 27 deletions.
6 changes: 1 addition & 5 deletions distros/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
4 changes: 2 additions & 2 deletions distros/gentoo/media-sound/onthespot/onthespot-0.7.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
18 changes: 7 additions & 11 deletions scripts/build_appimage.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
6 changes: 3 additions & 3 deletions scripts/build_linux.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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..."
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/build_mac.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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..."
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -130,4 +130,4 @@ rmdir /s /q venvwin 2>nul
rmdir /s /q ffbin_win 2>nul

echo =^> Done!
timeout /t 10 >nul
timeout /t 10 >nul
2 changes: 1 addition & 1 deletion src/onthespot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..')

Expand Down

0 comments on commit aba3ebe

Please sign in to comment.