File: module-layout.patch

package info (click to toggle)
pike8.0 8.0.1956-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 60,580 kB
  • sloc: ansic: 259,734; xml: 36,320; makefile: 3,747; sh: 1,713; cpp: 1,349; awk: 1,036; lisp: 655; javascript: 468; asm: 242; objc: 240; pascal: 157; sed: 34
file content (85 lines) | stat: -rw-r--r-- 3,431 bytes parent folder | download | duplicates (4)
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
80
81
82
83
84
85
Author: Magnus Holmgren <holmgren@debian.org>
Description: Add local site-pike directories to master.pike.in

--- a/lib/master.pike.in
+++ b/lib/master.pike.in
@@ -1878,6 +1878,10 @@ protected void create()
   add_module_path("#lib_prefix#/modules");
 #endif
 
+  // Debian paths
+  add_include_path("/usr/local/lib/pike"+__REAL_MAJOR__+"."+__REAL_MINOR__+"/include");
+  add_module_path("/usr/local/lib/pike"+__REAL_MAJOR__+"."+__REAL_MINOR__+"/modules");
+
 #if "#cflags# "[0]!='#'
   cflags = "#cflags#";
 #endif
--- a/lib/modules/Tools.pmod/Standalone.pmod/module.pike
+++ b/lib/modules/Tools.pmod/Standalone.pmod/module.pike
@@ -23,9 +23,8 @@ string bin_path=include_path;
 // this is not the ideal location for all systems, but it's a start.
 string local_module_path=combine_path(getenv("HOME")||"","lib/pike/modules");
 bool old_style_module = false;
-// we prefer the last element, because if there are more than one
-// master() puts the lib/modules path last.
-string system_module_path=master()->system_module_path[-1];
+
+string system_module_path="/usr/local/lib/pike"+__REAL_MAJOR__+"."+__REAL_MINOR__+"/modules";
 
 // where do we install the documentation?
 string system_doc_path = master()->doc_prefix;
@@ -182,7 +181,7 @@ void do_make(array(string) cmd)
     extra_args = ({
       "PIKE="+run_pike,
       "SRCDIR="+fix("$src"),
-      "MODULE_INSTALL_DIR="+combine_path(__FILE__,"../../.."),
+      "MODULE_INSTALL_DIR="+system_module_path,
       "LOCAL_MODULE_PATH=" + lmp,
     });
   }
@@ -239,6 +238,7 @@ int main(int argc, array(string) argv)
     ({"all",Getopt.NO_ARG,({"--all"}) }),
     ({"make",Getopt.NO_ARG,({"--make"}) }),
     ({"auto",Getopt.NO_ARG,({"--auto"}) }),
+    ({"debian",Getopt.NO_ARG,({"--debian"}) }),
     ({"source",Getopt.HAS_ARG,({"--source"}) }),
     ({"query",Getopt.HAS_ARG,({"--query"}) }),
     ({"config_args",Getopt.HAS_ARG,({"--configure-args"}) }),
@@ -275,6 +275,9 @@ int main(int argc, array(string) argv)
 	case "auto":
 	  run->depend=run->autoheader=run->autoconf=run->configure=run->make=AUTO;
 	  break;
+
+	case "debian":
+	  system_module_path=master()->system_module_path[-1];
       }
     }
 
@@ -419,7 +422,7 @@ int main(int argc, array(string) argv)
 	  run_or_fail( ([ "env":getenv()|
 			  ([
 			    "PIKE":run_pike,
-			    "MODULE_INSTALL_DIR":combine_path(__FILE__,"../../.."),
+			    "MODULE_INSTALL_DIR":system_module_path,
 			    "LOCAL_MODULE_PATH":local_module_path,
 			  ])
 		       ]),
--- a/src/modules/dynamic_module_makefile.in
+++ b/src/modules/dynamic_module_makefile.in
@@ -86,13 +86,13 @@ $(OBJS): propagated_variables
 #
 install: $(MODULE_INSTALL)
 	@if test "x$(OBJS)" != "x" ; then \
-	  $(TMP_BINDIR)/install_module module.so $(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODULE_WRAPPER_PREFIX)$(MODNAME).so && \
+	  $(TMP_BINDIR)/install_module module.so $(DESTDIR)$(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODULE_WRAPPER_PREFIX)$(MODNAME).so && \
 	  if [ -f $(MODNAME).pdb ]; then \
-	    cp $(MODNAME).pdb $(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODULE_WRAPPER_PREFIX); \
+	    cp $(MODNAME).pdb $(DESTDIR)$(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODULE_WRAPPER_PREFIX); \
 	  else :; fi; \
 	fi; \
 	if test "x$(MODULE_PMOD_IN)" != "x"; then \
-	  $(TMP_BINDIR)/install_module module.pmod $(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODNAME).pmod ;\
+	  $(TMP_BINDIR)/install_module module.pmod $(DESTDIR)$(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODNAME).pmod ;\
 	fi;
 
 #