[gnome-sdk-images/wip/tvb/aarch64: 4/4] Generate metadata and org.gnome.Sdk.json
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sdk-images/wip/tvb/aarch64: 4/4] Generate metadata and org.gnome.Sdk.json
- Date: Thu, 28 Apr 2016 21:29:41 +0000 (UTC)
commit dde5b0149a3060f529e8ad161062d5e8d4d042d3
Author: Tristan Van Berkom <tristan vanberkom codethink co uk>
Date: Mon Apr 25 20:23:10 2016 +0100
Generate metadata and 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
Makefile | 21 ++++++++++++++++++++-
metadata.platform => metadata.platform.in | 4 ++--
metadata.sdk => metadata.sdk.in | 4 ++--
org.gnome.Sdk.json => org.gnome.Sdk.json.in | 4 ++--
4 files changed, 26 insertions(+), 7 deletions(-)
---
diff --git a/Makefile b/Makefile
index 231a00a..9871446 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,17 @@
-all: repo org.gnome.Sdk.json
+# Modify build architecture and version here.
+#
+# Alternatively you can build with 'make SDK_ARCH=aarch64 SDK_VERSION=1.6' but
+# it will only be taken into account when generating files the first time.
+SDK_ARCH ?= x86_64
+SDK_BRANCH ?= master
+SDK_RUNTIME_VERSION ?= 1.4
+
+SUBST_FILES=\
+ metadata.sdk \
+ metadata.platform \
+ org.gnome.Sdk.json
+
+all: repo org.gnome.Sdk.json ${SUBST_FILES}
rm -rf sdk
xdg-app-builder --ccache --require-changes --repo=repo --subject="build of org.gnome.Sdk, `date`"
${EXPORT_ARGS} sdk org.gnome.Sdk.json
rm -rf sdk
@@ -8,3 +21,9 @@ repo:
check:
json-glib-validate org.gnome.Sdk.json
+
+%:%.in
+ sed -e 's/@@SDK_ARCH@@/${SDK_ARCH}/g' \
+ -e 's/@@SDK_BRANCH@@/${SDK_BRANCH}/g' \
+ -e 's/@@SDK_RUNTIME_VERSION@@/${SDK_RUNTIME_VERSION}/g' \
+ $< > $ tmp && mv $ tmp $@ || exit 1
diff --git a/metadata.platform b/metadata.platform.in
similarity index 83%
rename from metadata.platform
rename to metadata.platform.in
index 4ca8c46..11c7929 100644
--- a/metadata.platform
+++ b/metadata.platform.in
@@ -1,7 +1,7 @@
[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
diff --git a/metadata.sdk b/metadata.sdk.in
similarity index 83%
rename from metadata.sdk
rename to metadata.sdk.in
index 280d014..8eb9f6d 100644
--- a/metadata.sdk
+++ b/metadata.sdk.in
@@ -1,7 +1,7 @@
[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
diff --git a/org.gnome.Sdk.json b/org.gnome.Sdk.json.in
similarity index 99%
rename from org.gnome.Sdk.json
rename to org.gnome.Sdk.json.in
index fc864cd..6bb1d29 100644
--- a/org.gnome.Sdk.json
+++ b/org.gnome.Sdk.json.in
@@ -2,10 +2,10 @@
"build-runtime": true,
"id": "org.gnome.Sdk",
"id-platform": "org.gnome.Platform",
- "branch": "master",
+ "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"],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]