summaryrefslogtreecommitdiff
path: root/devel/ice37/files/patch-scripts-Util.py
blob: f149c7f00d9a2f67b3acb5b2fb0c9469e43acb92 (plain) (blame)
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
--- scripts/Util.py.orig	2018-08-27 01:10:47 UTC
+++ scripts/Util.py
@@ -82,7 +82,7 @@ class Platform:
 
     def parseBuildVariables(self, variables):
         # Run make to get the values of the given variables
-        output = run('make print V="{0}"'.format(" ".join(variables.keys())), cwd = toplevel)
+        output = run('gmake print V="{0}"'.format(" ".join(variables.keys())), cwd = toplevel)
         for l in output.split("\n"):
             match = re.match(r'^.*:.*: (.*) = (.*)', l)
             if match and match.group(1):
@@ -199,6 +199,46 @@ class AIX(Platform):
     def hasOpenSSL(self):
         return True
 
+class FreeBSD(Platform):
+
+    def __init__(self):
+        Platform.__init__(self)
+
+    def getFilters(self, config):
+        filters = Platform.getFilters(self, config)
+        #filters = (filters[0], filters[1] + ["Slice/*"])
+        return filters
+
+    def hasOpenSSL(self):
+        return True
+
+    def getBinSubDir(self, mapping, process, current):
+        buildPlatform = current.driver.configs[mapping].buildPlatform
+        return "bin"
+
+    def getLibSubDir(self, mapping, process, current):
+        buildPlatform = current.driver.configs[mapping].buildPlatform
+
+        # PHP module is always installed in the lib directory for the default build platform
+        if isinstance(mapping, PhpMapping) and buildPlatform == self.getDefaultBuildPlatform():
+            return "lib"
+        return "lib"
+
+    def getBuildSubDir(self, name, current):
+        return os.path.join("build", current.config.buildPlatform, current.config.buildConfig)
+
+    def getSliceDir(self, iceDir):
+        return os.path.join(iceDir, "slice")
+
+    def getDefaultExe(self, name, config):
+        if name == "icebox":
+            if config.cpp11:
+                name += "++11"
+        return name
+
+    def canRun(self, mapping, current):
+        return Platform.canRun(self, mapping, current)
+
 class Linux(Platform):
 
     def __init__(self):
@@ -434,6 +474,8 @@ if sys.platform == "darwin":
     platform = Darwin()
 elif sys.platform.startswith("aix"):
     platform = AIX()
+elif sys.platform.startswith("freebsd"):
+    platform = FreeBSD()
 elif sys.platform.startswith("linux") or sys.platform.startswith("gnukfreebsd"):
     platform = Linux()
 elif sys.platform == "win32" or sys.platform[:6] == "cygwin":
@@ -1333,8 +1375,8 @@ class SliceTranslator(ProcessFromBinDir,
                 return translator + " " + args if args else translator
             elif isinstance(platform, Windows):
                 return os.path.join(os.path.dirname(sys.executable), "Scripts", "slice2py.exe")
-            elif os.path.exists("/usr/local/bin/slice2py"):
-                return "/usr/local/bin/slice2py"
+            elif os.path.exists("%%LOCALBASE%%/bin/slice2py"):
+                return "%%LOCALBASE%%/bin/slice2py " + args if args else "%%LOCALBASE%%/bin/slice2py "
             else:
                 import slice2py
                 return sys.executable + " " + os.path.normpath(