libxine: update to version 1.1.19
[openembedded.git] / recipes / kobodeluxe / files / kobodeluxe-sysconf-support.patch
blob1f62b31d71909a4fdd0bbf74d9d8ccec95b155b2
1 Index: KoboDeluxe-0.5.1/configure.in
2 ===================================================================
3 --- KoboDeluxe-0.5.1.orig/configure.in 2008-02-10 20:51:37.000000000 +0100
4 +++ KoboDeluxe-0.5.1/configure.in 2008-02-10 21:40:09.000000000 +0100
5 @@ -36,6 +36,7 @@
6 SCOREDIR='$(sharedstatedir)/kobo-deluxe/scores'
7 CONFIGDIR='HOME>>'
8 CONFIGFILE='.kobodlrc'
9 +USE_SYSCONF=1
10 EXEFILE=kobodl
11 case "$target_os" in
12 linux*)
13 @@ -57,6 +58,7 @@
14 SCOREDIR='EXE>>scores'
15 CONFIGDIR='EXE>>'
16 CONFIGFILE='kobodl.cfg'
17 + USE_SYSCONF=0
18 EXEFILE=kobodl.exe
19 MATHLIB=""
21 @@ -68,6 +70,7 @@
22 SCOREDIR='EXE>>scores'
23 CONFIGDIR='EXE>>'
24 CONFIGFILE='kobodl.cfg'
25 + USE_SYSCONF=0
26 EXEFILE=kobodl.exe
27 MATHLIB=""
29 @@ -105,10 +108,12 @@
30 AM_CONDITIONAL(BUILD_MACOSX_BUNDLE, test x$build_macosx_bundle = xyes)
31 AM_CONDITIONAL(BUILD_SIMPLE_BUNDLE, test x$build_simple_bundle = xyes)
32 AM_CONDITIONAL(UNIX_SCOREDIR, test x$unix_scoredir = xyes)
33 +AC_DEFINE_UNQUOTED([USE_SYSCONF], [$USE_SYSCONF], [Define to 1 to use Unix-style sysconf dir for default configuration.])
34 AC_SUBST(DATADIR)
35 AC_SUBST(SCOREDIR)
36 AC_SUBST(CONFIGDIR)
37 AC_SUBST(CONFIGFILE)
38 +AC_SUBST(KOBO_SYSCONF)
39 AC_SUBST(EXEFILE)
40 AC_SUBST(MATHLIB)
42 Index: KoboDeluxe-0.5.1/kobo.cpp
43 ===================================================================
44 --- KoboDeluxe-0.5.1.orig/kobo.cpp 2008-02-10 20:57:32.000000000 +0100
45 +++ KoboDeluxe-0.5.1/kobo.cpp 2008-02-10 21:27:22.000000000 +0100
46 @@ -1293,9 +1293,38 @@
47 FILE *f = fmap->fopen(KOBO_CONFIG_DIR "/" KOBO_CONFIG_FILE, "r");
48 if(f)
50 + log_puts(VLOG, "Loading personal configuration from: "\
51 + KOBO_CONFIG_DIR "/" KOBO_CONFIG_FILE "\n");
52 p->read(f);
53 fclose(f);
55 +#if USE_SYSCONF
56 + /* On Unixen, where they have SYSCONF_DIR (usually /etc) try to get
57 + * the default configuration from a file stored there before
58 + * giving up.
59 + *
60 + * This gives packagers a chance to provide a proper default
61 + * (playable) configuration for all those little Linux-based
62 + * gadgets that are flying around.
63 + */
64 + else
65 + {
66 + f = fmap->fopen(SYSCONF_DIR "/kobo-deluxe/default-config", "r");
67 + if(f)
68 + {
69 + log_puts(VLOG, "Loading configuration defaults from: "\
70 + SYSCONF_DIR "/kobo-deluxe/default-config\n");
72 + p->read(f);
73 + fclose(f);
74 + }
75 + else
76 + log_puts(VLOG, "Using built-in configuration defaults.\n");
78 + }
79 +#else
80 + log_puts(VLOG, "Using built-in configuration defaults.\n");
81 +#endif