[MacSDK] Use full Mono version, incl. build number in build
authorAlexis Christoforides <alexis@thenull.net>
Mon, 13 Feb 2017 08:55:16 +0000 (03:55 -0500)
committerAlexis Christoforides <alexis@thenull.net>
Mon, 13 Feb 2017 11:35:02 +0000 (06:35 -0500)
Also add a VERSION file in the package.

packaging/MacSDK/mono.py
packaging/MacSDK/profile.py

index 63bf814d92302443e558043aafeea27c519c615b..ed9de8174840f455d66a849a89cb377b9086b268 100644 (file)
@@ -46,11 +46,16 @@ class MonoMasterPackage(Package):
         self.configure = './autogen.sh --prefix="%{package_prefix}"'
 
         self.extra_stage_files = ['etc/mono/config']
+        self.custom_version_str = None
 
     def build(self):
         self.make = '%s EXTERNAL_MCS=%s EXTERNAL_RUNTIME=%s' % (
             self.make, self.profile.env.system_mcs, self.profile.env.system_mono)
-        Package.build(self)
+        Package.configure(self)
+
+        if self.custom_version_str is not None:
+            replace_in_file(os.path.join (self.workspace, 'config.h'), {self.version : self.custom_version_str})
+        Package.make(self)
 
     def prep(self):
         Package.prep(self)
index 119678f9e7575bc876ce092d0e9ce4e6d26262e7..270b70d0254209b33c08d5fa6e50c003ba0d8fdf 100755 (executable)
@@ -119,6 +119,8 @@ class MonoReleaseProfile(DarwinProfile):
             error('Prefix %s exists, and may interfere with the staged build. Please remove and try again.' % self.prefix)
 
         self.calculate_updateid()
+
+        self.mono_package.custom_version_str = self.FULL_VERSION
         trace(self.package_info('MDK'))
 
         self.dont_optimize = ['pixman']
@@ -281,6 +283,10 @@ class MonoReleaseProfile(DarwinProfile):
             working_dir, "PKGROOT", self.prefix[1:], "updateinfo")
         with open(updateinfo, "w") as updateinfo:
             updateinfo.write(guid + ' ' + self.updateid + "\n")
+        version_file = os.path.join(
+            working_dir, "PKGROOT", self.prefix[1:], "VERSION")
+        with open(version_file, "w") as version_file:
+            version_file.write(self.FULL_VERSION + "\n")
 
     def package_info(self, pkg_type):
         arch = self.bockbuild.cmd_options.arch