Commit 3742aff3 authored by Giovanni Panozzo's avatar Giovanni Panozzo Committed by GitHub

Merge pull request #1200 from dfiloni/next

Fix snap issues
parents 49dc000f 45060975
......@@ -160,6 +160,10 @@ if(SNAP_BUILD_ONLY)
return()
endif()
if(SNAP_BUILD)
add_definitions(-DSNAP_BUILD)
endif()
# Uninstall support
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
......
......@@ -356,7 +356,11 @@ static void remmina_file_editor_create_ssh_privatekey(RemminaFileEditor* gfe, Gt
NULL);
widget = gtk_file_chooser_button_new_with_dialog (dialog);
#ifdef SNAP_BUILD
s = g_strdup_printf("%s/.ssh", g_getenv ("SNAP_USER_COMMON"));
#else
s = g_strdup_printf("%s/.ssh", g_get_home_dir ());
#endif
if (g_file_test (s, G_FILE_TEST_IS_DIR))
{
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (widget), s);
......
......@@ -464,6 +464,9 @@ remmina_ssh_init_session (RemminaSSH *ssh)
ssh_options_set (ssh->session, SSH_OPTIONS_HOST, ssh->server);
ssh_options_set (ssh->session, SSH_OPTIONS_PORT, &ssh->port);
ssh_options_set (ssh->session, SSH_OPTIONS_USER, ssh->user);
#ifdef SNAP_BUILD
ssh_options_set (ssh->session, SSH_OPTIONS_SSH_DIR, g_strdup_printf ("%s/.ssh", g_getenv ("SNAP_USER_COMMON")));
#endif
ssh_callbacks_init(ssh->callback);
if (remmina_log_running ())
......
......@@ -71,7 +71,9 @@ elif [ "$BUILD_TYPE" == "snap" ]; then
if [ "$TRAVIS_BUILD_STEP" == "before_install" ]; then
if [ -n "$ARCH" ]; then DOCKER_IMAGE="$ARCH/$DOCKER_IMAGE"; fi
docker run --name $DOCKER_BUILDER_NAME -v $PWD:$PWD -w $PWD -td $DOCKER_IMAGE
docker run --name $DOCKER_BUILDER_NAME \
-e LC_ALL=C.UTF-8 -e LANG=C.UTF-8 \
-v $PWD:$PWD -w $PWD -td $DOCKER_IMAGE
elif [ "$TRAVIS_BUILD_STEP" == "install" ]; then
docker_exec apt-get update -q
docker_exec apt-get install -y cmake git-core snapcraft
......
......@@ -45,7 +45,6 @@ parts:
- libxv-dev
configflags:
- -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
- -DCMAKE_INSTALL_PREFIX=/usr
- -DWITH_WAYLAND=off
- -DWITH_CLIENT=off
- -DWITH_SERVER=off
......@@ -58,6 +57,11 @@ parts:
- -DWITH_PCSC=on
- -DWITH_JPEG=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: .
prime:
- -usr/include
- -usr/lib/cmake
......@@ -71,11 +75,15 @@ parts:
source-branch: v0-7
configflags:
- -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
- -DCMAKE_INSTALL_PREFIX=/usr
- -DWITH_STATIC_LIB=ON
- -DWITH_GSSAPI=ON
- -DWITH_NACL=0
# 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: .
prime:
- ./**/libssh*.so.*
......@@ -99,50 +107,23 @@ parts:
- libxkbfile-dev
configflags:
- -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
- -DCMAKE_INSTALL_PREFIX=/usr
- -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: .
after:
- libssh-0.7
- freerdp
- desktop-gtk3
- indicator-gtk3
- snapcraft-preload
snapcraft-preload:
source: https://github.com/3v1n0/snapcraft-preload.git
source-branch: getpwd-support
plugin: cmake
build-packages:
- gcc-multilib
- g++-multilib
desktop-gtk3:
install: |
set -x
export XDG_DATA_DIRS=$SNAPCRAFT_PART_INSTALL/usr/share:$XDG_DATA_DIRS
$SNAPCRAFT_PART_INSTALL/usr/bin/update-mime-database $SNAPCRAFT_PART_INSTALL/usr/share/mime
$SNAPCRAFT_PART_INSTALL/usr/bin/gio-querymodules $SNAPCRAFT_PART_INSTALL/usr/lib/*/gio/modules
$SNAPCRAFT_PART_INSTALL/usr/bin/glib-compile-schemas $SNAPCRAFT_PART_INSTALL/usr/share/glib-2.0/schemas
loaders_dir=$(ls -d $SNAPCRAFT_PART_INSTALL/usr/lib/*/gdk-pixbuf-2.0/[0-9]*)
export GDK_PIXBUF_MODULEDIR=$loaders_dir/loaders
$SNAPCRAFT_PART_INSTALL/usr/lib/*/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders > $loaders_dir/loaders.cache
sed -i s,$SNAPCRAFT_PART_INSTALL,,g $loaders_dir/loaders.cache
for theme_dir in $SNAPCRAFT_PART_INSTALL/usr/share/icons/*; do
if [ -f $SNAPCRAFT_PART_INSTALL/usr/sbin/update-icon-caches ]; then
$SNAPCRAFT_PART_INSTALL/usr/sbin/update-icon-caches "$theme_dir"
fi
if [ -f $SNAPCRAFT_PART_INSTALL/usr/sbin/update-icon-cache.gtk2 ]; then
$SNAPCRAFT_PART_INSTALL/usr/sbin/update-icon-cache.gtk2 "$theme_dir"
fi
done
after:
- remmina
apps:
remmina:
command: snapcraft-preload remmina
command: desktop-launch remmina
plugs:
- avahi-observe
- cups-control
......@@ -155,10 +136,10 @@ apps:
- unity7
winpr-makecert:
command: snapcraft-preload winpr-makecert
command: winpr-makecert
winpr-hash:
command: snapcraft-preload winpr-hash
command: winpr-hash
slots:
remmina-gapp:
......
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