This repository has been archived by the owner on Dec 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile
105 lines (82 loc) · 3.76 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Override the arch with `make ARCH=i386`
ARCH ?= $(shell flatpak --default-arch)
REPO ?= repo
FB_ARGS ?=
# SDK Versions setup here
#
# SDK_BRANCH: The version (branch) of runtime and sdk to produce
# SDK_RUNTIME_VERSION: The org.freedesktop.BaseSdk and platform version to build against
#
SDK_BRANCH=1.6
SDK_RUNTIME_VERSION=1.6
# Canned recipe for generating metadata
SUBST_FILES=org.freedesktop.Sdk.json \
org.freedesktop.GlxInfo.json \
os-release issue issue.net \
org.freedesktop.Sdk.appdata.xml org.freedesktop.Platform.appdata.xml \
org.freedesktop.Platform.GL.mesa-git.json \
org.freedesktop.Platform.GL.mesa-stable.json \
org.freedesktop.Sdk.Extension.gfortran62.json \
org.freedesktop.Platform.VAAPI.Intel.json
define subst-metadata
@echo -n "Generating files: ${SUBST_FILES}... ";
@for file in ${SUBST_FILES}; do \
file_source=$${file}.in; \
sed -e 's/@@SDK_ARCH@@/${ARCH}/g' \
-e 's/@@SDK_BRANCH@@/${SDK_BRANCH}/g' \
-e 's/@@SDK_RUNTIME_VERSION@@/${SDK_RUNTIME_VERSION}/g' \
$$file_source > $$file.tmp && mv $$file.tmp $$file || exit 1; \
done
@echo "Done.";
endef
all: runtimes
extra: glxinfo gl-drivers extensions
$(SUBST_FILES): $(patsubst %,%.in,$(SUBST_FILES))
$(call subst-metadata)
glxinfo: ${REPO} $(patsubst %,%.in,$(SUBST_FILES))
$(call subst-metadata)
flatpak-builder --force-clean --require-changes --repo=${REPO} --arch=${ARCH} \
--subject="build of org.freedesktop.GlxInfo, `date`" \
${EXPORT_ARGS} ${FB_ARGS} glxinfo org.freedesktop.GlxInfo.json
gl-drivers: gl-drivers-${ARCH}
gl-drivers-${ARCH}:
gl-drivers-i386: mesa-stable
gl-drivers-x86_64: mesa-stable
mesa-git:
$(call subst-metadata)
flatpak-builder --force-clean --require-changes --repo=${REPO} --arch=${ARCH} \
--subject="build of org.freedesktop.Platform.GL.mesa-git, `date`" \
${EXPORT_ARGS} ${FB_ARGS} mesa org.freedesktop.Platform.GL.mesa-git.json
mesa-stable:
$(call subst-metadata)
flatpak-builder --force-clean --require-changes --repo=${REPO} --arch=${ARCH} \
--subject="build of org.freedesktop.Platform.GL.mesa-stable, `date`" \
${EXPORT_ARGS} ${FB_ARGS} mesa org.freedesktop.Platform.GL.mesa-stable.json
if test "${ARCH}" = "i386" ; then \
flatpak build-commit-from ${EXPORT_ARGS} --src-ref=runtime/org.freedesktop.Platform.GL.default/${ARCH}/${SDK_BRANCH} ${REPO} runtime/org.freedesktop.Platform.GL32.default/x86_64/${SDK_BRANCH} ; \
fi
vaapi-intel:
$(call subst-metadata)
flatpak-builder --force-clean --require-changes --repo=${REPO} --arch=${ARCH} \
--subject="build of org.freedesktop.Platform.VAAPI.Intel, `date`" \
${EXPORT_ARGS} vaapi-intel org.freedesktop.Platform.VAAPI.Intel.json
runtimes: ${REPO} $(patsubst %,%.in,$(SUBST_FILES))
$(call subst-metadata)
flatpak-builder --force-clean --require-changes --repo=${REPO} --arch=${ARCH} \
--subject="build of org.freedesktop.Sdk, `date`" \
${EXPORT_ARGS} ${FB_ARGS} sdk org.freedesktop.Sdk.json
if test "${ARCH}" = "i386" -a -f ${REPO}/refs/heads/runtime/org.freedesktop.Platform/i386/${SDK_BRANCH}; then \
flatpak build-commit-from ${EXPORT_ARGS} --src-ref=runtime/org.freedesktop.Platform/${ARCH}/${SDK_BRANCH} ${REPO} runtime/org.freedesktop.Platform.Compat32/x86_64/${SDK_BRANCH} ; \
fi
extensions: extensions-${ARCH}
extensions-${ARCH}:
# It seems like gfortran has issues on arm atm, lets drop it there
extensions-i386: gfortran-extension
extensions-x86_64: gfortran-extension
gfortran-extension: ${REPO} $(patsubst %,%.in,$(SUBST_FILES))
$(call subst-metadata)
flatpak-builder --force-clean --require-changes --repo=${REPO} --arch=${ARCH} \
--subject="build of org.freedesktop.Sdk.Extension.gfortran62, `date`" \
${EXPORT_ARGS} ${FB_ARGS} sdk org.freedesktop.Sdk.Extension.gfortran62.json
${REPO}:
ostree init --mode=archive-z2 --repo=${REPO}