Commit 6007add3 authored by Colin Walters's avatar Colin Walters Committed by Craig Keogh

Install python2 symlink in ~/.local/bin when running on Debian

This hack allows all GNOME modules to use "python2" to find Python 2.

https://bugzilla.gnome.org/show_bug.cgi?id=687692
parent 31e9cff8
...@@ -37,3 +37,6 @@ bin_PROGRAMS = install-check ...@@ -37,3 +37,6 @@ bin_PROGRAMS = install-check
install_check_SOURCES = install-check.c install_check_SOURCES = install-check.c
install-exec-local:
$(srcdir)/scripts/debian-python2-postinstall-hook.sh $(DESTDIR)$(bindir)
...@@ -46,4 +46,6 @@ install: include-check install-check ...@@ -46,4 +46,6 @@ install: include-check install-check
ln -s $(bindir)/jhbuild "$(HOME)/bin/jhbuild" ; \ ln -s $(bindir)/jhbuild "$(HOME)/bin/jhbuild" ; \
fi fi
./scripts/debian-python2-postinstall-hook.sh $(bindir)
.PHONY: all update install .PHONY: all update install
EXTRA_DIST = hg-update.py jhbuild.in EXTRA_DIST = hg-update.py jhbuild.in debian-python2-postinstall-hook.sh
bin_SCRIPTS = jhbuild bin_SCRIPTS = jhbuild
CLEANFILES = jhbuild CLEANFILES = jhbuild
......
#!/bin/sh
# This awful bit of code is intended to ensure that
# modules we build with jhbuild can always use "python2"
# to find Python 2, even if the host system (e.g. Debian)
# doesn't have such a symbolic link.
#
# See: https://mail.gnome.org/archives/desktop-devel-list/2012-November/msg00011.html
set -e
bindir=$1
test -n "$bindir" || (echo "usage: $0 bindir"; exit 1)
py2=$(which python2 2>/dev/null || true)
if test -z "$py2"; then
py=$(which python 2>/dev/null);
ln -s "$(which python)" ${bindir}/python2;
fi
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