Control: tags -1 patch

I have created a better patch for setup.py that allows you pass a
--packaging option to setup.py to hardwire the resource path to
/usr/share when the build happens in a temporary directory.

Without the option, the resource path is automatically calculated as
normal for local installs.

Hopefully this patch can be included upstream (because the previous
patch was not suitable for a local install).

Cheers,

Ross
From: Ross Gammon <rossgam...@mail.dk>
Date: Fri, 5 Sep 2014 22:51:07 +0200
Subject: Correct resource path in setup.py when packaging
 Based on a recommendation on the Gramps wiki. Added a --packaging
 option to setup.py so that the resource patch is correctly set up
 when the build path is different from the installed location (i.e.
 when packaging).

* setup.py: Hardwire path to /usr/share when packaging

Origin: upstream wiki, https://www.gramps-project.org/wiki/index.php?title=Debian
--- gramps.orig/setup.py
+++ gramps/setup.py
@@ -59,6 +59,11 @@
     sys.argv.remove('--server')
     server = True
 
+packaging = False
+if '--packaging' in sys.argv:
+    sys.argv.remove('--packaging')
+    packaging = True
+
 def intltool_version():
     '''
     Return the version of intltool as a tuple.
@@ -247,7 +252,10 @@
                                      'utils', 'resource-path')
         with io.open(resource_file, 'w', encoding='utf-8',
                      errors='strict') as fp:
-            path = os.path.abspath(os.path.join(self.install_data, 'share'))
+            if packaging:
+                path = '/usr/share'
+            else:
+                path = os.path.abspath(os.path.join(self.install_data, 'share'))
             if sys.version_info[0] < 3:
                 path = unicode(path)
             fp.write(path)

Reply via email to