Updated dependencies and the scripts to reflect those changes.

This commit is contained in:
laki 2026-02-02 13:36:56 +00:00
parent fb152e7b7b
commit 2feef89e14
3 changed files with 119 additions and 2 deletions

36
DEPENDENCIES.txt Normal file
View File

@ -0,0 +1,36 @@
GTK2 Media Player - Dependencies List
=== Runtime Dependencies ===
These libraries are required to run the application.
1. GTK+ 2.0
- Debian/Ubuntu: libgtk2.0-0
- Arch/Fedora: gtk2
2. libmpv (The portable version of this player bundles this)
- Debian/Ubuntu: libmpv2 or libmpv1
- Arch/Fedora: mpv
3. Standard System Libraries
- glib-2.0
- gobject-2.0
- gio-2.0
- libm (Math)
- libdl (Dynamic Linking)
- libpthread (Threads)
=== Build Dependencies ===
These are required to compile the source code.
1. Build Tools
- gcc (C Compiler)
- make
- pkg-config
2. Development Headers
- libgtk2.0-dev
- libmpv-dev
=== Installation Command (Debian/Ubuntu) ===
sudo apt install build-essential pkg-config libgtk2.0-dev libmpv-dev

View File

@ -1,5 +1,5 @@
CFLAGS = $(shell pkg-config --cflags gtk+-2.0 fribidi freetype2 harfbuzz gio-2.0) -Wall -Wextra -g -std=c99 CFLAGS = $(shell pkg-config --cflags gtk+-2.0 gio-2.0) -Wall -Wextra -g -std=c99
LDFLAGS = $(shell pkg-config --libs gtk+-2.0 fribidi freetype2 harfbuzz gio-2.0) -ldl -lm -Wl,--as-needed -Wl,-rpath,./lib LDFLAGS = $(shell pkg-config --libs gtk+-2.0 gio-2.0) -ldl -lm -Wl,--as-needed -Wl,-rpath,./lib
SRC_DIR = src SRC_DIR = src
SRCS = $(SRC_DIR)/main.c \ SRCS = $(SRC_DIR)/main.c \

81
setup.sh Normal file
View File

@ -0,0 +1,81 @@
#!/bin/bash
# Universal Setup Script for GTK2 MPV Player
# Identifies the Linux distribution and installs required build dependencies.
set -e
PRINT_INFO() { echo -e "\e[34m[INFO]\e[0m $1"; }
PRINT_SUCCESS() { echo -e "\e[32m[SUCCESS]\e[0m $1"; }
PRINT_ERROR() { echo -e "\e[31m[ERROR]\e[0m $1"; }
PRINT_WARNING() { echo -e "\e[33m[WARNING]\e[0m $1"; }
OS_TYPE=""
if [ -f /etc/os-release ]; then
. /etc/os-release
OS_TYPE=$ID
else
PRINT_ERROR "Could not detect operating system type. /etc/os-release missing."
exit 1
fi
PRINT_INFO "Detected operating system: $OS_TYPE"
install_debian_deps() {
PRINT_INFO "Installing dependencies for Debian/Ubuntu/Mint..."
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libgtk2.0-dev libmpv-dev
}
install_fedora_deps() {
PRINT_INFO "Installing dependencies for Fedora/RHEL/CentOS..."
sudo dnf groupinstall -y "Development Tools"
sudo dnf install -y pkg-config gtk2-devel mpv-devel
}
install_arch_deps() {
PRINT_INFO "Installing dependencies for Arch/Manjaro..."
sudo pacman -S --needed base-devel pkg-config gtk2 mpv
}
install_opensuse_deps() {
PRINT_INFO "Installing dependencies for openSUSE..."
sudo zypper install -t pattern devel_C_C++
sudo zypper install -y pkg-config gtk2-devel mpv-devel
}
install_slackware_deps() {
PRINT_INFO "Checking dependencies for Slackware..."
PRINT_WARNING "Slackware dependency management varies. Please ensure the following are installed:"
echo " - gtk+2"
echo " - mpv (with client library support)"
echo " - pkg-config"
echo ""
PRINT_INFO "If you have slackpkg+ or similar, you can try searching for 'gtk+2' and 'mpv'."
}
case "$OS_TYPE" in
ubuntu|debian|linuxmint|pop|kali|raspbian)
install_debian_deps
;;
fedora|centos|rhel|almalinux|rocky)
install_fedora_deps
;;
arch|manjaro)
install_arch_deps
;;
opensuse*|suse)
install_opensuse_deps
;;
slackware)
install_slackware_deps
;;
*)
PRINT_WARNING "Unsupported or unknown distribution: $OS_TYPE"
PRINT_INFO "Please manually install the development files for: gtk2 and mpv."
exit 1
;;
esac
PRINT_SUCCESS "Dependency installation step complete."
PRINT_INFO "You can now build the player using 'make'."