summaryrefslogtreecommitdiff
blob: 190d304309a808962f4fa5b1fbe0031b4021ea32 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=38279

diff -ru xdg-user-dirs-0.14.orig/Makefile.am xdg-user-dirs-0.14/Makefile.am
--- xdg-user-dirs-0.14.orig/Makefile.am	2011-06-14 09:37:35 +0200
+++ xdg-user-dirs-0.14/Makefile.am	2011-06-14 09:36:42 +0200
@@ -16,7 +16,7 @@
 xdgdir=$(sysconfdir)/xdg
 xdg_DATA=user-dirs.conf user-dirs.defaults
 
-libraries = $(LIBINTL)
+libraries = $(LIBINTL) $(LIBICONV)
 
 bin_PROGRAMS =					\
 	xdg-user-dirs-update			\
diff -ru xdg-user-dirs-0.14.orig/configure.ac xdg-user-dirs-0.14/configure.ac
--- xdg-user-dirs-0.14.orig/configure.ac	2011-06-14 09:37:35 +0200
+++ xdg-user-dirs-0.14/configure.ac	2011-06-14 09:36:42 +0200
@@ -64,6 +64,8 @@
 else
 	AC_MSG_RESULT(no)
 fi
+
+AC_CHECK_FUNCS([strndup])
 			       
 AC_OUTPUT([ po/Makefile.in
 Makefile
diff -ru xdg-user-dirs-0.14.orig/xdg-user-dirs-update.c xdg-user-dirs-0.14/xdg-user-dirs-update.c
--- xdg-user-dirs-0.14.orig/xdg-user-dirs-update.c	2011-06-14 09:37:35 +0200
+++ xdg-user-dirs-0.14/xdg-user-dirs-update.c	2011-06-14 09:41:35 +0200
@@ -4,7 +4,9 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef HAVE_GETTEXT
 #include <libintl.h>
+#endif
 #include <locale.h>
 #include <pwd.h>
 #include <stdio.h>
@@ -360,7 +362,11 @@
 	}
 
       paths = realloc (paths, sizeof (char *) * (numfiles + 2));
+#ifdef HAVE_STRNDUP
       paths[numfiles++] = strndup (path, len);
+#else
+      paths[numfiles++] = strdup (path);
+#endif
       paths[numfiles] = NULL;
     }
 
@@ -848,7 +854,11 @@
       element_end = path;
 
       element_copy = strdup_end (element, element_end);
+#ifdef HAVE_GETTEXT
       translated = gettext (element_copy);
+#else
+      translated = element_copy;
+#endif
 
       res = realloc (res, strlen (res) + 1 + strlen (translated) + 1);
       if (has_slash)
@@ -1000,6 +1010,7 @@
   char *set_value = NULL;
   char *locale_dir = NULL;
   
+#ifdef HAVE_GETTEXT
   setlocale (LC_ALL, "");
   
   if (is_directory (LOCALEDIR))
@@ -1038,6 +1049,7 @@
 
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
+#endif
 
   force = 0;
   for (i = 1; i < argc; i++)