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

Generate packages with cpack on Travis #172

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
33 changes: 26 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ env:
- DISPLAZ_BUILD_TYPE=Release
- DISPLAZ_BUILD_TYPE=Debug

matrix:
exclude:
# Only check gcc on linux and clang on OS X
- os: linux
compiler: clang
- os: osx
compiler: gcc

# either whitelist or blacklist branches
branches:
only:
Expand Down Expand Up @@ -61,12 +69,23 @@ script:
# Needs investigation by someone with an OSX machine.
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then ctest -VV -E InterProcessLock_test ; fi
- if [ "$TRAVIS_OS_NAME" != "osx" ] ; then ctest -VV ; fi
# Packaging
- cpack --help
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cpack -V -G DEB -C ${DISPLAZ_BUILD_TYPE}; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cpack -V -G RPM -C ${DISPLAZ_BUILD_TYPE}; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then cpack -V -G Bundle -C ${DISPLAZ_BUILD_TYPE}; fi
- cd ..

matrix:
exclude:
# Only check gcc on linux and clang on OS X
- os: linux
compiler: clang
- os: osx
compiler: gcc
# deploy:
# provider: releases
# api-key: "$GITHUB_TOKEN"
# file_glob: true
# file:
# - *.deb
# - *.rpm
# - *.dmg
# skip_cleanup: true
# on:
# tags: true
# condition:
# - "$DISPLAZ_BUILD_TYPE == Release"
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ endif()


#------------------------------------------------------------------------------
# Packaging, mostly just for windows at this stage.
# Packaging

# Ensure we can find NSIS.InstallOptions.ini.in
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/package")
Expand Down Expand Up @@ -233,6 +233,11 @@ if (WIN32)
")
# cpack bug workaround: avoid installing into "C:\Program Files (x86)"
set(CPACK_NSIS_INSTALL_ROOT "C:\\\\Program Files")
elseif(APPLE)
# OSX Bundle generator setup
set(CPACK_GENERATOR "Bundle")
set(CPACK_BUNDLE_NAME "Displaz")
set(CPACK_BUNDLE_ICON "package/displaz.icns")
else()
set(CPACK_GENERATOR TGZ)
endif()
Expand Down
Binary file added package/displaz.icns
Binary file not shown.
24 changes: 15 additions & 9 deletions package/make_icon.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
#!/bin/bash

files=""
for width in 16 32 48 256 ; do
name=tmp_icon_$(printf "%.3d" $width).png
make_icon () {
width=$1
name="tmp_icon_$(printf "%.3d" $width).png"
echo "Saving icon to $name" 1>&2
inkscape \
--export-png=$name \
--export-area-page \
--export-width=$width \
icon.svg
files="$files $name"
done
icon.svg 1>&2
echo $name
}

convert $files displaz.ico
echo "Making windows .ico" 1>&2
convert $(make_icon 16) $(make_icon 32) $(make_icon 48) $(make_icon 256) displaz.ico

cp tmp_icon_256.png ../src/resource/displaz_icon_256.png
echo "Making OSX .icns" 1>&2
png2icns displaz.icns $(make_icon 16) $(make_icon 32) $(make_icon 128) $(make_icon 256)

rm $files
echo "Making linux icon .png" 1>&2
cp $(make_icon 256) ../src/resource/displaz_icon_256.png

rm -f tmp_icon_*.png