Commit 34cd921a authored by Marco Trevisan's avatar Marco Trevisan

snap: use new features, reduce cmake usage and travis deploy

We can now move to use build.snapcraft.io for
deployment.
parent 86bb4177
......@@ -55,10 +55,11 @@ remmina/remmina
remmina/src/remmina
*.snap
snapcraft.yaml
parts
prime
stage
snap/snap
snap/SNAP_VERSION
snap/.snapcraft
.flatpak-builder/
......@@ -47,11 +47,7 @@ env:
- DEB_BUILD_OPTIONS='-DCMAKE_BUILD_TYPE=Debug -DWITH_SSE2=ON -DWITH_APPINDICATOR=OFF'
- DOCKER_IMAGE=ubuntu:xenial
- SNAP_PRIME_ON_PULL_REQUEST=true
- SNAP_TRANSFER_SH_UPLOAD_ON_PULL_REQUEST=true
- SNAP_UNSTABLE_CHANNEL=edge
- SNAP_RELEASE_CHANNEL=candidate
- SNAPCRAFT_CONFIG_KEY=$encrypted_fe91ff0c7eee_key
- SNAPCRAFT_CONFIG_IV=$encrypted_fe91ff0c7eee_iv
- SNAP_TRANSFER_SH_UPLOAD=true
matrix:
# - BUILD_TYPE=deb
- BUILD_TYPE=snap
......@@ -78,14 +74,6 @@ deploy:
condition: $BUILD_TYPE = snap
branch: next
- provider: script
skip_cleanup: true
script: scripts/travis-build.sh deploy-release
on:
condition: $BUILD_TYPE = snap
branch: next
tags: true
notifications:
email:
- antenore@simbiosi.org
......
......@@ -162,7 +162,9 @@ if(NOT REMMINA_EXTERNAL_TOOLS_DIR)
endif()
# Snap package generation support
if(NOT DEFINED ENV{SNAPCRAFT_PROJECT_NAME})
if(DEFINED ENV{SNAPCRAFT_PROJECT_NAME})
add_subdirectory(snap)
else()
find_program(SNAPCRAFT "snapcraft")
if(SNAPCRAFT)
add_subdirectory(snap)
......
#!/bin/bash
# Remmina - The GTK+ Remote Desktop Client
# Copyright (C) 2014-2017 Marco Trevisan
# Copyright (C) 2017-2018 Marco Trevisan
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -77,6 +77,9 @@ elif [ "$BUILD_TYPE" == "snap" ]; then
elif [ "$TRAVIS_BUILD_STEP" == "install" ]; then
docker_exec apt-get update -q
docker_exec apt-get install -y cmake git-core snapcraft
if [ "$SNAP_TRANSFER_SH_UPLOAD" == "true" ]; then
docker_exec apt-get install -y curl
fi
elif [ "$TRAVIS_BUILD_STEP" == "script" ]; then
git clean -f
cmake_buld_type="Release"
......@@ -106,15 +109,14 @@ elif [ "$BUILD_TYPE" == "snap" ]; then
fi
set -x
if [ "$TRAVIS_PULL_REQUEST" != "false" ] &&
[ "$SNAP_TRANSFER_SH_UPLOAD_ON_PULL_REQUEST" == "true" ]; then
docker_exec apt-get install -y curl
elif [ "$TRAVIS_BUILD_STEP" == "deploy-unstable" ]; then
if [ "$SNAP_TRANSFER_SH_UPLOAD" == "true" ]; then
docker_exec make snap-push-transfer.sh -C $BUILD_FOLDER
fi
elif [ "$TRAVIS_BUILD_STEP" == "deploy-unstable" ]; then
docker_exec make snap-push-$SNAP_UNSTABLE_CHANNEL -C $BUILD_FOLDER
elif [ "$TRAVIS_BUILD_STEP" == "deploy-release" ]; then
docker_exec make snap-push-$SNAP_RELEASE_CHANNEL -C $BUILD_FOLDER
if [ "$SNAP_TRANSFER_SH_UPLOAD" == "true" ]; then
docker_exec make snap-push-transfer.sh -C $BUILD_FOLDER
fi
fi
else
echo 'No $BUILD_TYPE defined'
......
# Remmina - The GTK+ Remote Desktop Client
#
# Copyright (C) 2017 Marco Trevisan
# Copyright (C) 2017-2018 Marco Trevisan
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -37,16 +37,15 @@ if(NOT ${GIT_REVISION} STREQUAL ${REMMINA_VERSION_SUFFIX} AND
set(SNAP_VERSION ${SNAP_VERSION}+git${GIT_REVISION})
endif()
set(SNAP_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(SNAP_SETUP_DIR ${SNAP_BUILD_DIR}/snap)
set(SNAP_GUI_DIR ${SNAP_SETUP_DIR}/gui)
set(SNAP_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SNAP_GUI_DIR ${SNAP_DIR}/gui)
file(MAKE_DIRECTORY ${SNAP_GUI_DIR})
file(RELATIVE_PATH CMAKE_SOURCE_DIR_RELATIVE ${SNAP_BUILD_DIR}
file(RELATIVE_PATH CMAKE_SOURCE_DIR_RELATIVE ${SNAP_DIR}
${CMAKE_SOURCE_DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/snapcraft.yaml.in
${SNAP_BUILD_DIR}/snapcraft.yaml @ONLY)
configure_file(${SNAP_DIR}/SNAP_VERSION.in
${SNAP_DIR}/SNAP_VERSION @ONLY)
set(REMMINA_BINARY_PATH "remmina")
set(REMMINA_ICON "\${SNAP}/meta/gui/icon.svg")
......@@ -54,29 +53,35 @@ configure_file(${CMAKE_SOURCE_DIR}/remmina/desktop/remmina.desktop.in
${SNAP_GUI_DIR}/${UNIQUE_APPNAME}.desktop @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/LICENSE
${SNAP_SETUP_DIR}/license.txt COPYONLY)
${SNAP_GUI_DIR}/license.txt COPYONLY)
add_custom_target("snap-version-script" ALL
DEPENDS "${SNAP_DIR}/SNAP_VERSION"
COMMENT "Preparing snap version file ${SNAP_VERSION}"
VERBATIM
)
add_custom_target("snap-prime"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
COMMAND ${SNAPCRAFT} prime
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/snapcraft.yaml"
DEPENDS "${SNAP_DIR}/SNAP_VERSION"
COMMENT "Priming snap package ${SNAP_VERSION}"
VERBATIM
)
add_custom_target("snap"
COMMAND ${SNAPCRAFT}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/snapcraft.yaml"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
DEPENDS "${SNAP_DIR}/SNAP_VERSION"
COMMENT "Create snap package ${SNAP_VERSION}"
VERBATIM
)
foreach(channel stable candidate beta edge)
add_custom_target("snap-push-${channel}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
COMMAND bash -c "${SNAPCRAFT} push --release ${channel} *.snap"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/snapcraft.yaml"
DEPENDS "${SNAP_DIR}/SNAP_VERSION"
COMMENT "Create snap package ${SNAP_VERSION}"
VERBATIM
)
......@@ -84,12 +89,12 @@ foreach(channel stable candidate beta edge)
endforeach()
add_custom_target("snap-push-transfer.sh"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
COMMAND bash -c "snap=$(ls *.snap -1 | head -n1); \
curl --upload-file $snap \
https://transfer.sh/$(basename $snap)"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/snapcraft.yaml"
COMMENT "Create snap package ${SNAP_VERSION}"
DEPENDS "${SNAP_DIR}/SNAP_VERSION"
COMMENT "Uploading snap package to transfer.sh ${SNAP_VERSION}"
VERBATIM
)
add_dependencies("snap-push-transfer.sh" "snap")
name: @SNAP_NAME@
version: @SNAP_VERSION@
name: remmina
version: git
version-script: cat parts/remmina/src/snap/SNAP_VERSION
# license: GPL-2.0-only
summary: The GTK+ Remote Desktop Client
icon: @CMAKE_SOURCE_DIR_RELATIVE@/remmina/desktop/scalable/apps/remmina.svg
icon: remmina/desktop/scalable/apps/remmina.svg
description: |
Remmina is a remote desktop client written in GTK+, aiming to be useful for
system administrators and travellers, who need to work with lots of remote
......@@ -44,7 +46,7 @@ parts:
- libxtst-dev
- libxv-dev
configflags:
- -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
- -DCMAKE_BUILD_TYPE=Release
- -DWITH_WAYLAND=on
- -DWITH_CLIENT=off
- -DWITH_SERVER=off
......@@ -60,7 +62,7 @@ parts:
# XXX: This is an hack to have a kind of bind-mount with absolute prefix.
- -DCMAKE_INSTALL_PREFIX=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr
organize:
snap/@SNAP_NAME@/current: .
snap/remmina/current: .
prime:
- -usr/include
......@@ -74,7 +76,7 @@ parts:
source-depth: 1
source-branch: v0-7
configflags:
- -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
- -DCMAKE_BUILD_TYPE=Release
- -DWITH_STATIC_LIB=ON
- -DWITH_GSSAPI=ON
- -DWITH_NACL=0
......@@ -82,14 +84,16 @@ parts:
# XXX: This is an hack to have a kind of bind-mount with absolute prefix.
- -DCMAKE_INSTALL_PREFIX=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr
organize:
snap/@SNAP_NAME@/current: .
snap/remmina/current: .
prime:
- ./**/libssh*.so.*
remmina:
plugin: cmake
source: @CMAKE_SOURCE_DIR_RELATIVE@
source: .
prepare:
cp -av $SNAPCRAFT_STAGE/../snap $SNAPCRAFT_PART_INSTALL/../src
stage-packages:
- xauth
build-packages:
......@@ -108,14 +112,14 @@ parts:
- libvte-2.91-dev
- libxkbfile-dev
configflags:
- -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_PREFIX_PATH=$SNAPCRAFT_STAGE/usr
- -DSNAP_BUILD=on
# XXX: This is an hack to have a kind of bind-mount with absolute prefix.
- -DCMAKE_INSTALL_PREFIX=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr
organize:
snap/@SNAP_NAME@/current: .
snap/remmina/current: .
after:
- libssh-0.7
......@@ -151,4 +155,4 @@ slots:
remmina-gapp:
interface: dbus
bus: session
name: @UNIQUE_APPNAME@
name: org.remmina.Remmina
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment