comparison flatpak/build_manifest.py @ 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 6f8c849daf2a
children cd411b0d1e19
comparison
equal deleted inserted replaced
152:4dc8ed9ae4de 153:df75b62e653e
22 22
23 CACHE_LIMIT = 3600 * 24 23 CACHE_LIMIT = 3600 * 24
24 PYTHON_DEP_OVERRIDE = { 24 PYTHON_DEP_OVERRIDE = {
25 "lxml": { 25 "lxml": {
26 "build-commands": [ 26 "build-commands": [
27 "python2 ./setup.py install --prefix=${FLATPAK_DEST} --optimize=1" 27 # --optimize=1 make the build fail, to be tried again once moved to Python3
28 # "python2 ./setup.py install --prefix=${FLATPAK_DEST} --optimize=1"
29 "python2 ./setup.py install --prefix=${FLATPAK_DEST}"
28 ], 30 ],
29 "build-options": { 31 "build-options": {
30 "env": { 32 "env": {
31 "XSLT_CONFIG": "pkg-config libxslt" 33 "XSLT_CONFIG": "pkg-config libxslt"
32 } 34 }
43 # this file is not copied normally when installing with 45 # this file is not copied normally when installing with
44 # `python2 setup.py install`. 46 # `python2 setup.py install`.
45 # TODO: report upstream 47 # TODO: report upstream
46 "cp kivy/setupconfig.py /app/lib/python2.7/site-packages/Kivy-*.egg/kivy/" 48 "cp kivy/setupconfig.py /app/lib/python2.7/site-packages/Kivy-*.egg/kivy/"
47 ] 49 ]
50 },
51 "pillow": {
52 "build-options": {
53 "arch": {
54 "x86_64": {
55 "ldflags": "-L/usr/lib/x86_64-linux-gnu"
56 }
57 }
58 }
48 }, 59 },
49 } 60 }
50 PYTHON_DEP_REQUIREMENTS_UPDATE = { 61 PYTHON_DEP_REQUIREMENTS_UPDATE = {
51 # service-identity is not seen as a twisted requirement, so it's sometimes misplaced 62 # service-identity is not seen as a twisted requirement, so it's sometimes misplaced
52 'twisted': ['service-identity'], 63 'twisted': ['service-identity'],
65 "command": "sat_wrapper", 76 "command": "sat_wrapper",
66 "finish-args": [ 77 "finish-args": [
67 "--socket=session-bus", 78 "--socket=session-bus",
68 "--share=network", 79 "--share=network",
69 "--filesystem=home" 80 "--filesystem=home"
81 ],
82 "modules": [
83 {
84 "name": "python",
85 # we use the same options as the ones of Python 2 from SDK
86 "config-opts": [
87 "--enable-deterministic-archives",
88 "--disable-static",
89 "--enable-shared",
90 "--with-ensurepip=yes",
91 "--with-system-expat",
92 "--with-system-ffi",
93 "--enable-loadable-sqlite-extensions",
94 "--with-dbmliborder=gdbm",
95 "--enable-unicode=ucs4",
96 ],
97 "post-install": [
98 # stipping won't work without this
99 "chmod 644 /app/lib/libpython2.7.so.1.0"
100 ],
101 "sources": [
102 {
103 "type": "archive",
104 "url": "https://www.python.org/ftp/python/2.7.16/Python-2.7.16.tar.xz",
105 "sha256": "f222ef602647eecb6853681156d32de4450a2c39f4de93bd5b20235f2e660ed7"
106 }
107 ]
108 }
70 ] 109 ]
71 } 110 }
72 SHOW_REQUIRES_HEADER = 'Requires: ' 111 SHOW_REQUIRES_HEADER = 'Requires: '
73 SETTINGS_KEY = '_build_settings' 112 SETTINGS_KEY = '_build_settings'
74 APPDATA_RELEASE_DEV_TEXT = dedent("""\ 113 APPDATA_RELEASE_DEV_TEXT = dedent("""\
913 952
914 manifest = {} 953 manifest = {}
915 manifest['app-id'] = app_id 954 manifest['app-id'] = app_id
916 manifest['default-branch'] = args.version 955 manifest['default-branch'] = args.version
917 # we update DEFAULT_MANIFEST only now to have "app-id" and "default-branch" on the top 956 # we update DEFAULT_MANIFEST only now to have "app-id" and "default-branch" on the top
918 # of the manifest 957 # of the manifest, also we don't want modules to be set now
958 default_modules = DEFAULT_MANIFEST.pop('modules', [])
919 manifest.update(DEFAULT_MANIFEST) 959 manifest.update(DEFAULT_MANIFEST)
920 manifest.update(template) 960 manifest.update(template)
921 961
922 modules.extend(get_libxslt()) 962 modules.extend(get_libxslt())
923 963
931 # python dependencies 971 # python dependencies
932 modules.extend(get_python_deps()) 972 modules.extend(get_python_deps())
933 973
934 # at this point we add things specified in the template 974 # at this point we add things specified in the template
935 modules.extend(manifest.get('modules', [])) 975 modules.extend(manifest.get('modules', []))
976 modules = default_modules + modules
936 manifest['modules'] = modules 977 manifest['modules'] = modules
937 978
938 # sat common things 979 # sat common things
939 existing_modules = {d['name'] for d in modules} 980 existing_modules = {d['name'] for d in modules}
940 if "sat_templates" not in existing_modules: 981 if "sat_templates" not in existing_modules: