[meld] Install gschemas files



commit b4dc5ee93ff5b0a41b3b7c80df6c967f3f221a6e
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Dec 7 09:08:49 2013 +1000

    Install gschemas files

 MANIFEST.in           |    1 +
 meld/build_helpers.py |   24 ++++++++++++++++++++++++
 setup.py              |    1 +
 3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/MANIFEST.in b/MANIFEST.in
index 1a952a2..059cec2 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -11,3 +11,4 @@ include data/gtkrc
 include data/meld.appdata.xml.in
 include data/meld.desktop.in
 include data/mime/meld.xml.in
+include data/org.gnome.meld.gschema.xml
diff --git a/meld/build_helpers.py b/meld/build_helpers.py
index d5dd96a..c07b5a1 100644
--- a/meld/build_helpers.py
+++ b/meld/build_helpers.py
@@ -41,9 +41,33 @@ class build_extra(distutils.command.build.build):
         def has_i18n(command):
             return "build_i18n" in self.distribution.cmdclass
 
+        def has_data(command):
+            return "build_data" in self.distribution.cmdclass
+
         self.sub_commands.append(("build_i18n", has_i18n))
         self.sub_commands.append(("build_icons", has_icons))
         self.sub_commands.append(("build_help", has_help))
+        self.sub_commands.append(("build_data", has_data))
+
+
+class build_data(distutils.cmd.Command):
+
+    gschemas = [
+        ('share/glib-2.0/schemas/', ['data/org.gnome.meld.gschema.xml'])
+    ]
+
+    def initialize_options(self):
+        pass
+
+    def finalize_options(self):
+        pass
+
+    def get_data_files(self):
+        return self.gschemas
+
+    def run(self):
+        data_files = self.distribution.data_files
+        data_files.extend(self.get_data_files())
 
 
 class build_help(distutils.cmd.Command):
diff --git a/setup.py b/setup.py
index 1afb492..1166f8e 100644
--- a/setup.py
+++ b/setup.py
@@ -45,5 +45,6 @@ setup(
         "build_i18n": meld.build_helpers.build_i18n,
         "build_help": meld.build_helpers.build_help,
         "build_icons": meld.build_helpers.build_icons,
+        "build_data": meld.build_helpers.build_data,
     }
 )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]