fix rpm builds in travis (#3472)

* add rpm build option to travis compile

* better argument parsing
This commit is contained in:
ebbit1q 2018-12-12 13:26:13 +01:00 committed by ctrlaltca
parent 3a05bcfb29
commit cee69705d8
3 changed files with 11 additions and 3 deletions

View file

@ -11,6 +11,7 @@ RUN dnf install -y \
libappstream-glib \
protobuf-devel \
qt5-{qttools,qtsvg,qtmultimedia,qtwebsockets}-devel \
rpm-build \
sqlite-devel \
wget \
zlib-devel \

View file

@ -16,9 +16,13 @@ while [[ "$@" ]]; do
'--package')
MAKE_PACKAGE=1
shift
if [[ $1 != -* ]]; then
if [[ $# != 0 && $1 != -* ]]; then
PACKAGE_NAME="$1"
shift
if [[ $# != 0 && $1 != -* ]]; then
PACKAGE_TYPE="$1"
shift
fi
fi
;;
'--server')
@ -107,6 +111,9 @@ fi
if [[ $BUILDTYPE ]]; then
flags+=" -DCMAKE_BUILD_TYPE=$BUILDTYPE"
fi
if [[ $PACKAGE_TYPE ]]; then
flags+=" -DCPACK_GENERATOR=$PACKAGE_TYPE"
fi
# Add qt install location when using brew
if [[ $(uname) == "Darwin" ]]; then
@ -133,7 +140,7 @@ if [[ $MAKE_PACKAGE ]]; then
found=$(find . -maxdepth 1 -type f -name "Cockatrice-*.*" -print -quit)
path=${found%/*}
file=${found##*/}
if [[ $file != *.* ]]; then
if [[ ! $file ]]; then
echo "could not find package" >&2
exit 1
fi

View file

@ -77,7 +77,7 @@ matrix:
script: docker run --mount "type=bind,source=$(pwd),target=/src" -w="/src"
--mount "type=bind,source=$HOME/$NAME/.ccache,target=/.ccache" -e "CCACHE_DIR=/.ccache"
"cockatrice_${NAME,,}"
bash .ci/travis-compile.sh --server --package "$NAME" --release
bash .ci/travis-compile.sh --server --package "$NAME" "RPM" --release
#macOS
- name: macOS (Debug)