Skip to content

Commit 995d993

Browse files
[Flatpak SDK] Import build definitions
https://bugs.webkit.org/show_bug.cgi?id=211448 Reviewed by Carlos Alberto Lopez Perez. To build the SDK, run `Tools/Scripts/webkit-flatpak-sdk --build`, this can take hours and use gigabytes of your hard-drive. To build a single recipe, use something like: `Tools/Scripts/bst-wrapper build sdk/gtk.bst` To enter the Buildstream SDK shell and debug stuff when hacking on a specific dependency, `Tools/Scripts/bst-wrapper shell sdk/gtk.bst`. To test your changes in WebKit: ```shell $ Tools/Scripts/webkit-flatpak -u --repo=Tools/buildstream/repo $ Tools/Scripts/run-minibrowser --gtk --flatpak-repo=Tools/buildstream/repo <url> ... ``` bst-wrapper has the same options as bst itself, documented on https://docs.buildstream.build/1.4.2/index.html. Internally the bst-wrapper will install Buildstream and a few other python dependencies in a local virtualenv managed by pipenv. This is all abstracted though, in theory direct access to the pipenv environment shouldn't be needed. * Scripts/bst-wrapper: Added. * Scripts/webkit-flatpak-sdk: Added. * buildstream/Makefile: Added. * buildstream/Pipfile: Added. * buildstream/Pipfile.lock: Added. * buildstream/elements/filtered-openh264.bst: Added. * buildstream/elements/filtered.bst: Added. * buildstream/elements/flatpak-platform-extensions.bst: Added. * buildstream/elements/flatpak-runtimes.bst: Added. * buildstream/elements/flatpak/platform-arch-libs-debug.bst: Added. * buildstream/elements/flatpak/platform-arch-libs.bst: Added. * buildstream/elements/flatpak/platform-image.bst: Added. * buildstream/elements/flatpak/platform-locale.bst: Added. * buildstream/elements/flatpak/platform.bst: Added. * buildstream/elements/flatpak/sdk-arch-libs-debug.bst: Added. * buildstream/elements/flatpak/sdk-arch-libs.bst: Added. * buildstream/elements/flatpak/sdk-debug.bst: Added. * buildstream/elements/flatpak/sdk-docs.bst: Added. * buildstream/elements/flatpak/sdk-image.bst: Added. * buildstream/elements/flatpak/sdk-locale.bst: Added. * buildstream/elements/flatpak/sdk.bst: Added. * buildstream/elements/freedesktop-sdk.bst: Added. * buildstream/elements/manifests/platform-manifest.bst: Added. * buildstream/elements/manifests/sdk-manifest.bst: Added. * buildstream/elements/qt5.bst: Added. * buildstream/elements/qt5/qtbase.bst: Added. * buildstream/elements/qt5/qtdeclarative.bst: Added. * buildstream/elements/qt5/qtquickcontrols.bst: Added. * buildstream/elements/qt5/qtquickcontrols2.bst: Added. * buildstream/elements/qt5/qtwayland.bst: Added. * buildstream/elements/qt5/qtx11extras.bst: Added. * buildstream/elements/sdk-build-depends/libusb.bst: Added. * buildstream/elements/sdk-build-depends/sassc.bst: Added. * buildstream/elements/sdk-build-depends/utf8proc.bst: Added. * buildstream/elements/sdk-depends/libsass.bst: Added. * buildstream/elements/sdk-platform.bst: Added. * buildstream/elements/sdk.bst: Added. * buildstream/elements/sdk/adwaita-icon-theme.bst: Added. * buildstream/elements/sdk/at-spi2-atk.bst: Added. * buildstream/elements/sdk/at-spi2-core.bst: Added. * buildstream/elements/sdk/atk.bst: Added. * buildstream/elements/sdk/brotli.bst: Added. * buildstream/elements/sdk/capnp.bst: Added. * buildstream/elements/sdk/enchant-2.bst: Added. * buildstream/elements/sdk/glib-networking.bst: Added. * buildstream/elements/sdk/glib.bst: Added. * buildstream/elements/sdk/gobject-introspection.bst: Added. * buildstream/elements/sdk/graphene.bst: Added. * buildstream/elements/sdk/graphviz.bst: Added. * buildstream/elements/sdk/gst-libav.bst: Added. * buildstream/elements/sdk/gst-plugins-bad.bst: Added. * buildstream/elements/sdk/gst-plugins-base.bst: Added. * buildstream/elements/sdk/gst-plugins-good.bst: Added. * buildstream/elements/sdk/gst-plugins-ugly.bst: Added. * buildstream/elements/sdk/gstreamer.bst: Added. * buildstream/elements/sdk/gtk+-3.bst: Added. * buildstream/elements/sdk/gtk.bst: Added. * buildstream/elements/sdk/icecc.bst: Added. * buildstream/elements/sdk/intltool.bst: Added. * buildstream/elements/sdk/krb5.bst: Added. * buildstream/elements/sdk/libcap-ng.bst: Added. * buildstream/elements/sdk/libevent.bst: Added. * buildstream/elements/sdk/libgcrypt.bst: Added. * buildstream/elements/sdk/libmanette.bst: Added. * buildstream/elements/sdk/libnotify.bst: Added. * buildstream/elements/sdk/libopenh264.bst: Added. * buildstream/elements/sdk/libsecret.bst: Added. * buildstream/elements/sdk/libsoup.bst: Added. * buildstream/elements/sdk/libsrtp2.bst: Added. * buildstream/elements/sdk/libusrsctp.bst: Added. * buildstream/elements/sdk/libwpe.bst: Added. * buildstream/elements/sdk/libzstd.bst: Added. * buildstream/elements/sdk/lzo2.bst: Added. * buildstream/elements/sdk/openjpeg.bst: Added. * buildstream/elements/sdk/openxr.bst: Added. * buildstream/elements/sdk/os-release.bst: Added. * buildstream/elements/sdk/patchelf.bst: Added. * buildstream/elements/sdk/psmisc.bst: Added. * buildstream/elements/sdk/pycairo.bst: Added. * buildstream/elements/sdk/pygobject.bst: Added. * buildstream/elements/sdk/python2-pycairo.bst: Added. * buildstream/elements/sdk/python2-pygobject.bst: Added. * buildstream/elements/sdk/python2-six.bst: Added. * buildstream/elements/sdk/python2-subprocess32.bst: Added. * buildstream/elements/sdk/python2.bst: Added. * buildstream/elements/sdk/rr.bst: Added. * buildstream/elements/sdk/sccache.bst: Added. * buildstream/elements/sdk/shared-mime-info.bst: Added. * buildstream/elements/sdk/subversion.bst: Added. * buildstream/elements/sdk/v4lutils.bst: Added. * buildstream/elements/sdk/woff2.bst: Added. * buildstream/elements/sdk/wpebackend-fdo.bst: Added. * buildstream/elements/sdk/x264.bst: Added. * buildstream/elements/sdk/xorg-server.bst: Added. * buildstream/elements/test-infra.bst: Added. * buildstream/elements/test-infra/apr-util.bst: Added. * buildstream/elements/test-infra/apr.bst: Added. * buildstream/elements/test-infra/httpd.bst: Added. * buildstream/elements/test-infra/perl-cgi-pm.bst: Added. * buildstream/elements/test-infra/perl-http-date-pm.bst: Added. * buildstream/elements/test-infra/php.bst: Added. * buildstream/elements/test-infra/webkitgtk-test-dicts.bst: Added. * buildstream/elements/test-infra/webkitgtk-test-fonts.bst: Added. * buildstream/files/krb5/krb5.conf: Added. * buildstream/files/os-release/issue.in: Added. * buildstream/files/os-release/issue.net.in: Added. * buildstream/files/os-release/org.webkit.Platform.appdata.xml.in: Added. * buildstream/files/os-release/org.webkit.Sdk.appdata.xml.in: Added. * buildstream/files/os-release/os-release.in: Added. * buildstream/patches/fdo-0001-Update-gcc-to-9.3.0.patch: Added. * buildstream/patches/fdo/0001-Add-Jack.patch: Added. * buildstream/patches/fdo/0001-components-xdg-desktop-portal.bst-Update-to-1.6.0.patch: Added. * buildstream/patches/fdo/0001-ffmpeg-Add-MS-MPEG-DivX-variants.patch: Added. * buildstream/patches/fdo/0002-Update-PipeWire-to-0.3.1.patch: Added. * buildstream/patches/fdo/0002-ffmpeg-Add-VP6-and-Sorenson-Spark-video-codecs.patch: Added. * buildstream/patches/fdo/0003-Add-Bluez.patch: Added. * buildstream/patches/fdo/0003-ffmpeg-Add-Intel-Indeo-and-Cinepak-video-support.patch: Added. * buildstream/patches/fdo/0004-ffmpeg-Add-MPEG-2-video-decoder.patch: Added. * buildstream/patches/fdo/0005-ffmpeg-Add-msmpeg4v3-support.patch: Added. * buildstream/patches/gst-libav-stop-caching-codecs.patch: Added. * buildstream/patches/gst-plugins-bad-0001-h264parse-Post-a-WARNING-when-data-is-broken.patch: Added. * buildstream/patches/gst-plugins-base-0001-glupload-Fix-fallback-from-direct-dmabuf-to-dmabuf-u.patch: Added. * buildstream/patches/gst-plugins-base-0001-playbin-Handle-error-message-with-redirection-indica.patch: Added. * buildstream/patches/gst-plugins-base-0002-glupload-fix-segfault.patch: Added. * buildstream/patches/gst-plugins-good-qtdemux-Specify-REDIRECT-information-in-error-messag.patch: Added. * buildstream/patches/gtk-meson-Bump-to-latest-version-of-the-3.24-branch.patch: Added. * buildstream/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch: Added. * buildstream/patches/libav-0001-gstavviddec-Limit-default-number-of-decoder-threads.patch: Added. * buildstream/patches/libgcrypt-0001-Use-pkg-config-to-detect-gpg-error.patch: Added. * buildstream/patches/libgcrypt-use-only-dev-urandom-for-testing.patch: Added. * buildstream/patches/libsecret-b53e9876f4611525b7a8f69a3110fbec51dcede0.patch: Added. * buildstream/patches/nettle-no-debug.diff: Added. * buildstream/patches/qtbase-avoid-hardcoding-kernel-version.patch: Added. * buildstream/patches/qtbase-revert-correct-handling-for-xdg-runtime-dir.patch: Added. * buildstream/patches/qtbase-use-wayland-on-gnome.patch: Added. * buildstream/patches/qtdeclarative-use-python3.patch: Added. * buildstream/patches/qtwayland-use-gnome-platform-theme-on-gnome-based-desktops.patch: Added. * buildstream/patches/sccache-no-selenium.patch: Added. * buildstream/patches/xserver-search-for-DRI-drivers-at-LIBGL_DRIVERS_PATH-environ.patch: Added. * buildstream/project.conf: Added. * buildstream/utils/generate-version: Added. * gtk/install-dependencies: * wpe/install-dependencies: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@261274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent e7ae1b8 commit 995d993

File tree

147 files changed

+7144
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+7144
-6
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ project.xcworkspace
1313
xcuserdata
1414
.mailmap
1515

16+
# Ignore Buildstream local files
17+
/Tools/buildstream/.bst
18+
/Tools/buildstream/.venv
19+
/Tools/buildstream/cache
20+
/Tools/buildstream/flatpak-version.yml
21+
1622
# Ignore auto-generated files by VS & VSCode.
1723
*.vcproj.*.user
1824
*.suo

Tools/ChangeLog

+175
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,178 @@
1+
2020-05-07 Philippe Normand <[email protected]>
2+
3+
[Flatpak SDK] Import build definitions
4+
https://bugs.webkit.org/show_bug.cgi?id=211448
5+
6+
Reviewed by Carlos Alberto Lopez Perez.
7+
8+
To build the SDK, run `Tools/Scripts/webkit-flatpak-sdk --build`,
9+
this can take hours and use gigabytes of your hard-drive. To build
10+
a single recipe, use something like:
11+
12+
`Tools/Scripts/bst-wrapper build sdk/gtk.bst`
13+
14+
To enter the Buildstream SDK shell and debug stuff when hacking on
15+
a specific dependency, `Tools/Scripts/bst-wrapper shell sdk/gtk.bst`.
16+
17+
To test your changes in WebKit:
18+
```shell
19+
$ Tools/Scripts/webkit-flatpak -u --repo=Tools/buildstream/repo
20+
$ Tools/Scripts/run-minibrowser --gtk --flatpak-repo=Tools/buildstream/repo <url>
21+
...
22+
```
23+
24+
bst-wrapper has the same options as bst itself, documented on
25+
https://docs.buildstream.build/1.4.2/index.html.
26+
27+
Internally the bst-wrapper will install Buildstream and a few
28+
other python dependencies in a local virtualenv managed by pipenv.
29+
This is all abstracted though, in theory direct access to the
30+
pipenv environment shouldn't be needed.
31+
32+
* Scripts/bst-wrapper: Added.
33+
* Scripts/webkit-flatpak-sdk: Added.
34+
* buildstream/Makefile: Added.
35+
* buildstream/Pipfile: Added.
36+
* buildstream/Pipfile.lock: Added.
37+
* buildstream/elements/filtered-openh264.bst: Added.
38+
* buildstream/elements/filtered.bst: Added.
39+
* buildstream/elements/flatpak-platform-extensions.bst: Added.
40+
* buildstream/elements/flatpak-runtimes.bst: Added.
41+
* buildstream/elements/flatpak/platform-arch-libs-debug.bst: Added.
42+
* buildstream/elements/flatpak/platform-arch-libs.bst: Added.
43+
* buildstream/elements/flatpak/platform-image.bst: Added.
44+
* buildstream/elements/flatpak/platform-locale.bst: Added.
45+
* buildstream/elements/flatpak/platform.bst: Added.
46+
* buildstream/elements/flatpak/sdk-arch-libs-debug.bst: Added.
47+
* buildstream/elements/flatpak/sdk-arch-libs.bst: Added.
48+
* buildstream/elements/flatpak/sdk-debug.bst: Added.
49+
* buildstream/elements/flatpak/sdk-docs.bst: Added.
50+
* buildstream/elements/flatpak/sdk-image.bst: Added.
51+
* buildstream/elements/flatpak/sdk-locale.bst: Added.
52+
* buildstream/elements/flatpak/sdk.bst: Added.
53+
* buildstream/elements/freedesktop-sdk.bst: Added.
54+
* buildstream/elements/manifests/platform-manifest.bst: Added.
55+
* buildstream/elements/manifests/sdk-manifest.bst: Added.
56+
* buildstream/elements/qt5.bst: Added.
57+
* buildstream/elements/qt5/qtbase.bst: Added.
58+
* buildstream/elements/qt5/qtdeclarative.bst: Added.
59+
* buildstream/elements/qt5/qtquickcontrols.bst: Added.
60+
* buildstream/elements/qt5/qtquickcontrols2.bst: Added.
61+
* buildstream/elements/qt5/qtwayland.bst: Added.
62+
* buildstream/elements/qt5/qtx11extras.bst: Added.
63+
* buildstream/elements/sdk-build-depends/libusb.bst: Added.
64+
* buildstream/elements/sdk-build-depends/sassc.bst: Added.
65+
* buildstream/elements/sdk-build-depends/utf8proc.bst: Added.
66+
* buildstream/elements/sdk-depends/libsass.bst: Added.
67+
* buildstream/elements/sdk-platform.bst: Added.
68+
* buildstream/elements/sdk.bst: Added.
69+
* buildstream/elements/sdk/adwaita-icon-theme.bst: Added.
70+
* buildstream/elements/sdk/at-spi2-atk.bst: Added.
71+
* buildstream/elements/sdk/at-spi2-core.bst: Added.
72+
* buildstream/elements/sdk/atk.bst: Added.
73+
* buildstream/elements/sdk/brotli.bst: Added.
74+
* buildstream/elements/sdk/capnp.bst: Added.
75+
* buildstream/elements/sdk/enchant-2.bst: Added.
76+
* buildstream/elements/sdk/glib-networking.bst: Added.
77+
* buildstream/elements/sdk/glib.bst: Added.
78+
* buildstream/elements/sdk/gobject-introspection.bst: Added.
79+
* buildstream/elements/sdk/graphene.bst: Added.
80+
* buildstream/elements/sdk/graphviz.bst: Added.
81+
* buildstream/elements/sdk/gst-libav.bst: Added.
82+
* buildstream/elements/sdk/gst-plugins-bad.bst: Added.
83+
* buildstream/elements/sdk/gst-plugins-base.bst: Added.
84+
* buildstream/elements/sdk/gst-plugins-good.bst: Added.
85+
* buildstream/elements/sdk/gst-plugins-ugly.bst: Added.
86+
* buildstream/elements/sdk/gstreamer.bst: Added.
87+
* buildstream/elements/sdk/gtk+-3.bst: Added.
88+
* buildstream/elements/sdk/gtk.bst: Added.
89+
* buildstream/elements/sdk/icecc.bst: Added.
90+
* buildstream/elements/sdk/intltool.bst: Added.
91+
* buildstream/elements/sdk/krb5.bst: Added.
92+
* buildstream/elements/sdk/libcap-ng.bst: Added.
93+
* buildstream/elements/sdk/libevent.bst: Added.
94+
* buildstream/elements/sdk/libgcrypt.bst: Added.
95+
* buildstream/elements/sdk/libmanette.bst: Added.
96+
* buildstream/elements/sdk/libnotify.bst: Added.
97+
* buildstream/elements/sdk/libopenh264.bst: Added.
98+
* buildstream/elements/sdk/libsecret.bst: Added.
99+
* buildstream/elements/sdk/libsoup.bst: Added.
100+
* buildstream/elements/sdk/libsrtp2.bst: Added.
101+
* buildstream/elements/sdk/libusrsctp.bst: Added.
102+
* buildstream/elements/sdk/libwpe.bst: Added.
103+
* buildstream/elements/sdk/libzstd.bst: Added.
104+
* buildstream/elements/sdk/lzo2.bst: Added.
105+
* buildstream/elements/sdk/openjpeg.bst: Added.
106+
* buildstream/elements/sdk/openxr.bst: Added.
107+
* buildstream/elements/sdk/os-release.bst: Added.
108+
* buildstream/elements/sdk/patchelf.bst: Added.
109+
* buildstream/elements/sdk/psmisc.bst: Added.
110+
* buildstream/elements/sdk/pycairo.bst: Added.
111+
* buildstream/elements/sdk/pygobject.bst: Added.
112+
* buildstream/elements/sdk/python2-pycairo.bst: Added.
113+
* buildstream/elements/sdk/python2-pygobject.bst: Added.
114+
* buildstream/elements/sdk/python2-six.bst: Added.
115+
* buildstream/elements/sdk/python2-subprocess32.bst: Added.
116+
* buildstream/elements/sdk/python2.bst: Added.
117+
* buildstream/elements/sdk/rr.bst: Added.
118+
* buildstream/elements/sdk/sccache.bst: Added.
119+
* buildstream/elements/sdk/shared-mime-info.bst: Added.
120+
* buildstream/elements/sdk/subversion.bst: Added.
121+
* buildstream/elements/sdk/v4lutils.bst: Added.
122+
* buildstream/elements/sdk/woff2.bst: Added.
123+
* buildstream/elements/sdk/wpebackend-fdo.bst: Added.
124+
* buildstream/elements/sdk/x264.bst: Added.
125+
* buildstream/elements/sdk/xorg-server.bst: Added.
126+
* buildstream/elements/test-infra.bst: Added.
127+
* buildstream/elements/test-infra/apr-util.bst: Added.
128+
* buildstream/elements/test-infra/apr.bst: Added.
129+
* buildstream/elements/test-infra/httpd.bst: Added.
130+
* buildstream/elements/test-infra/perl-cgi-pm.bst: Added.
131+
* buildstream/elements/test-infra/perl-http-date-pm.bst: Added.
132+
* buildstream/elements/test-infra/php.bst: Added.
133+
* buildstream/elements/test-infra/webkitgtk-test-dicts.bst: Added.
134+
* buildstream/elements/test-infra/webkitgtk-test-fonts.bst: Added.
135+
* buildstream/files/krb5/krb5.conf: Added.
136+
* buildstream/files/os-release/issue.in: Added.
137+
* buildstream/files/os-release/issue.net.in: Added.
138+
* buildstream/files/os-release/org.webkit.Platform.appdata.xml.in: Added.
139+
* buildstream/files/os-release/org.webkit.Sdk.appdata.xml.in: Added.
140+
* buildstream/files/os-release/os-release.in: Added.
141+
* buildstream/patches/fdo-0001-Update-gcc-to-9.3.0.patch: Added.
142+
* buildstream/patches/fdo/0001-Add-Jack.patch: Added.
143+
* buildstream/patches/fdo/0001-components-xdg-desktop-portal.bst-Update-to-1.6.0.patch: Added.
144+
* buildstream/patches/fdo/0001-ffmpeg-Add-MS-MPEG-DivX-variants.patch: Added.
145+
* buildstream/patches/fdo/0002-Update-PipeWire-to-0.3.1.patch: Added.
146+
* buildstream/patches/fdo/0002-ffmpeg-Add-VP6-and-Sorenson-Spark-video-codecs.patch: Added.
147+
* buildstream/patches/fdo/0003-Add-Bluez.patch: Added.
148+
* buildstream/patches/fdo/0003-ffmpeg-Add-Intel-Indeo-and-Cinepak-video-support.patch: Added.
149+
* buildstream/patches/fdo/0004-ffmpeg-Add-MPEG-2-video-decoder.patch: Added.
150+
* buildstream/patches/fdo/0005-ffmpeg-Add-msmpeg4v3-support.patch: Added.
151+
* buildstream/patches/gst-libav-stop-caching-codecs.patch: Added.
152+
* buildstream/patches/gst-plugins-bad-0001-h264parse-Post-a-WARNING-when-data-is-broken.patch: Added.
153+
* buildstream/patches/gst-plugins-base-0001-glupload-Fix-fallback-from-direct-dmabuf-to-dmabuf-u.patch: Added.
154+
* buildstream/patches/gst-plugins-base-0001-playbin-Handle-error-message-with-redirection-indica.patch: Added.
155+
* buildstream/patches/gst-plugins-base-0002-glupload-fix-segfault.patch: Added.
156+
* buildstream/patches/gst-plugins-good-qtdemux-Specify-REDIRECT-information-in-error-messag.patch: Added.
157+
* buildstream/patches/gtk-meson-Bump-to-latest-version-of-the-3.24-branch.patch: Added.
158+
* buildstream/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch: Added.
159+
* buildstream/patches/libav-0001-gstavviddec-Limit-default-number-of-decoder-threads.patch: Added.
160+
* buildstream/patches/libgcrypt-0001-Use-pkg-config-to-detect-gpg-error.patch: Added.
161+
* buildstream/patches/libgcrypt-use-only-dev-urandom-for-testing.patch: Added.
162+
* buildstream/patches/libsecret-b53e9876f4611525b7a8f69a3110fbec51dcede0.patch: Added.
163+
* buildstream/patches/nettle-no-debug.diff: Added.
164+
* buildstream/patches/qtbase-avoid-hardcoding-kernel-version.patch: Added.
165+
* buildstream/patches/qtbase-revert-correct-handling-for-xdg-runtime-dir.patch: Added.
166+
* buildstream/patches/qtbase-use-wayland-on-gnome.patch: Added.
167+
* buildstream/patches/qtdeclarative-use-python3.patch: Added.
168+
* buildstream/patches/qtwayland-use-gnome-platform-theme-on-gnome-based-desktops.patch: Added.
169+
* buildstream/patches/sccache-no-selenium.patch: Added.
170+
* buildstream/patches/xserver-search-for-DRI-drivers-at-LIBGL_DRIVERS_PATH-environ.patch: Added.
171+
* buildstream/project.conf: Added.
172+
* buildstream/utils/generate-version: Added.
173+
* gtk/install-dependencies:
174+
* wpe/install-dependencies:
175+
1176
2020-05-07 Mark Lam <[email protected]>
2177

