This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-pkg.git

commit 9387f4fdc4c1013fb32bb8442147988a529df7f0
Author: mokou <[email protected]>
AuthorDate: Wed Jan 12 14:12:47 2022 +0100

    feat: add aarch64-rhel build support
---
 Makefile                                          |  8 ++++++++
 rpm/SOURCES/0001-build-with-sm68-on-aarch64.patch | 23 +++++++++++++++++++++++
 rpm/SPECS/couchdb.spec.in                         | 10 ++++++++--
 3 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 77fdfa0..36bda2f 100644
--- a/Makefile
+++ b/Makefile
@@ -148,6 +148,14 @@ centos8: SPIDERMONKEY_DEV=mozjs60-devel
 centos8: SM_VER=60
 centos8: sm-ver-rpm make-rpmbuild centos
 
+# aarch64 RHEL-based
+aarch64-rhel: DIST=rhel
+# Needs 68 for aarch compat, we're using the included one here
+aarch64-rhel: SPIDERMONKEY=couch-js-68
+aarch64-rhel: SPIDERMONKEY_DEV=couch-js-68-devel
+aarch64-rhel: SM_VER=68
+aarch64-rhel: sm-ver-rpm make-rpmbuild centos
+
 openSUSE: centos7
 
 
diff --git a/rpm/SOURCES/0001-build-with-sm68-on-aarch64.patch 
b/rpm/SOURCES/0001-build-with-sm68-on-aarch64.patch
new file mode 100644
index 0000000..a96213e
--- /dev/null
+++ b/rpm/SOURCES/0001-build-with-sm68-on-aarch64.patch
@@ -0,0 +1,23 @@
+From: Peter Lemenkov <[email protected]>
+Date: Thu, 5 Mar 2020 16:36:42 +0300
+Subject: [PATCH] Build with SpiderMonkey 60 on ARM 64
+
+Signed-off-by: Peter Lemenkov <[email protected]>
+
+diff --git a/configure b/configure
+index 38e62e317..995b537f8 100755
+--- a/configure
++++ b/configure
+@@ -178,12 +178,6 @@ parse_opts() {
+
+ parse_opts $@
+
+-if [ "${ARCH}" = "aarch64" ] && [ "${SM_VSN}" != "1.8.5" ]
+-then
+-  echo "ERROR: SpiderMonkey 60 is known broken on ARM 64 (aarch64). Use 1.8.5 
instead."
+-  exit 1
+-fi
+-
+ echo "==> configuring couchdb in rel/couchdb.config"
+ cat > rel/couchdb.config << EOF
+ % Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/rpm/SPECS/couchdb.spec.in b/rpm/SPECS/couchdb.spec.in
index bbb611c..990d8b8 100644
--- a/rpm/SPECS/couchdb.spec.in
+++ b/rpm/SPECS/couchdb.spec.in
@@ -28,10 +28,11 @@ Prefix:        %{prefix}
 Group:         Applications/Databases
 URL:           https://couchdb.apache.org/
 Vendor:        The Apache Software Foundation
-BuildArch:     x86_64 ppc64le
-ExclusiveArch: x86_64 ppc64le
+BuildArch:     x86_64 ppc64le aarch64
+ExclusiveArch: x86_64 ppc64le aarch64
 Exclusiveos:   linux
 Packager:      CouchDB Developers <[email protected]>
+Patch1:        0001-build-with-sm68-on-aarch64.patch
 
 %if 0%{?suse_version}
 BuildRequires: erlang
@@ -92,6 +93,11 @@ languages and environments.
 # NOTE: Stripping binaries causes issues so we skip it.
 %define __os_install_post %{nil}
 
+%prep
+%ifarch aarch64
+%patch01 -p1
+%endif
+
 %build
 ./configure --spidermonkey-version=%SM_VER%
 %{__make} release

Reply via email to