libgpg-error: fix build error on macOS 14608/head
authorGeorgi Valkov <gvalkov@abv.bg>
Sat, 30 Jan 2021 11:27:55 +0000 (13:27 +0200)
committerGeorgi Valkov <gvalkov@abv.bg>
Sun, 31 Jan 2021 16:41:10 +0000 (18:41 +0200)
src/gen-lock-obj.sh runs in /bin/sh which does not support echo -n on macOS,
and generates garbage. Resolved by using printf which is posix compliant.

Signed-off-by: Georgi Valkov <gvalkov@abv.bg>
libs/libgpg-error/Makefile
libs/libgpg-error/patches/010-add-arc-support.patch
libs/libgpg-error/patches/011-macos-compile-fix.patch [new file with mode: 0644]

index 12fdb03be7d115e51a60d04129d71a9a87afa689..69e6bad4f104b5aa044558daf9d495c595249114 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libgpg-error
 PKG_VERSION:=1.39
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://mirrors.dotsrc.org/gcrypt/libgpg-error \
index 1020c7e39779cc57381acb83a2afdfb33be238b5..5ecf81c292cb53854d9f972868d5b9399e9d38c2 100644 (file)
@@ -26,8 +26,6 @@ Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
  2 files changed, 24 insertions(+)
  create mode 100644 src/syscfg/lock-obj-pub.arc-unknown-linux-gnu.h
 
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 380ea7c09c04..bd00961c2f27 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
 @@ -48,6 +48,7 @@ lock_obj_pub = \
@@ -38,9 +36,6 @@ index 380ea7c09c04..bd00961c2f27 100644
          syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h \
          syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h     \
        syscfg/lock-obj-pub.arm-apple-darwin.h              \
-diff --git a/src/syscfg/lock-obj-pub.arc-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.arc-unknown-linux-gnu.h
-new file mode 100644
-index 000000000000..3b1a8fadf8a7
 --- /dev/null
 +++ b/src/syscfg/lock-obj-pub.arc-unknown-linux-gnu.h
 @@ -0,0 +1,23 @@
@@ -67,5 +62,3 @@ index 000000000000..3b1a8fadf8a7
 +## buffer-read-only: t
 +## End:
 +##
--- 
-2.17.1
diff --git a/libs/libgpg-error/patches/011-macos-compile-fix.patch b/libs/libgpg-error/patches/011-macos-compile-fix.patch
new file mode 100644 (file)
index 0000000..c615ad1
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/src/gen-lock-obj.sh
++++ b/src/gen-lock-obj.sh
+@@ -84,17 +84,16 @@ EOF
+ #     USE_LONG_DOUBLE_FOR_ALIGNMENT
+ #
+-echo -n "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{"
++printf "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{"
+ i=0
+ while test "$i" -lt $ac_mtx_size; do
+     if test "$i" -ne 0 -a "$(( $i % 8 ))" -eq 0; then
+-        echo ' \'
+-        echo -n "                                    "
++        printf " %s\n                                    " "\\"
+     fi
+-    echo -n '0'
++    printf '0'
+     if test "$i" -lt $(($ac_mtx_size - 1)); then
+-        echo -n ','
++        printf ','
+     fi
+     i=$(( i + 1 ))
+ done