Skip to content

Commit

Permalink
Update script and docs for new cmake-based workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodmg committed Jul 8, 2024
1 parent bf91fbd commit e8ea546
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ CMakeFiles
build
CMakeLists.txt.user
*.pro.user*


.qt
.rcc
CMakeCache.txt
Makefile
cmake_install.cmake
player_autogen
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e8ea546

Please sign in to comment.