improve build tools

This commit is contained in:
Manuel Dewald
2021-03-11 09:02:55 +01:00
parent 0b31eda1c2
commit 128796c9e8
5 changed files with 76 additions and 27 deletions

36
Makefile Normal file
View File

@@ -0,0 +1,36 @@
VERSION ?= 0.0.0
BINARY ?= slide
ARCH ?= noarch
.PHONY: all
all: build
.PHONY: install-deps-deb
install-deps-deb:
apt install qt5-qmake libexif12 qt5-default libexif-dev qt5-image-formats-plugins
check-deps-deb:
dpkg -l | grep qt5-qmake
dpkg -l | grep libexif12
dpkg -l | grep libexif-dev
dpkg -l | grep qt5-default
dpkg -l | grep qt5-image-formats-plugins
.PHONY: clean
clean:
rm -rf build
build:
mkdir -p build
qmake src/slide.pro -o build/Makefile
make -C build
PACKAGE_DIR=build/slide_$(VERSION)
.PHONY: package
package: clean build
mkdir -p $(PACKAGE_DIR)
cp -r "./build/$(BINARY)" $(PACKAGE_DIR)
cp "INSTALL.md" $(PACKAGE_DIR)
cp "LICENSE" $(PACKAGE_DIR)
cd build && tar cfz slide_$(ARCH)_$(VERSION).tar.gz slide_$(VERSION)

View File

@@ -5,6 +5,7 @@ Simple, lightweight slideshow selecting random images from specified directory.
Tested versions:
* Raspberry Pi 3 running Raspbian Stretch.
* Raspberry Pi 3 running Raspbian Buster.
* Raspberry Pi Zero running Raspbian Buster.
Screen background is filled with a scaled version of the image to prevent pure black background.
@@ -44,27 +45,34 @@ slide [-t rotation_seconds] [-o background_opacity(0..255)] [-b blur_radius] -p
## Dependencies
* libexif
* qt5-qmake
* qt5
* qt5-image-formats-plugins for tiff
* qt5-image-formats-plugins
* libexif
Ubuntu/Raspbian:
```
sudo apt install libexif12 qt5-default
sudo apt install qt5-image-formats-plugins
sudo make install-deps-deb
```
## Build
dev libs needed to build slide on from source:
Install dependencies
```
sudo apt install libexif-dev
make install-deps-deb
```
Build project
```
mkdir -p make
cd make
qmake ../src/slide.pro
make
```
Install binaries
```
sudo make install
```
@@ -75,9 +83,7 @@ Prerequisite: brew
```
brew install qt5
brew install libexif
mkdir -p build
cd build
qmake ../src/slide.pro
brew install libexif
make
```
@@ -88,7 +94,7 @@ This article has more helpful ways that you could use this repo as a picture fra
https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi
```
## Removing black border
## Removing black border (Raspberry Pi)
```
if you find that you have a black border around your screen you can remove it by disabling overscan. This is done by editing /boot/config.txt and uncommenting disable_overscan=1

View File

@@ -2,8 +2,8 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
ARCH=$1
VERSION=$2
export ARCH=$1
export VERSION=$2
set -euo pipefail
@@ -22,11 +22,8 @@ if [[ "$ARCH" == "osx" ]]; then
fi
cd "$DIR/.."
mkdir -p make/slide_$VERSION
cd make
qmake ../src/slide.pro
make
cp -r "$BINARY" "slide_$VERSION/"
cp "../INSTALL.md" "slide_$VERSION/"
cp "../LICENSE" "slide_$VERSION/"
tar cfz slide_${ARCH}_$VERSION.tar.gz "slide_$VERSION"
if ! make check-deps-deb; then
sudo make install-deps-deb
fi
make package

10
sbin/package_all.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
set -euxo pipefail
VERSION=$1
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
make clean
$DIR/package_remote.sh pi picframe pi $VERSION
$DIR/package_remote.sh pi raspberrypi pi-0 $VERSION
$DIR/package.sh amd64 $VERSION
mv build/slide_amd64_$VERSION.tar.gz .

View File

@@ -9,7 +9,7 @@ VERSION=$4
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR/..
rsync -av --delete $(pwd)/* $USER@$HOSTNAME:/tmp/slide_build
ssh $USER@$HOSTNAME "rm -rf /tmp/slide_build/build;/tmp/slide_build/sbin/package.sh $ARCH $VERSION"
scp $USER@$HOSTNAME:/tmp/slide_build/make/slide_*.tar.gz .
cd "$DIR/.."
rsync -av --delete "$(pwd)"/* "$USER@$HOSTNAME:/tmp/slide_build"
ssh "$USER@$HOSTNAME" "rm -rf /tmp/slide_build/build;/tmp/slide_build/sbin/package.sh $ARCH $VERSION"
scp "$USER@$HOSTNAME:/tmp/slide_build/build/slide_*.tar.gz" .