• Description
  • Patches
id

2

publisher

goffi@goffi.org/d2c160f2-e949-4430-991b-ebdefbe78794

title
Libervia: New setup.py compatible with archlinux PKGBUILD.
author
Jnanar
created
2017-12-24T08:33:22Z
updated
2018-06-22T12:54:46Z
labels
status
closed
body

This file define a new variable: ENV_LIBERVIA_INSTALL which is empty 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.

comments_uri
xmpp:pubsub.goffi.org?;node=urn%3Axmpp%3Amicroblog%3A0%3Acomments%2Forg.salut-a-toi.merge_requests%3A0_AcYNnqV3Zrf3Y83g3jMUVG

Click to reduce…

Hi, sorry for the late reply and thanks for your merge request. ENV_LIBERVIA_INSTALL is a constant and should not be use elsewhere than for install_opt = os.environ.get(ENV_LIBERVIA_INSTALL, "").split() I can't merge this request with this. Actually the issue you want to solve is the import of libervia at the top which is indeed a problem. I'll check that, please contact me on the MUC room when possible.

Click to expand… Click to reduce…

Click to reduce…

not relevant anymore, closing

Click to expand… Click to reduce…

You are not logged. You need to log in to comment.

Arnaud Joset

Libervia: New setup.py compatible with archlinux PKGBUILD. This file define a new variable: ENV_LIBERVIA_INSTALL which is empty 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,14 @@
         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
+        if ENV_LIBERVIA_INSTALL:
+            os.symlink(os.path.dirname(libervia.__file__), os.path.join(tmp_dir,"libervia")) # FIXME: only work on unixes
+        else:
+            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 +172,8 @@
             return
         self.copy_data_files()
         self.custom_auto_options()
-        self.custom_create_links()
+        if ENV_LIBERVIA_INSTALL:
+            self.custom_create_links()
 
     def confirm(self, message):
         """Ask the user for a confirmation"""
@@ -279,6 +284,7 @@
     install_opt = os.environ.get(ENV_LIBERVIA_INSTALL, "").split()
     if not NO_PREINSTALL_OPT in install_opt:  # user can force preinstall skipping
         preinstall_check(install_opt)
+    ENV_LIBERVIA_INSTALL=install_opt
 
 setup(name=NAME,
       version='0.6.1.1',
@@ -302,6 +308,6 @@
                   for root, dirs, files in os.walk(C.THEMES_DIR)],
       scripts=[],
       zip_safe=False,
-      install_requires=['sat', 'twisted', 'txJSON-RPC==0.3.1', 'zope.interface', 'pyopenssl', 'jinja2', 'shortuuid'],
+      install_requires=['sat', 'twisted', 'txJSON-RPC<5', 'zope.interface', 'pyopenssl', 'jinja2', 'shortuuid'],
       cmdclass={'install': CustomInstall},
       )