3178
Fix broken exceptionFuzz tests.

Tools/Scripts/bst-wrapper

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
# Copyright (C) 2020 Igalia S.L.
4+
#
5+
# This program is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Lesser General Public
7+
# License as published by the Free Software Foundation; either
8+
# version 2.1 of the License, or (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
# Lesser General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU Lesser General Public
16+
# License along with this program; if not, write to the
17+
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18+
# Boston, MA 02110-1301, USA.
19+
20+
import os
21+
import subprocess
22+
import sys
23+
24+
scriptdir = os.path.abspath(os.path.dirname(__file__))
25+
SDK_PROJECT_PATH = os.path.join(scriptdir, "..", "buildstream")
26+
PIPENV_PIPFILE = os.path.realpath(os.path.join(SDK_PROJECT_PATH, "Pipfile"))
27+
28+
def run_pipenv(args: list, **kw) -> subprocess.CompletedProcess:
29+
local_env = {
30+
"PIPENV_VENV_IN_PROJECT": "1",
31+
"PIPENV_PIPFILE": PIPENV_PIPFILE
32+
}
33+
kw["env"] = os.environ
34+
kw["env"].update(local_env)
35+
return subprocess.run(["pipenv", ] + args, **kw)
36+
37+
def ensure_environment():
38+
result = run_pipenv(["--venv",], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
39+
if result.returncode != 0:
40+
run_pipenv(["install"])
41+
42+
def run_bst(args: list) -> subprocess.CompletedProcess:
43+
return run_pipenv(["run", "bst", "-C", SDK_PROJECT_PATH] + args)
44+
45+
def main(args: list) -> int:
46+
ensure_environment()
47+
if args[0] == "pipenv":
48+
run_pipenv(args[1:])
49+
else:
50+
run_bst(args)
51+
return 0
52+
53+
if __name__ == "__main__":
54+
sys.exit(main(sys.argv[1:]))

Tools/Scripts/webkit-flatpak-sdk

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
# Copyright (C) 2020 Igalia S.L.
4+
#
5+
# This program is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Lesser General Public
7+
# License as published by the Free Software Foundation; either
8+
# version 2.1 of the License, or (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
# Lesser General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU Lesser General Public
16+
# License along with this program; if not, write to the
17+
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18+
# Boston, MA 02110-1301, USA.
19+
20+
import argparse
21+
import os
22+
import subprocess
23+
import sys
24+
25+
scriptdir = os.path.abspath(os.path.dirname(__file__))
26+
SDK_PROJECT_PATH = os.path.join(scriptdir, "..", "buildstream")
27+
wrapper = os.path.join(scriptdir, "bst-wrapper")
28+
29+
def run_wrapper(args: list, **kw) -> subprocess.CompletedProcess:
30+
kw["cwd"] = SDK_PROJECT_PATH
31+
return subprocess.run(["make", f"BST={wrapper}",] + args, **kw)
32+
33+
def main(args: list) -> int:
34+
parser = argparse.ArgumentParser()
35+
parser.add_argument("--build", dest='build', action='store_true')
36+
parsed_args, command = parser.parse_known_args()
37+
38+
if parsed_args.build:
39+
result = run_wrapper(command)
40+
return result.returncode
41+
return 0
42+
43+
if __name__ == "__main__":
44+
sys.exit(main(sys.argv[1:]))

0 commit comments

Comments
 (0)