]> git.pld-linux.org Git - packages/openttd.git/blob - openttd-home_etc.patch
- up to 1.11.1
[packages/openttd.git] / openttd-home_etc.patch
1 diff -dur -x '*.orig' -x '*.rej' -x '*~' openttd-1.4.0.orig/config.lib openttd-1.4.0/config.lib
2 --- openttd-1.4.0.orig/config.lib       2014-04-01 20:37:07.000000000 +0200
3 +++ openttd-1.4.0/config.lib    2014-04-08 19:28:02.013554008 +0200
4 @@ -69,6 +69,7 @@
5         with_allegro="1"
6         with_sdl="1"
7         with_cocoa="1"
8 +       with_home_etc="1"
9         with_zlib="1"
10         with_lzma="1"
11         with_lzo2="1"
12 @@ -144,6 +145,7 @@
13                 with_allegro
14                 with_sdl
15                 with_cocoa
16 +               with_home_etc
17                 with_zlib
18                 with_lzma
19                 with_lzo2
20 @@ -333,6 +335,9 @@
21                         --without-cocoa)              with_cocoa="0";;
22                         --with-cocoa=*)               with_cocoa="$optarg";;
23  
24 +                       --with-home-etc)              with_home_etc="1";;
25 +                       --without-home-etc)           with_home_etc="0";;
26 +
27                         --with-zlib)                  with_zlib="2";;
28                         --without-zlib)               with_zlib="0";;
29                         --with-zlib=*)                with_zlib="$optarg";;
30 @@ -1651,6 +1656,11 @@
31                 fi
32         fi
33  
34 +       if [ "$with_home_etc" != 0 ]; then
35 +               CFLAGS="$CFLAGS -DWITH_HOME_ETC"
36 +               LIBS="$LIBS -lhome_etc"
37 +       fi
38 +
39         if [ "$with_zlib" != "0" ]; then
40                 if [ "$enable_static" != "0" ] && [ "$os" != "OSX" ]; then
41                         LIBS="$LIBS $zlib"
42 diff -dur -x '*.orig' -x '*.rej' -x '*~' openttd-1.4.0.orig/src/fileio.cpp openttd-1.4.0/src/fileio.cpp
43 --- openttd-1.4.0.orig/src/fileio.cpp   2014-04-01 20:37:03.000000000 +0200
44 +++ openttd-1.4.0/src/fileio.cpp        2014-04-08 19:30:30.296888687 +0200
45 @@ -32,6 +32,10 @@
46  #include "basedir.h"
47  #endif
48  
49 +#ifdef HOME_ETC
50 +#include <home_etc.h>
51 +#endif
52 +
53  /** Size of the #Fio data buffer. */
54  #define FIO_BUFFER_SIZE 512
55  
56 @@ -1103,7 +1107,11 @@
57          * or at least before something else touches the environment
58          * variables in any way. It can also contain all kinds of
59          * unvalidated data we rather not want internally. */
60 +#ifdef HOME_ETC
61 +       const char *homedir = _HEdir;
62 +#else
63         const char *homedir = getenv("HOME");
64 +#endif
65         if (homedir != NULL) {
66                 homedir = strndup(homedir, MAX_PATH);
67         }
This page took 0.085237 seconds and 3 git commands to generate.