G

Libervia: New setup.py compatible with archlinux PKGBUILD. This file define a new variable: ENV_LIBERVIA_INSTALL which is equal to "arch" when libervia is installed

with PKGBUILD. This setup.py solves the following issues: * os.symlink(os.path.dirname(libervia.__file__), os.path.join(tmp_dir,"libervia")) fails with PKGBUILD because the module libervia is not accessible. * self.custom_create_links() fails with PKGBUILD because the permissions of bin directory is read-only.
G

goffi 22/06/2018, 12:41

no relevant anymore (check with jnanar), closing.

id

4

author

Jnanar

created

2018-04-02T08:42:22Z

updated

2018-06-22T12:42:04Z

labels
libervia
status
closed

Libervia: New setup.py compatible with archlinux PKGBUILD. This file define a new variable: ENV_LIBERVIA_INSTALL which is equal to "arch" when libervia is installed with PKGBUILD. This setup.py solves the following issues: * os.symlink(os.path.dirname(libervia.__file__), os.path.join(tmp_dir,"libervia")) fails with PKGBUILD because the module libervia is not accessible. * self.custom_create_links() fails with PKGBUILD because the permissions of bin directory is read-only.

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -116,10 +116,11 @@
         os.chdir(os.path.join('src', 'browser'))
         # we must have only certain package in the path, so we create a tmp dir to link only what we need
         tmp_dir = tempfile.mkdtemp()
-        import sat, sat_frontends, libervia
+        import sat, sat_frontends
         os.symlink(os.path.dirname(sat.__file__), os.path.join(tmp_dir,"sat")) # FIXME: only work on unixes
         os.symlink(os.path.dirname(sat_frontends.__file__), os.path.join(tmp_dir,"sat_frontends")) # FIXME: only work on unixes
-        os.symlink(os.path.dirname(libervia.__file__), os.path.join(tmp_dir,"libervia")) # FIXME: only work on unixes
+        libervia_files = os.path.abspath("../../src")
+        os.symlink(libervia_files, os.path.join(tmp_dir,"libervia")) # FIXME: only work on unixes
         for module in ('libervia_main', 'libervia_test'):
             build_args = ['pyjsbuild', module] + (['-d'] if JS_DEBUG in install_opt else []) + ['--no-compile-inplace', '-I', tmp_dir, '-o', self.pyjamas_output_dir]
             result = subprocess.call(build_args)
@@ -168,7 +169,8 @@
             return
         self.copy_data_files()
         self.custom_auto_options()
-        self.custom_create_links()
+        if not "arch" in install_opt:
+            self.custom_create_links()
 
     def confirm(self, message):
         """Ask the user for a confirmation"""