Commit 0b086908 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Generate metadata & org.gnome.Sdk.json

Allows us to keep some build configurations in the same place
so they do not have to be duplicated.

Now set the architecture and versions directly in the Makefile
parent bc6b83f1
all: repo org.gnome.Sdk.json
# Override the arch with `make ARCH=i386`
ARCH ?= $(shell xdg-app --default-arch)
# 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=3.20
SDK_RUNTIME_VERSION=1.4
# Canned recipe for generating metadata
SUBST_FILES=org.gnome.Sdk.json metadata.sdk metadata.platform
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: repo $(patsubst %,%.in,$(SUBST_FILES))
rm -rf sdk
$(call subst-metadata)
flatpak-builder --force-clean --ccache --require-changes --repo=repo --subject="build of org.gnome.Sdk, `date`" ${EXPORT_ARGS} sdk org.gnome.Sdk.json
rm -rf sdk
......
[Runtime]
name=org.gnome.Platform
runtime=org.gnome.Platform/x86_64/master
sdk=org.gnome.Sdk/x86_64/master
runtime=org.gnome.Platform/@@SDK_ARCH@@/@@SDK_BRANCH@@
sdk=org.gnome.Sdk/@@SDK_ARCH@@/@@SDK_BRANCH@@
[Extension org.freedesktop.Platform.GL]
version=1.4
version=@@SDK_RUNTIME_VERSION@@
directory=lib/GL
[Extension org.freedesktop.Platform.Timezones]
version=1.4
version=@@SDK_RUNTIME_VERSION@@
directory=share/zoneinfo
[Extension org.freedesktop.Platform.GStreamer]
version=1.4
version=@@SDK_RUNTIME_VERSION@@
directory=lib/extensions/gstreamer-1.0
subdirectories=true
......
[Runtime]
name=org.gnome.Sdk
runtime=org.gnome.Platform/x86_64/master
sdk=org.gnome.Sdk/x86_64/master
runtime=org.gnome.Platform/@@SDK_ARCH@@/@@SDK_BRANCH@@
sdk=org.gnome.Sdk/@@SDK_ARCH@@/@@SDK_BRANCH@@
[Extension org.freedesktop.Platform.GL]
version=1.4
version=@@SDK_RUNTIME_VERSION@@
directory=lib/GL
[Extension org.freedesktop.Platform.Timezones]
version=1.4
version=@@SDK_RUNTIME_VERSION@@
directory=share/zoneinfo
[Extension org.freedesktop.Platform.GStreamer]
version=1.4
version=@@SDK_RUNTIME_VERSION@@
directory=lib/extensions/gstreamer-1.0
subdirectories=true
......
......@@ -2,10 +2,10 @@
"build-runtime": true,
"id": "org.gnome.Sdk",
"id-platform": "org.gnome.Platform",
"branch": "3.20",
"branch": "@@SDK_BRANCH@@",
"runtime": "org.freedesktop.Platform",
"sdk": "org.freedesktop.Sdk",
"runtime-version": "1.4",
"runtime-version": "@@SDK_RUNTIME_VERSION@@",
"writable-sdk": true,
"sdk-extensions": ["org.freedesktop.Sdk.Debug", "org.freedesktop.Sdk.Locale"],
"platform-extensions": [ "org.freedesktop.Platform.Locale"],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment