summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bonnans <laurent.bonnans@here.com>2018-01-24 17:15:04 +0100
committerLaurent Bonnans <laurent.bonnans@here.com>2018-01-25 09:56:23 +0100
commit79497c99576f3f3f68d82d25f266d4b421af510f (patch)
tree6ea5e7278e7bcc3f98932a08f56ac1f95332f29e
parent45bd8d6995119b84d9622dd8ce3d1fedfa2ed0ef (diff)
downloadmeta-updater-79497c99576f3f3f68d82d25f266d4b421af510f.tar.gz
Patch asn1c skeletons file discovery
The OpenEmbedded native build process interferes with asn1c's method to find its required data: asn1c-native is moved after being built but the data directory is hardcoded from configure time in asn1c. There is an alternative detection method builtin in asn1c, used for development. Let's just hack into that and target '../share/asn1c' from the binary directory.
-rw-r--r--recipes-sota/asn1c/asn1c.bb3
-rw-r--r--recipes-sota/asn1c/files/skeletons_dir_fix.patch44
2 files changed, 46 insertions, 1 deletions
diff --git a/recipes-sota/asn1c/asn1c.bb b/recipes-sota/asn1c/asn1c.bb
index 7539825..9d1517d 100644
--- a/recipes-sota/asn1c/asn1c.bb
+++ b/recipes-sota/asn1c/asn1c.bb
@@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=ee8bfaaa7d71cf3edb079475e6716d4b"
8inherit autotools native 8inherit autotools native
9 9
10PV = "0.9.28" 10PV = "0.9.28"
11SRC_URI = "https://github.com/vlm/asn1c/releases/download/v${PV}/asn1c-${PV}.tar.gz" 11SRC_URI = "https://github.com/vlm/asn1c/releases/download/v${PV}/asn1c-${PV}.tar.gz \
12 file://skeletons_dir_fix.patch"
12SRC_URI[sha256sum] = "8007440b647ef2dd9fb73d931c33ac11764e6afb2437dbe638bb4e5fc82386b9" 13SRC_URI[sha256sum] = "8007440b647ef2dd9fb73d931c33ac11764e6afb2437dbe638bb4e5fc82386b9"
13 14
14BBCLASSEXTEND = "native nativesdk" 15BBCLASSEXTEND = "native nativesdk"
diff --git a/recipes-sota/asn1c/files/skeletons_dir_fix.patch b/recipes-sota/asn1c/files/skeletons_dir_fix.patch
new file mode 100644
index 0000000..f1caa2f
--- /dev/null
+++ b/recipes-sota/asn1c/files/skeletons_dir_fix.patch
@@ -0,0 +1,44 @@
1From 1a1c2c94f700cf0f4dc5dba863950b16477fdc6d Mon Sep 17 00:00:00 2001
2From: Laurent Bonnans <laurent.bonnans@here.com>
3Date: Thu, 25 Jan 2018 09:49:41 +0100
4Subject: [PATCH] Patch the skeletons directory detection
5
6Detect `share/asn1c` from `bin/` if it exists
7---
8 asn1c/asn1c.c | 9 ++++-----
9 1 file changed, 4 insertions(+), 5 deletions(-)
10
11diff --git a/asn1c/asn1c.c b/asn1c/asn1c.c
12index eb1eff7c..dd9fc832 100644
13--- a/asn1c/asn1c.c
14+++ b/asn1c/asn1c.c
15@@ -226,22 +226,21 @@ main(int ac, char **av) {
16 if(skeletons_dir == NULL) {
17 struct stat sb;
18 skeletons_dir = DATADIR;
19- if((av[-optind][0] == '.' || av[-optind][1] == '/')
20- && stat(skeletons_dir, &sb)) {
21+ if(stat(skeletons_dir, &sb)) {
22 /*
23 * The default skeletons directory does not exist,
24 * compute it from my file name:
25- * ./asn1c/asn1c -> ./skeletons
26+ * ./asn1c/asn1c -> ./share/asn1c
27 */
28 char *p;
29 size_t len;
30
31 p = a1c_dirname(av[-optind]);
32
33- len = strlen(p) + sizeof("/../skeletons");
34+ len = strlen(p) + sizeof("/../share/asn1c");
35 skeletons_dir = malloc(len);
36 assert(skeletons_dir);
37- snprintf(skeletons_dir, len, "%s/../skeletons", p);
38+ snprintf(skeletons_dir, len, "%s/../share/asn1c", p);
39 if(stat(skeletons_dir, &sb)) {
40 fprintf(stderr,
41 "WARNING: skeletons are neither in "
42--
432.15.1
44