-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.sh
33 lines (29 loc) · 1.09 KB
/
env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#
# Set the pkg-config environment. This script should only be sourced if you installed
# Tomboy in a non-standard location (via the --prefix argument to configure).
# Set this to the *parent* of the prefix where you installed tomboy. For example,
# if your prefix is /usr/local then this should be "/usr". (Although I myself prefer
# /usr/local/software/tomboy because I like to use GNU stow.)
tomboy_prefix_parent='/usr/local/software'
if [ $(basename "$0") = 'env.sh' ]; then
echo "This program should be sourced, not run standalone" >&2
exit 1
fi
# Maybe it's already here.
if pkg-config --exists tomboy-addins; then
echo "Environment is okay. Using: `pkg-config --variable=prefix tomboy-addins`"
else
# Otherwise, search for it.
for app in $(find "$tomboy_prefix_parent" -type d -wholename '*/lib/pkgconfig' 2> /dev/null); do
new_path="$app:$PKG_CONFIG_PATH"
if env PKG_CONFIG_PATH="$new_path" pkg-config --exists tomboy-addins; then
echo "Found Tomboy: $app"
export PKG_CONFIG_PATH="$new_path"
break
else
echo "no: $app"
fi
done
fi
# vim: sts=0 ts=8 sw=8 noet