changeset 153:df75b62e653e

flatpak (build_manifest): some fixes needed after runtime update: - removed `--optimize=1` for lxml, as it is making the build fail - added build flag on x86_64 for Pillow (will need to be adapted if we build on other architectures) - added a module for Python 2.7.16, Python 2 not being included anymore in the runtime - DEFAULT_MANIFEST modules are put at the beginning of modules
author Goffi <goffi@goffi.org>
date Fri, 28 Jun 2019 15:19:47 +0200
parents 4dc8ed9ae4de
children cd411b0d1e19
files flatpak/build_manifest.py
diffstat 1 files changed, 43 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flatpak/build_manifest.py	Wed Jun 26 21:39:14 2019 +0200
+++ b/flatpak/build_manifest.py	Fri Jun 28 15:19:47 2019 +0200
@@ -24,7 +24,9 @@
 PYTHON_DEP_OVERRIDE = {
     "lxml": {
         "build-commands": [
-            "python2 ./setup.py install --prefix=${FLATPAK_DEST} --optimize=1"
+            # --optimize=1 make the build fail, to be tried again once moved to Python3
+            # "python2 ./setup.py install --prefix=${FLATPAK_DEST} --optimize=1"
+            "python2 ./setup.py install --prefix=${FLATPAK_DEST}"
         ],
         "build-options": {
             "env": {
@@ -46,6 +48,15 @@
             "cp kivy/setupconfig.py /app/lib/python2.7/site-packages/Kivy-*.egg/kivy/"
         ]
     },
+    "pillow": {
+        "build-options": {
+            "arch": {
+                "x86_64": {
+                    "ldflags": "-L/usr/lib/x86_64-linux-gnu"
+                }
+            }
+        }
+    },
 }
 PYTHON_DEP_REQUIREMENTS_UPDATE = {
     # service-identity is not seen as a twisted requirement, so it's sometimes misplaced
@@ -67,6 +78,34 @@
         "--socket=session-bus",
         "--share=network",
         "--filesystem=home"
+    ],
+    "modules": [
+        {
+            "name": "python",
+            # we use the same options as the ones of Python 2 from SDK
+            "config-opts": [
+                "--enable-deterministic-archives",
+                "--disable-static",
+                "--enable-shared",
+                "--with-ensurepip=yes",
+                "--with-system-expat",
+                "--with-system-ffi",
+                "--enable-loadable-sqlite-extensions",
+                "--with-dbmliborder=gdbm",
+                "--enable-unicode=ucs4",
+            ],
+            "post-install": [
+                # stipping won't work without this
+                "chmod 644 /app/lib/libpython2.7.so.1.0"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://www.python.org/ftp/python/2.7.16/Python-2.7.16.tar.xz",
+                    "sha256": "f222ef602647eecb6853681156d32de4450a2c39f4de93bd5b20235f2e660ed7"
+                }
+            ]
+        }
     ]
 }
 SHOW_REQUIRES_HEADER = 'Requires: '
@@ -915,7 +954,8 @@
     manifest['app-id'] = app_id
     manifest['default-branch'] = args.version
     # we update DEFAULT_MANIFEST only now to have "app-id" and "default-branch" on the top
-    # of the manifest
+    # of the manifest, also we don't want modules to be set now
+    default_modules = DEFAULT_MANIFEST.pop('modules', [])
     manifest.update(DEFAULT_MANIFEST)
     manifest.update(template)
 
@@ -933,6 +973,7 @@
 
     # at this point we add things specified in the template
     modules.extend(manifest.get('modules', []))
+    modules = default_modules + modules
     manifest['modules'] = modules
 
     # sat common things