Do not hardcode paths.

This commit is contained in:
ajacoutot 2010-04-30 09:32:01 +00:00
parent ae657388b2
commit ad192253a9
3 changed files with 46 additions and 1 deletions

View File

@ -1,9 +1,10 @@
# $OpenBSD: Makefile,v 1.14 2010/04/22 16:29:49 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.15 2010/04/30 09:32:01 ajacoutot Exp $
COMMENT= implementation of the Freedesktop sound theme spec.
V= 0.24
DISTNAME= libcanberra-${V}
PKGNAME= ${DISTNAME}p0
SHARED_LIBS += canberra 2.0 # .2.1
SHARED_LIBS += canberra-gtk 1.0 # .1.2
@ -66,6 +67,8 @@ CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
pre-configure:
cp ${FILESDIR}/sndio.c ${WRKSRC}/src
${SUBST_CMD} ${WRKSRC}/src/sound-theme-spec.c \
${WRKSRC}/src/test-canberra.c
cd ${WRKSRC} && env AUTOCONF_VERSION=${AUTOCONF_VERSION} \
AUTOMAKE_VERSION=${AUTOMAKE_VERSION} aclocal -I m4
cd ${WRKSRC} && env AUTOCONF_VERSION=${AUTOCONF_VERSION} \

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_sound-theme-spec_c,v 1.1 2010/04/30 09:32:01 ajacoutot Exp $
--- src/sound-theme-spec.c.orig Fri Apr 30 11:11:52 2010
+++ src/sound-theme-spec.c Fri Apr 30 11:12:14 2010
@@ -321,7 +321,7 @@ const char *ca_get_data_dirs(void) {
const char *g;
if (!(g = getenv("XDG_DATA_DIRS")) || *g == 0)
- return "/usr/local/share:/usr/share";
+ return "${LOCALBASE}/share:/usr/share";
return g;
}

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-src_test-canberra_c,v 1.1 2010/04/30 09:32:01 ajacoutot Exp $
--- src/test-canberra.c.orig Fri Apr 30 11:13:05 2010
+++ src/test-canberra.c Fri Apr 30 11:13:32 2010
@@ -61,7 +61,7 @@ int main(int argc, char *argv[]) {
/* Now trigger a sound event, the quick version */
ret = ca_context_play(c, 0,
CA_PROP_EVENT_ID, "desktop-login",
- CA_PROP_MEDIA_FILENAME, "/usr/share/sounds/bar.wav",
+ CA_PROP_MEDIA_FILENAME, "${LOCALBASE}/share/sounds/bar.wav",
CA_PROP_MEDIA_NAME, "User has logged off from session",
CA_PROP_MEDIA_LANGUAGE, "en_EN",
CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
@@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
/* Now trigger a sound event, the complex version */
ca_proplist_create(&p);
ca_proplist_sets(p, CA_PROP_EVENT_ID, "desktop-logout");
- ca_proplist_sets(p, CA_PROP_MEDIA_FILENAME, "/usr/share/sounds/uxknkurz.wav");
+ ca_proplist_sets(p, CA_PROP_MEDIA_FILENAME, "${LOCALBASE}/share/sounds/uxknkurz.wav");
ca_proplist_sets(p, CA_PROP_MEDIA_NAME, "New email received");
ca_proplist_setf(p, "test.foo", "%u", 4711);
ret = ca_context_play_full(c, 1, p, callback, (void*) 0x4711);
@@ -80,7 +80,7 @@ int main(int argc, char *argv[]) {
/* Now trigger a sound event, by filename */
ret = ca_context_play(c, 2,
- CA_PROP_MEDIA_FILENAME, "/usr/share/sounds/freedesktop/stereo/audio-channel-front-left.ogg",
+ CA_PROP_MEDIA_FILENAME, "${LOCALBASE}/share/sounds/freedesktop/stereo/audio-channel-front-left.ogg",
CA_PROP_MEDIA_NAME, "Front Left",
CA_PROP_MEDIA_LANGUAGE, "en_EN",
NULL);