From 2feef89e14cf443ef62f86b78fee46cd4668ea7e Mon Sep 17 00:00:00 2001 From: laki Date: Mon, 2 Feb 2026 13:36:56 +0000 Subject: [PATCH] Updated dependencies and the scripts to reflect those changes. --- DEPENDENCIES.txt | 36 +++++++++++++++++++++ Makefile | 4 +-- setup.sh | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 DEPENDENCIES.txt create mode 100644 setup.sh diff --git a/DEPENDENCIES.txt b/DEPENDENCIES.txt new file mode 100644 index 0000000..fe717ea --- /dev/null +++ b/DEPENDENCIES.txt @@ -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 diff --git a/Makefile b/Makefile index 3a4ab40..9bf20c3 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -CFLAGS = $(shell pkg-config --cflags gtk+-2.0 fribidi freetype2 harfbuzz 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 +CFLAGS = $(shell pkg-config --cflags gtk+-2.0 gio-2.0) -Wall -Wextra -g -std=c99 +LDFLAGS = $(shell pkg-config --libs gtk+-2.0 gio-2.0) -ldl -lm -Wl,--as-needed -Wl,-rpath,./lib SRC_DIR = src SRCS = $(SRC_DIR)/main.c \ diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..d9a59b8 --- /dev/null +++ b/setup.sh @@ -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'."