added extra/gjs

This commit is contained in:
Kevin Mihelich 2021-11-10 05:37:17 +00:00
parent ee63c7a8fa
commit 5af8bf173e
2 changed files with 111 additions and 0 deletions

51
extra/gjs/PKGBUILD Normal file
View file

@ -0,0 +1,51 @@
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch from debian to detect libatomic usage
pkgname=gjs
pkgver=1.70.0
pkgrel=1
epoch=2
pkgdesc="Javascript Bindings for GNOME"
url="https://wiki.gnome.org/Projects/Gjs"
arch=(x86_64)
license=(GPL)
depends=(cairo gobject-introspection-runtime js78 dconf readline)
makedepends=(gobject-introspection git meson dbus)
checkdepends=(valgrind xorg-server-xvfb gtk3 gtk4)
provides=(libgjs.so)
_commit=da5d5fe74469c799de80117758d79ad694d1116a # tags/1.70.0^0
source=("git+https://gitlab.gnome.org/GNOME/gjs.git#commit=$_commit"
build-Link-with-libatomic-if-necessary.patch)
sha256sums=('SKIP'
'fcfcc02a65b3917fbdf7ded5ee294ff5fc71225ffe720e42ca0257c7cb14eada')
pkgver() {
cd $pkgname
git describe --tags | sed 's/-/+/g'
}
prepare() {
cd $pkgname
patch -p1 -i ../build-Link-with-libatomic-if-necessary.patch
}
build() {
arch-meson $pkgname build \
--buildtype release \
-D installed_tests=false \
-D profiler=disabled
meson compile -C build
}
check() {
xvfb-run -s '-nolisten local' \
meson test -C build --print-errorlogs
}
package() {
depends+=(libreadline.so)
meson install -C build --destdir "$pkgdir"
}

View file

@ -0,0 +1,60 @@
From: Simon McVittie <smcv@debian.org>
Date: Fri, 8 Oct 2021 11:42:49 +0100
Subject: build: Link with libatomic if necessary
The implementation of atomic operations in gcc uses atomic opcodes if
supported, but falls back to a library implementation if necessary.
Link that library on architectures where 64-bit atomic operations need it,
such as Debian armel (ARMv5 EABI softfloat), mipsel and powerpc.
Bug: https://gitlab.gnome.org/GNOME/gjs/-/issues/442
Bug-Debian: https://bugs.debian.org/995930
Forwarded: https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/686
Signed-off-by: Simon McVittie <smcv@debian.org>
---
meson.build | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 6ded66c..e230a09 100644
--- a/meson.build
+++ b/meson.build
@@ -109,6 +109,8 @@ endif
### Check for required libraries ###############################################
+null_dep = dependency('', required : false)
+
# Note: Notify GNOME release team when adding or updating dependencies
glib_required_version = '>= 2.66.0'
glib = dependency('glib-2.0', version: glib_required_version,
@@ -180,6 +182,20 @@ features.''')
endif
endif
+if cxx.links('''
+#include <atomic>
+
+int main(void)
+{
+ std::atomic_int64_t value = ATOMIC_VAR_INIT(0);
+ return value.load();
+}
+''', name: '64-bit atomics built-in')
+ libatomic = null_dep
+else
+ libatomic = cc.find_library('atomic', required: false)
+endif
+
build_profiler = sysprof_capture.found() and not get_option('profiler').disabled()
profiler_deps = [sysprof_capture]
if build_profiler and not cxx.has_function('timer_settime')
@@ -458,7 +474,7 @@ module_resource_srcs = gnome.compile_resources('js-resources',
c_name: 'js_resources')
libgjs_dependencies = [glib, gobject, gthread, gio, gi, ffi, spidermonkey,
- readline]
+ readline, libatomic]
pkg_dependencies = [glib, gobject, gthread, gio, gi, ffi, spidermonkey]
libraries_private = []