Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian package building #105

Merged
merged 7 commits into from
Aug 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ os:
- linux
- osx
language: cpp
dist: trusty
dist: bionic
sudo: required

before_install:
Expand All @@ -18,10 +18,9 @@ before_script:

script: make

after_success:
- make doxygen-doc
- make bundle
#- ./radiance_cli -a
after_success:
- cd ..
- ./.travis/after_success.sh

deploy:
- provider: pages
Expand All @@ -35,7 +34,7 @@ deploy:
- provider: releases
skip_cleanup: true
api_key: $GITHUB_TOKEN
file: "Radiance.AppDir.tar.gz"
file: "build/Radiance.AppDir.tar.gz"
on:
tags: true
all_branches: true
Expand All @@ -45,9 +44,19 @@ deploy:
- provider: releases
skip_cleanup: true
api_key: $GITHUB_TOKEN
file: "Radiance.dmg"
file: "build/Radiance.dmg"
on:
condition: "$TRAVIS_OS_NAME == osx"
tags: true
all_branches: true
overwrite: true

- provider: releases
skip_cleanup: true
api_key: $GITHUB_TOKEN
file: "deploy/build/radiance_$TRAVIS_TAG-1_amd64.deb"
on:
tags: true
all_branches: true
condition: "$TRAVIS_OS_NAME == linux"
overwrite: true
19 changes: 19 additions & 0 deletions .travis/after_success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash -ex

if [[ $TRAVIS_OS_NAME == 'osx' ]]
then
make bundle
elif [[ $TRAVIS_OS_NAME == 'linux' ]]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be pushed into the yml? on.condition: "$TRAVIS_OS_NAME == linux" or does that not work

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the pattern already in most of the travis scripts, I don't really feel like changing it. TBH I don't understand travis's yml.

then
if [[ -z "$TRAVIS_TAG" ]]
then
VERSION="0~dev1"
else
VERSION="$TRAVIS_TAG"
fi

deploy/debian.sh . deploy/build "$VERSION" 1

(cd build && make bundle)
(cd build && make doxygen-doc)
fi
5 changes: 1 addition & 4 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#!/bin/bash -x
#!/bin/bash -ex

if [[ $TRAVIS_OS_NAME == 'osx' ]]
then
echo "osx before_install"
elif [[ $TRAVIS_OS_NAME == 'linux' ]]
then
sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-add-repository -y ppa:beineri/opt-qt591-trusty
sudo add-apt-repository -y ppa:mc3man/testing6
sudo apt-get -qy update
fi
2 changes: 1 addition & 1 deletion .travis/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ then
cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt/ -DCMAKE_BUILD_TYPE=Release -DRADIANCE_SYSTEM_RESOURCES=../Resources/ ..
elif [[ $TRAVIS_OS_NAME == 'linux' ]]
then
cmake -DCMAKE_PREFIX_PATH=/opt/qt59/ -DCMAKE_BUILD_TYPE=Release -DRADIANCE_SYSTEM_RESOURCES=resources/ ..
cmake -DCMAKE_BUILD_TYPE=Release -DRADIANCE_SYSTEM_RESOURCES=resources/ ..
fi
24 changes: 4 additions & 20 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash -x
#!/bin/bash -ex

if [[ $TRAVIS_OS_NAME == 'osx' ]]
then
brew install cmake
brew install qt
brew install fftw
brew install libsamplerate
Expand All @@ -11,24 +10,9 @@ then
brew install rtmidi
elif [[ $TRAVIS_OS_NAME == 'linux' ]]
then
sudo apt-get install -qq g++-6
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
sudo apt-get -qy install doxygen graphviz qt59base qt59multimedia qt59quickcontrols qt59imageformats qt59quickcontrols2 qt59script libfftw3-dev libsamplerate0-dev libasound2-dev libmpv-dev

git clone --quiet --depth=100 "https://github.com/EddieRingle/portaudio" ~/builds/portaudio \
&& pushd ~/builds/portaudio \
&& ./configure \
&& make \
&& sudo make install \
&& popd

git clone --quiet --depth=100 "https://github.com/thestk/rtmidi" ~/builds/rtmidi \
&& pushd ~/builds/rtmidi \
&& ./autogen.sh \
&& ./configure \
&& make \
&& sudo make install \
&& popd
sudo apt-get -qy install debhelper cmake qtbase5-dev qtdeclarative5-dev \
qtquickcontrols2-5-dev libfftw3-dev libsamplerate0-dev portaudio19-dev libmpv-dev librtmidi-dev \
doxygen devscripts fakeroot graphviz

curl -L https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage > linuxdeployqt \
&& chmod +x linuxdeployqt \
Expand Down
69 changes: 69 additions & 0 deletions deploy/debian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

set -e

if [ -z "$1" ]; then
echo "You must specify the GIT root directory as the first argument" >&2
exit 1
fi

if [ -z "$2" ]; then
echo "You must specify the build directory as the second argument" >&2
exit 1
fi

if [ -e "$2" ]; then
echo "Build directory must not exist (it will be created)" >&2
exit 1
fi

if [ -z "$3" ]; then
echo "You must specify an upstream version (e.g. 0.6.1) as the third argument" >&2
exit 1
fi

