Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
env: set XDG_DATA_DIRS for wayland et.al. #3398
Merged
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
30600db
env: set XDG_DATA_DIRS for wayland et.al.
sergiusens 68ec10b
Merge branch 'master' into xdg-for-more-than-x
chipaca 2f55619
packaging: unify PATH and XDG_DATA_DIRS handling cross-distro
chipaca 7900701
Merge remote-tracking branch 'origin/master'
chipaca a7c0192
Merge branch 'master' into xdg-for-more-than-x
chipaca b38f8e4
dropping etc entirely (should now be unneeded)
chipaca 67b6ba2
Fix 14.04 (thank you spread), address review feedback (thank you mvo)
chipaca 4217778
fixed issue where I was misusing snapd.install
chipaca
Jump to file or symbol
Failed to load files and symbols.
| @@ -1,3 +1,4 @@ | ||
| all install clean: | ||
| $(MAKE) -C systemd $@ | ||
| $(MAKE) -C dbus $@ | ||
| + $(MAKE) -C env $@ |
| @@ -0,0 +1,37 @@ | ||
| +# | ||
| +# Copyright (C) 2017 Canonical Ltd | ||
| +# | ||
| +# This program is free software: you can redistribute it and/or modify | ||
| +# it under the terms of the GNU General Public License version 3 as | ||
| +# published by the Free Software Foundation. | ||
| +# | ||
| +# This program is distributed in the hope that it will be useful, | ||
| +# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| +# GNU General Public License for more details. | ||
| +# | ||
| +# You should have received a copy of the GNU General Public License | ||
| +# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| + | ||
| +SNAP_MOUNT_DIR := /snap | ||
| +ENVD := /etc/profile.d | ||
| + | ||
| +%.sh: %.sh.in | ||
| + sed < $< > $@ \ | ||
| + s:@SNAP_MOUNT_DIR@:${SNAP_MOUNT_DIR}:g | ||
| + | ||
| +GENERATED = snapd.sh | ||
| + | ||
| + | ||
| +all: ${GENERATED} | ||
| +.PHONY: all | ||
| + | ||
| +install: ${GENERATED} | ||
| + # NOTE: old (e.g. 14.04) GNU coreutils doesn't -D with -t | ||
| + install -d -m 0755 ${DESTDIR}/${ENVD} | ||
| + install -m 0644 -t ${DESTDIR}/${ENVD} $^ | ||
| +.PHONY: install | ||
| + | ||
| +clean: | ||
| + $(RM) ${GENERATED} | ||
| +.PHONY: clean |
| @@ -0,0 +1,14 @@ | ||
| +#!/bin/sh --this-shebang-is-just-here-to-inform-shellcheck-- | ||
| + | ||
| +# Expand $PATH to include the directory where snappy applications go. | ||
| +if [ "${PATH#*/snap/bin}" = "${PATH}" ]; then | ||
| + export PATH=$PATH:@SNAP_MOUNT_DIR@/bin | ||
| +fi | ||
| + | ||
| +# desktop files (used by desktop environments within both X11 and Wayland) are | ||
| +# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for | ||
| +# snappy applications' desktop files. | ||
| +if [ "${XDG_DATA_DIRS#*/snapd/desktop}" = "${XDG_DATA_DIRS}" ]; then | ||
| + export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}:/var/lib/snapd/desktop" | ||
| +fi | ||
| + |
| @@ -1,12 +0,0 @@ | ||
| -# This file is sourced by Xsession(5), not executed. | ||
| -# Add the additional snappy desktop path | ||
| - | ||
| -if [ -z "$XDG_DATA_DIRS" ]; then | ||
| - # 60x11-common_xdg_path does not always set XDG_DATA_DIRS | ||
| - # so we ensure we have sensible defaults here (LP: #1575014) | ||
| - # as a workaround | ||
| - XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/var/lib/snapd/desktop | ||
| -else | ||
| - XDG_DATA_DIRS="$XDG_DATA_DIRS":/var/lib/snapd/desktop | ||
| -fi | ||
| -export XDG_DATA_DIRS |
| @@ -1,3 +0,0 @@ | ||
| -# Expand the $PATH to include /snap/bin which is what snappy applications | ||
| -# use | ||
| -PATH=$PATH:/snap/bin |
| @@ -1,10 +0,0 @@ | ||
| -# Expand the $PATH to include /snaps/bin which is what snappy applications | ||
| -# use | ||
| -PATH=$PATH:/var/lib/snapd/snap/bin | ||
| - | ||
| -if [ -z "$XDG_DATA_DIRS" ]; then | ||
| - XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/var/lib/snapd/desktop | ||
| -else | ||
| - XDG_DATA_DIRS="$XDG_DATA_DIRS":/var/lib/snapd/desktop | ||
| -fi | ||
| -export XDG_DATA_DIRS |
| @@ -1,10 +0,0 @@ | ||
| -[Unit] | ||
|
|
||
| -Description=Auto import assertions from block devices | ||
| -After=snapd.service snapd.socket | ||
| - | ||
| -[Service] | ||
| -Type=oneshot | ||
| -ExecStart=/usr/bin/snap auto-import | ||
| - | ||
| -[Install] | ||
| -WantedBy=multi-user.target | ||
Oops, something went wrong.
mvo5Aug 29, 2017
Collaborator