From e8ea546141b0ba0c7b0b0c0df5e955389739ee62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20M=C3=A9ndez?= Date: Sun, 7 Jul 2024 23:34:33 -0600 Subject: [PATCH] Update script and docs for new cmake-based workflow --- .gitignore | 8 ++++++-- README.md | 22 ++++++++++++++++++++-- install.sh | 3 +-- setup.sh | 2 +- start.sh | 2 +- 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 32f3bf7..452e804 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,9 @@ CMakeFiles build CMakeLists.txt.user *.pro.user* - - +.qt +.rcc +CMakeCache.txt +Makefile +cmake_install.cmake +player_autogen diff --git a/README.md b/README.md index 7844a4b..375616f 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,13 @@ The instructions here are for Debian Bookworm: ```bash # Install Qt, Qt Multimedia and Qt Creator -sudo apt-get install build-essential qt6-base-dev qt6-base-dev-tools qt6-multimedia-dev qtcreator -y +sudo apt-get install build-essential qt6-base-dev qt6-base-dev-tools qt6-multimedia-dev qtcreator cmake -y # Install third party library dependencies sudo apt-get install libtag1-dev libasound2-dev libpulse-dev libpipewire-0.3-dev libdbus-1-dev -y # Install dependencies for Python (for CD player functionality) -sudo apt-get install vlc libiso9660-dev libcdio-dev libcdio-utils swig python3-pip python3-full python3-dev libdiscid0 -y +sudo apt-get install vlc libiso9660-dev libcdio-dev libcdio-utils swig python3-pip python3-full python3-dev libdiscid0 libdiscid-dev -y # Create Python venv and install Python dependencies (for CD player functionality) ## IMPORTANT: Make sure you are on the folder where you cloned this repo before running the following commands: @@ -45,10 +45,28 @@ pip install -r python/requirements.txt ### Build and run +**Using Qt Creator:** + 1. Open this project with Qt Creator (open player.pro in Qt Creator) 2. Qt Creator should guide you setting up your paths and settings for building the proyect in your machine 3. You should be able to click the green "Play" icon in Qt Creator to build and run the app +**From the console:** + +```bash +# From inside this repository: +## Generate build configuration, you only need to run this once: +cmake CMakeLists.txt +## Setup python dependencies, you only need to run this once: +./setup.sh + +## Compile the project +make + +## Run the app +./start.sh +``` + **Tip:** If you want to see the app in a window instead of full screen, comment out the following line in `main.cpp`: `//window.setWindowState(Qt::WindowFullScreen);` ### Building a Debian package diff --git a/install.sh b/install.sh index 94d1c3b..d45c065 100755 --- a/install.sh +++ b/install.sh @@ -7,8 +7,7 @@ echo "This script re-installs linamp executable files in linamp-os. This should # Assumes the build files are on the same folder as this script rm -rf ~/linamp/* -cp *.o ~/linamp/ -cp player ~/linamp/ +cp -r build ~/linamp/ cp shutdown.sh ~/linamp/ cp start.sh ~/linamp/ cp -r venv ~/linamp/ diff --git a/setup.sh b/setup.sh index da6eccf..bfc5756 100755 --- a/setup.sh +++ b/setup.sh @@ -7,7 +7,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd "$SCRIPT_DIR" # This setups python environment -sudo apt-get install build-essential vlc libiso9660-dev libcdio-dev libcdio-utils swig python3-pip python3-full python3-dev libdiscid0 -y +sudo apt-get install build-essential vlc libiso9660-dev libcdio-dev libcdio-utils swig python3-pip python3-full python3-dev libdiscid0 libdiscid-dev -y python3 -m venv venv source venv/bin/activate diff --git a/start.sh b/start.sh index 976e3df..44426c7 100755 --- a/start.sh +++ b/start.sh @@ -3,4 +3,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/venv/bin/activate -DISPLAY=:0 PYTHONPATH=$SCRIPT_DIR/python $SCRIPT_DIR/player +DISPLAY=:0 PYTHONPATH=$SCRIPT_DIR/python $SCRIPT_DIR/build/player