if [ -z "$4" ]; then
echo "You must specify a packaging version (e.g. 1) as the fourth argument" >&2
exit 1
fi
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if [ "$#" -ne 4 ]?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 or 5 arguments is OK


mkdir -p "$2"

SOURCE_DIR=$(readlink -e "$1")
BUILD_DIR=$(readlink -e "$2")
UPSTREAM_VERSION=$3
PKG_VERSION=$4
SIGNING_KEY=$5

echo "Source dir: $SOURCE_DIR"
echo "Build dir: $BUILD_DIR"
echo "Upstream version: $UPSTREAM_VERSION"
echo "Packaging version: $PKG_VERSION"
echo "Signing key: $SIGNING_KEY"

set -x

git -C "$SOURCE_DIR" archive HEAD -o "$BUILD_DIR/radiance.tar.gz"
git -C "$SOURCE_DIR/BTrack" archive HEAD -o "$BUILD_DIR/btrack.tar.gz"
mkdir -p "$BUILD_DIR/radiance_$UPSTREAM_VERSION"
tar -C "$BUILD_DIR/radiance_$UPSTREAM_VERSION" -xf "$BUILD_DIR/radiance.tar.gz"
tar -C "$BUILD_DIR/radiance_$UPSTREAM_VERSION/BTrack" -xf "$BUILD_DIR/btrack.tar.gz"
tar -C "$BUILD_DIR" -zcf "$BUILD_DIR/radiance_$UPSTREAM_VERSION.orig.tar.gz" "radiance_$UPSTREAM_VERSION"
rm "$BUILD_DIR/radiance.tar.gz" "$BUILD_DIR/btrack.tar.gz"
cp -r "$SOURCE_DIR/deploy/debian" "$BUILD_DIR/radiance_$UPSTREAM_VERSION/debian"
cat <<EOF >"$BUILD_DIR/radiance_$UPSTREAM_VERSION/debian/changelog"
radiance ($UPSTREAM_VERSION-$PKG_VERSION) unstable; urgency=medium

* Automatically packaged for Debian

-- Eric Van Albert <eric@van.al> $(date -R)
EOF

if [ -z "$SIGNING_KEY" ]; then
KEYOPTS="-us -uc"
else
KEYOPTS="-k$SIGNING_KEY"
fi

(cd "$BUILD_DIR/radiance_$UPSTREAM_VERSION" && debuild -i $KEYOPTS -S)
(cd "$BUILD_DIR/radiance_$UPSTREAM_VERSION" && debuild -i $KEYOPTS -b)
1 change: 1 addition & 0 deletions deploy/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
19 changes: 19 additions & 0 deletions deploy/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Source: radiance
Section: video
Priority: optional
Maintainer: Eric Van Albert <eric@van.al>
Build-depends: debhelper (>= 9), cmake, qtbase5-dev, qtdeclarative5-dev,
qtquickcontrols2-5-dev, libfftw3-dev, libsamplerate0-dev, portaudio19-dev, libmpv-dev, librtmidi-dev
Standards-version: 4.1.14
Homepage: https://radiance.video

Package: radiance
Architecture: any
Depends: libqt5core5a, libqt5qml5, libqt5quick5,
libfftw3-3, libsamplerate0, libportaudio2, libmpv1, librtmidi4,
libopengl0, qtdeclarative5-models-plugin, qml-module-qt-labs-folderlistmodel,
qml-module-qtquick-controls, qml-module-qtquick-controls2, qml-module-qtquick-layouts,
${shlibs:Depends}, ${misc:Depends}
Description: video art software designed for live performance
Radiance is video art software for VJs. It supports beat detection,
animated GIFs, YouTube videos, and OpenGL shader effects.
24 changes: 24 additions & 0 deletions deploy/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Radiance
Source: https://github.com/zbanks/radiance/
Files: *
Copyright: 2019 Zach Banks <zjbanks@gmail.com>
2019 Eric Van Albert <eric@van.al>
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions deploy/debian/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deploy/radiance.desktop usr/share/applications
deploy/radiance.png usr/share/pixmaps
7 changes: 7 additions & 0 deletions deploy/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/make -f

%:
dh $@

override_dh_auto_configure:
dh_auto_configure -- -DRADIANCE_SYSTEM_RESOURCES=/usr/share/radiance/
2 changes: 1 addition & 1 deletion deploy/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mkdir -p "$APP"
echo "Copying executable and desktop file..."
cp -r "$BINARY" "$APP/radiance"
cp -r "$SOURCE_DIR/deploy/radiance.desktop" "$APP/radiance.desktop"
cp -r "$SOURCE_DIR/deploy/icon.png" "$APP/radiance.png"
cp -r "$SOURCE_DIR/deploy/radiance.png" "$APP/radiance.png"

echo "Copying resources..."
mkdir -p "$APP/resources"
Expand Down
2 changes: 1 addition & 1 deletion deploy/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ for file in $(ls "$APP"/Contents/Frameworks/*.dylib); do
done

echo "Generating icon set..."
"$SOURCE_DIR/deploy/png2icns.sh" "$SOURCE_DIR/deploy/icon.png"
"$SOURCE_DIR/deploy/png2icns.sh" "$SOURCE_DIR/deploy/radiance.png"
mv icon.icns "$APP/Contents/Resources/"

echo "Bundle is done."
Expand Down
File renamed without changes