* [PR PATCH] New package: mozjs115-115.6.0
@ 2024-01-20 2:46 chrysos349
2024-01-31 1:37 ` [PR PATCH] [Updated] " chrysos349
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: chrysos349 @ 2024-01-20 2:46 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 966 bytes --]
There is a new pull request by chrysos349 against master on the void-packages repository
https://github.com/chrysos349/void-packages mozjs115
https://github.com/void-linux/void-packages/pull/48295
New package: mozjs115-115.6.0
Required for the latest versions of `gjs`, which in turn is required for `gnome-45.0`
Based on the current `firefox{,-esr}` and `mozjs102` templates.
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl x
- armv7l x
- armv6l-musl x
A patch file from https://github.com/void-linux/void-packages/pull/48295.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mozjs115-48295.patch --]
[-- Type: text/x-diff, Size: 14671 bytes --]
From 8e051dac7514b0c18c52a1032d906c045a2380ec Mon Sep 17 00:00:00 2001
From: chrysos349 <chrysostom349@gmail.com>
Date: Sat, 20 Jan 2024 05:30:54 +0300
Subject: [PATCH] New package: mozjs115-115.6.0
---
common/shlibs | 1 +
srcpkgs/mozjs115-devel | 1 +
| 35 ++++
.../patches/disable-jit-for-arm.patch | 33 ++++
srcpkgs/mozjs115/patches/fix-soname.patch | 24 +++
srcpkgs/mozjs115/patches/rust-configure.patch | 112 +++++++++++++
srcpkgs/mozjs115/template | 154 ++++++++++++++++++
srcpkgs/mozjs115/update | 2 +
8 files changed, 362 insertions(+)
create mode 120000 srcpkgs/mozjs115-devel
create mode 100644 srcpkgs/mozjs115/patches/copy-headers.patch
create mode 100644 srcpkgs/mozjs115/patches/disable-jit-for-arm.patch
create mode 100644 srcpkgs/mozjs115/patches/fix-soname.patch
create mode 100644 srcpkgs/mozjs115/patches/rust-configure.patch
create mode 100644 srcpkgs/mozjs115/template
create mode 100644 srcpkgs/mozjs115/update
diff --git a/common/shlibs b/common/shlibs
index 9e6d29c73341e..c8f322a558306 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4271,3 +4271,4 @@ libsqsh.so.1 libsqsh-1.3.0_1
libunicode.so.0.4 libunicode-0.4.0_1
libunicode_ucd.so.0.4 libunicode-0.4.0_1
libunicode_loader.so.0.4 libunicode-0.4.0_1
+libmozjs-115.so.0 mozjs115-115.6.0_1
diff --git a/srcpkgs/mozjs115-devel b/srcpkgs/mozjs115-devel
new file mode 120000
index 0000000000000..9d8ba498685a5
--- /dev/null
+++ b/srcpkgs/mozjs115-devel
@@ -0,0 +1 @@
+mozjs115
\ No newline at end of file
--git a/srcpkgs/mozjs115/patches/copy-headers.patch b/srcpkgs/mozjs115/patches/copy-headers.patch
new file mode 100644
index 0000000000000..f533b26a12cb9
--- /dev/null
+++ b/srcpkgs/mozjs115/patches/copy-headers.patch
@@ -0,0 +1,35 @@
+From: Rico Tzschichholz <ricotz@ubuntu.com>
+Date: Wed, 5 Jul 2017 22:45:59 -0700
+Subject: build: Copy headers on install instead of symlinking
+
+Patch ported forward to mozjs52 by Philip Chimento
+<philip.chimento@gmail.com>.
+---
+ python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+index d92864d..ce8b05a 100644
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1532,9 +1532,9 @@ class RecursiveMakeBackend(MakeBackend):
+ " of srcdir-relative or absolute paths."
+ )
+
+- install_manifest.add_pattern_link(basepath, wild, dest_dir)
++ install_manifest.add_pattern_copy(basepath, wild, dest_dir)
+ else:
+- install_manifest.add_pattern_link(f.srcdir, f, dest_dir)
++ install_manifest.add_pattern_copy(f.srcdir, f, dest_dir)
+ elif isinstance(f, AbsolutePath):
+ if not f.full_path.lower().endswith((".dll", ".pdb", ".so")):
+ raise Exception(
+@@ -1545,7 +1545,7 @@ class RecursiveMakeBackend(MakeBackend):
+ install_manifest.add_optional_exists(dest_file)
+ absolute_files.append(f.full_path)
+ else:
+- install_manifest.add_link(f.full_path, dest_file)
++ install_manifest.add_copy(f.full_path, dest_file)
+ else:
+ install_manifest.add_optional_exists(dest_file)
+ objdir_files.append(self._pretty_path(f, backend_file))
diff --git a/srcpkgs/mozjs115/patches/disable-jit-for-arm.patch b/srcpkgs/mozjs115/patches/disable-jit-for-arm.patch
new file mode 100644
index 0000000000000..ca944f0aa114f
--- /dev/null
+++ b/srcpkgs/mozjs115/patches/disable-jit-for-arm.patch
@@ -0,0 +1,33 @@
+--- a/js/src/jit/shared/AtomicOperations-shared-jit.cpp
++++ b/js/src/jit/shared/AtomicOperations-shared-jit.cpp
+@@ -8,2 +8,4 @@
+
++#ifdef JS_HAVE_GENERATED_ATOMIC_OPS
++
+ #if defined(__arm__)
+@@ -12,4 +14,2 @@
+
+-#ifdef JS_HAVE_GENERATED_ATOMIC_OPS
+-
+ # include <atomic>
+only in patch2:
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -177,4 +177,4 @@
+ # =======================================================
+-@depends(target, "--enable-record-tuple")
+-def jit_default(target, enable_record_tuple):
++@depends(target, arm_target, "--enable-record-tuple")
++def jit_default(target, arm_target, enable_record_tuple):
+ if enable_record_tuple:
+@@ -184,3 +184,2 @@
+ "x86_64",
+- "arm",
+ "aarch64",
+@@ -191,2 +190,6 @@
+ return True
++
++ if target.cpu == "arm" and arm_target.arm_arch >= 7:
++ return True
++
+ return False
diff --git a/srcpkgs/mozjs115/patches/fix-soname.patch b/srcpkgs/mozjs115/patches/fix-soname.patch
new file mode 100644
index 0000000000000..b728fc0745bfd
--- /dev/null
+++ b/srcpkgs/mozjs115/patches/fix-soname.patch
@@ -0,0 +1,24 @@
+From: "Laszlo Boszormenyi (GCS)" <gcs@debian.org>
+Date: Fri, 2 May 2014 22:20:45 +0200
+Subject: fix soname
+
+Add soname switch to linker, regardless of Operating System
+
+Bug-Debian: http://bugs.debian.org/746705
+---
+ config/rules.mk | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/config/rules.mk b/config/rules.mk
+index 5cd9def..ce5ad30 100644
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -291,6 +291,8 @@ ifeq ($(OS_ARCH),GNU)
+ OS_CPPFLAGS += -DPATH_MAX=1024 -DMAXPATHLEN=1024
+ endif
+
++EXTRA_DSO_LDOPTS += -Wl,-soname,lib$(JS_LIBRARY_NAME).so.0
++
+ #
+ # MINGW32
+ #
diff --git a/srcpkgs/mozjs115/patches/rust-configure.patch b/srcpkgs/mozjs115/patches/rust-configure.patch
new file mode 100644
index 0000000000000..61fb2ba891d9a
--- /dev/null
+++ b/srcpkgs/mozjs115/patches/rust-configure.patch
@@ -0,0 +1,112 @@
+Mozilla rustc check does not support crossbuild: let's remove it
+Remove calls to unwrap_rustup, they fail if rustup isn't present
+
+Do not try to figure out the rust target as it is broken on musl
+instead use what is set in RUST_TARGET
+
+Skip extra checks on cross builds (broken for arm*)
+
+--- a/build/moz.configure/rust.configure 2020-12-12 01:35:33.000000000 +0100
++++ b/build/moz.configure/rust.configure 2020-12-15 19:45:16.467750787 +0100
+@@ -91,9 +91,6 @@
+ return unwrap
+
+
+-rustc = unwrap_rustup(rustc, "rustc")
+-cargo = unwrap_rustup(cargo, "cargo")
+-
+
+ set_config("CARGO", cargo)
+ set_config("RUSTC", rustc)
+@@ -260,7 +257,9 @@
+ data.setdefault(key, []).append(namespace(rust_target=t, target=info))
+ return data
+
+-
++@imports('os')
++@imports(_from='mozbuild.util', _import='ensure_unicode')
++@imports(_from='mozbuild.util', _import='system_encoding')
+ def detect_rustc_target(
+ host_or_target, compiler_info, arm_target, rust_supported_targets
+ ):
+@@ -382,12 +381,12 @@
+
+ return None
+
+- rustc_target = find_candidate(candidates)
++ rustc_target = os.environ['RUST_TARGET']
+
+ if rustc_target is None:
+ die("Don't know how to translate {} for rustc".format(host_or_target.alias))
+
+- return rustc_target
++ return ensure_unicode(rustc_target, system_encoding)
+
+
+ @imports("os")
+@@ -410,35 +409,6 @@
+
+ os.write(in_fd, ensure_binary(source))
+ os.close(in_fd)
+-
+- cmd = [
+- rustc,
+- "--crate-type",
+- "staticlib",
+- target_arg,
+- "-o",
+- out_path,
+- in_path,
+- ]
+-
+- def failed():
+- die(
+- dedent(
+- """\
+- Cannot compile for {} with {}
+- The target may be unsupported, or you may not have
+- a rust std library for that target installed. Try:
+-
+- rustup target add {}
+- """.format(
+- host_or_target.alias, rustc, rustc_target
+- )
+- )
+- )
+-
+- check_cmd_output(*cmd, onerror=failed)
+- if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+- failed()
+ finally:
+ os.remove(in_path)
+ os.remove(out_path)
+@@ -462,28 +432,7 @@
+ host, compiler_info, arm_target, rust_supported_targets
+ )
+ if rustc_target != rustc_host:
+- if host.alias == rustc_target:
+- configure_host = host.alias
+- else:
+- configure_host = "{}/{}".format(host.alias, rustc_target)
+- die(
+- dedent(
+- """\
+- The rust compiler host ({rustc}) is not suitable for the configure host ({configure}).
+-
+- You can solve this by:
+- * Set your configure host to match the rust compiler host by editing your
+- mozconfig and adding "ac_add_options --host={rustc}".
+- * Or, install the rust toolchain for {configure}, if supported, by running
+- "rustup default stable-{rustc_target}"
+- """.format(
+- rustc=rustc_host,
+- configure=configure_host,
+- rustc_target=rustc_target,
+- )
+- )
+- )
+- assert_rust_compile(host, rustc_target, rustc)
++ return rustc_host
+ return rustc_target
+
+
diff --git a/srcpkgs/mozjs115/template b/srcpkgs/mozjs115/template
new file mode 100644
index 0000000000000..1f5ccd03d90ba
--- /dev/null
+++ b/srcpkgs/mozjs115/template
@@ -0,0 +1,154 @@
+# Template file for 'mozjs115'
+pkgname=mozjs115
+version=115.6.0
+revision=1
+build_helper=rust
+hostmakedepends="cargo clang lld llvm m4 perl pkg-config python3.11 rust"
+makedepends="icu-devel nspr-devel readline-devel rust-std zlib-devel"
+short_desc="SpiderMonkey JavaScript interpreter and library (115.x)"
+maintainer="chrysos349 <chrysostom349@gmail.com>"
+license="MPL-2.0"
+homepage="https://spidermonkey.dev"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=66d7e6e5129ac8e6fe83e24227dc7bb8dc42650bc53b21838e614de80d22bc66
+
+do_build() {
+ ln -sf "/usr/bin/python3.11" "${XBPS_WRAPPERDIR}/python3"
+
+ export CC=clang
+ export CXX=clang++
+
+ if [ "$CROSS_BUILD" ]; then
+ mkdir -p wrapper
+
+ local gcc_version=$(gcc -dumpversion)
+ local clang_version=$(clang -dumpversion)
+
+ cat <<-! >"wrapper/${XBPS_TARGET_MACHINE}-clang"
+ #!/bin/sh
+ exec clang \
+ --target="${XBPS_CROSS_TRIPLET}" \
+ --gcc-toolchain=/usr \
+ --sysroot="${XBPS_CROSS_BASE}" \
+ -isystem "${XBPS_CROSS_BASE}/usr/include" \
+ -isystem "/usr/lib/clang/${clang_version}/include" \
+ "\$@"
+ !
+
+ cat <<-! >"wrapper/${XBPS_TARGET_MACHINE}-clang++"
+ #!/bin/sh
+ exec clang++ \
+ --target="${XBPS_CROSS_TRIPLET}" \
+ --gcc-toolchain=/usr \
+ --sysroot="${XBPS_CROSS_BASE}" \
+ -isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}" \
+ -isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}/${XBPS_CROSS_TRIPLET}" \
+ -isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}/backward" \
+ -isystem "${XBPS_CROSS_BASE}/usr/include" \
+ -isystem "/usr/lib/clang/${clang_version}/include" \
+ "\$@"
+ !
+
+ chmod +x wrapper/*
+
+ export PATH="${wrksrc}/wrapper:$PATH"
+ export CC=${XBPS_TARGET_MACHINE}-clang
+ export CXX=${XBPS_TARGET_MACHINE}-clang++
+ fi
+
+ export AR=llvm-ar
+ export NM=llvm-nm
+ export HOST_CC=clang
+ export HOST_CXX=clang++
+ export AS="${CC}"
+ export CFLAGS="-O2"
+ export CXXFLAGS="-O2"
+ export HOST_CFLAGS=""
+ export HOST_CXXFLAGS=""
+ export LDFLAGS="-Wl,-z,stack-size=1048576"
+
+ cat <<-! >.mozconfig
+ ac_add_options --enable-application=js
+ ac_add_options --prefix=/usr
+ ac_add_options --host=${XBPS_TRIPLET}
+ ac_add_options --target=${XBPS_CROSS_TRIPLET:-${XBPS_TRIPLET}}
+ ac_add_options --disable-bootstrap
+ ac_add_options --disable-debug
+ ac_add_options --disable-debug-symbols
+ ac_add_options --disable-jemalloc
+ ac_add_options --disable-strip
+ ac_add_options --enable-hardening
+ ac_add_options --enable-linker=lld
+ ac_add_options --enable-optimize="$CFLAGS"
+ ac_add_options --enable-release
+ mk_add_options MOZ_OBJDIR='${PWD}'/obj
+
+ ac_add_options --with-system-icu
+ ac_add_options --with-system-nspr
+ ac_add_options --with-system-zlib
+
+ ac_add_options --enable-readline
+ ac_add_options --enable-shared-js
+ ac_add_options --disable-tests
+ ac_add_options --with-intl-api
+ !
+
+ # disable simd for armhf/v7
+ case "$XBPS_TARGET_MACHINE" in
+ arm*) echo 'ac_add_options --disable-rust-simd' >> .mozconfig ;;
+ *) echo 'ac_add_options --enable-rust-simd' >> .mozconfig ;;
+ esac
+
+ export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
+ export MOZBUILD_STATE_PATH="${wrksrc}/mozbuild"
+ export MOZ_MAKE_FLAGS="${makejobs}"
+ export MOZ_NOSPAM=1
+ ./mach build
+}
+
+do_install() {
+ cd obj
+ make DESTDIR=${DESTDIR} install
+
+ # remove unneeded files
+ rm ${DESTDIR}/usr/lib/*.ajs
+ rm ${DESTDIR}/usr/bin/js115-config
+
+ # rename library, create symlinks
+ mv "${DESTDIR}"/usr/lib/libmozjs-115.so \
+ "${DESTDIR}"/usr/lib/libmozjs-115.so.0
+ ln -rs "${DESTDIR}"/usr/lib/libmozjs-115.so.0 \
+ "${DESTDIR}"/usr/lib/libmozjs-115.so
+}
+
+do_check() {
+ cat <<-! > known_failures.txt
+ non262/Intl/available-locales-supported.js
+ non262/Intl/available-locales-resolved.js
+ non262/Intl/supportedValuesOf-timeZones-canonical.js
+ non262/Intl/Collator/big5han-gb2312han.js
+ non262/Intl/Collator/implicithan.js
+ non262/Intl/DateTimeFormat/fractional-second-digits-append-item.js
+ non262/Intl/DateTimeFormat/day-period-hour-cycle.js
+ non262/Intl/DateTimeFormat/timeZone_backzone.js
+ !
+
+ export JSTESTS_EXTRA_ARGS="--format=none --exclude-random \
+ --wpt=disabled --exclude-file='${PWD}'/known_failures.txt"
+ export JITTEST_EXTRA_ARGS="--format=none --timeout 600"
+ export JITTEST_TEST_ARGS="basic"
+
+ cd obj
+ make -C js/src check-jstests check-jit-test
+}
+
+mozjs115-devel_package() {
+ depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+ short_desc+=" - development files"
+ pkg_install() {
+ vmove "usr/lib/*.so"
+ vmove usr/bin
+ vmove usr/include
+ vmove usr/lib/pkgconfig
+ }
+}
diff --git a/srcpkgs/mozjs115/update b/srcpkgs/mozjs115/update
new file mode 100644
index 0000000000000..61f68de4f42a5
--- /dev/null
+++ b/srcpkgs/mozjs115/update
@@ -0,0 +1,2 @@
+site="${MOZILLA_SITE}/firefox/releases/"
+pattern="[\d.]+(?=esr)"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PR PATCH] [Updated] New package: mozjs115-115.6.0
2024-01-20 2:46 [PR PATCH] New package: mozjs115-115.6.0 chrysos349
@ 2024-01-31 1:37 ` chrysos349
2024-01-31 1:38 ` chrysos349
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: chrysos349 @ 2024-01-31 1:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 971 bytes --]
There is an updated pull request by chrysos349 against master on the void-packages repository
https://github.com/chrysos349/void-packages mozjs115
https://github.com/void-linux/void-packages/pull/48295
New package: mozjs115-115.6.0
Required for the latest versions of `gjs`, which in turn is required for `gnome-45.0`
Based on the current `firefox{,-esr}` and `mozjs102` templates.
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl x
- armv7l x
- armv6l-musl x
A patch file from https://github.com/void-linux/void-packages/pull/48295.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mozjs115-48295.patch --]
[-- Type: text/x-diff, Size: 14671 bytes --]
From 2612ff48aa89e9760685e34e9aba37f44f4392f7 Mon Sep 17 00:00:00 2001
From: chrysos349 <chrysostom349@gmail.com>
Date: Sat, 20 Jan 2024 05:30:54 +0300
Subject: [PATCH] New package: mozjs115-115.7.0
---
common/shlibs | 1 +
srcpkgs/mozjs115-devel | 1 +
| 35 ++++
.../patches/disable-jit-for-arm.patch | 33 ++++
srcpkgs/mozjs115/patches/fix-soname.patch | 24 +++
srcpkgs/mozjs115/patches/rust-configure.patch | 112 +++++++++++++
srcpkgs/mozjs115/template | 154 ++++++++++++++++++
srcpkgs/mozjs115/update | 2 +
8 files changed, 362 insertions(+)
create mode 120000 srcpkgs/mozjs115-devel
create mode 100644 srcpkgs/mozjs115/patches/copy-headers.patch
create mode 100644 srcpkgs/mozjs115/patches/disable-jit-for-arm.patch
create mode 100644 srcpkgs/mozjs115/patches/fix-soname.patch
create mode 100644 srcpkgs/mozjs115/patches/rust-configure.patch
create mode 100644 srcpkgs/mozjs115/template
create mode 100644 srcpkgs/mozjs115/update
diff --git a/common/shlibs b/common/shlibs
index 9e6d29c73341e..b145bd3d6a859 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4271,3 +4271,4 @@ libsqsh.so.1 libsqsh-1.3.0_1
libunicode.so.0.4 libunicode-0.4.0_1
libunicode_ucd.so.0.4 libunicode-0.4.0_1
libunicode_loader.so.0.4 libunicode-0.4.0_1
+libmozjs-115.so.0 mozjs115-115.7.0_1
diff --git a/srcpkgs/mozjs115-devel b/srcpkgs/mozjs115-devel
new file mode 120000
index 0000000000000..9d8ba498685a5
--- /dev/null
+++ b/srcpkgs/mozjs115-devel
@@ -0,0 +1 @@
+mozjs115
\ No newline at end of file
--git a/srcpkgs/mozjs115/patches/copy-headers.patch b/srcpkgs/mozjs115/patches/copy-headers.patch
new file mode 100644
index 0000000000000..f533b26a12cb9
--- /dev/null
+++ b/srcpkgs/mozjs115/patches/copy-headers.patch
@@ -0,0 +1,35 @@
+From: Rico Tzschichholz <ricotz@ubuntu.com>
+Date: Wed, 5 Jul 2017 22:45:59 -0700
+Subject: build: Copy headers on install instead of symlinking
+
+Patch ported forward to mozjs52 by Philip Chimento
+<philip.chimento@gmail.com>.
+---
+ python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+index d92864d..ce8b05a 100644
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1532,9 +1532,9 @@ class RecursiveMakeBackend(MakeBackend):
+ " of srcdir-relative or absolute paths."
+ )
+
+- install_manifest.add_pattern_link(basepath, wild, dest_dir)
++ install_manifest.add_pattern_copy(basepath, wild, dest_dir)
+ else:
+- install_manifest.add_pattern_link(f.srcdir, f, dest_dir)
++ install_manifest.add_pattern_copy(f.srcdir, f, dest_dir)
+ elif isinstance(f, AbsolutePath):
+ if not f.full_path.lower().endswith((".dll", ".pdb", ".so")):
+ raise Exception(
+@@ -1545,7 +1545,7 @@ class RecursiveMakeBackend(MakeBackend):
+ install_manifest.add_optional_exists(dest_file)
+ absolute_files.append(f.full_path)
+ else:
+- install_manifest.add_link(f.full_path, dest_file)
++ install_manifest.add_copy(f.full_path, dest_file)
+ else:
+ install_manifest.add_optional_exists(dest_file)
+ objdir_files.append(self._pretty_path(f, backend_file))
diff --git a/srcpkgs/mozjs115/patches/disable-jit-for-arm.patch b/srcpkgs/mozjs115/patches/disable-jit-for-arm.patch
new file mode 100644
index 0000000000000..ca944f0aa114f
--- /dev/null
+++ b/srcpkgs/mozjs115/patches/disable-jit-for-arm.patch
@@ -0,0 +1,33 @@
+--- a/js/src/jit/shared/AtomicOperations-shared-jit.cpp
++++ b/js/src/jit/shared/AtomicOperations-shared-jit.cpp
+@@ -8,2 +8,4 @@
+
++#ifdef JS_HAVE_GENERATED_ATOMIC_OPS
++
+ #if defined(__arm__)
+@@ -12,4 +14,2 @@
+
+-#ifdef JS_HAVE_GENERATED_ATOMIC_OPS
+-
+ # include <atomic>
+only in patch2:
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -177,4 +177,4 @@
+ # =======================================================
+-@depends(target, "--enable-record-tuple")
+-def jit_default(target, enable_record_tuple):
++@depends(target, arm_target, "--enable-record-tuple")
++def jit_default(target, arm_target, enable_record_tuple):
+ if enable_record_tuple:
+@@ -184,3 +184,2 @@
+ "x86_64",
+- "arm",
+ "aarch64",
+@@ -191,2 +190,6 @@
+ return True
++
++ if target.cpu == "arm" and arm_target.arm_arch >= 7:
++ return True
++
+ return False
diff --git a/srcpkgs/mozjs115/patches/fix-soname.patch b/srcpkgs/mozjs115/patches/fix-soname.patch
new file mode 100644
index 0000000000000..b728fc0745bfd
--- /dev/null
+++ b/srcpkgs/mozjs115/patches/fix-soname.patch
@@ -0,0 +1,24 @@
+From: "Laszlo Boszormenyi (GCS)" <gcs@debian.org>
+Date: Fri, 2 May 2014 22:20:45 +0200
+Subject: fix soname
+
+Add soname switch to linker, regardless of Operating System
+
+Bug-Debian: http://bugs.debian.org/746705
+---
+ config/rules.mk | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/config/rules.mk b/config/rules.mk
+index 5cd9def..ce5ad30 100644
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -291,6 +291,8 @@ ifeq ($(OS_ARCH),GNU)
+ OS_CPPFLAGS += -DPATH_MAX=1024 -DMAXPATHLEN=1024
+ endif
+
++EXTRA_DSO_LDOPTS += -Wl,-soname,lib$(JS_LIBRARY_NAME).so.0
++
+ #
+ # MINGW32
+ #
diff --git a/srcpkgs/mozjs115/patches/rust-configure.patch b/srcpkgs/mozjs115/patches/rust-configure.patch
new file mode 100644
index 0000000000000..61fb2ba891d9a
--- /dev/null
+++ b/srcpkgs/mozjs115/patches/rust-configure.patch
@@ -0,0 +1,112 @@
+Mozilla rustc check does not support crossbuild: let's remove it
+Remove calls to unwrap_rustup, they fail if rustup isn't present
+
+Do not try to figure out the rust target as it is broken on musl
+instead use what is set in RUST_TARGET
+
+Skip extra checks on cross builds (broken for arm*)
+
+--- a/build/moz.configure/rust.configure 2020-12-12 01:35:33.000000000 +0100
++++ b/build/moz.configure/rust.configure 2020-12-15 19:45:16.467750787 +0100
+@@ -91,9 +91,6 @@
+ return unwrap
+
+
+-rustc = unwrap_rustup(rustc, "rustc")
+-cargo = unwrap_rustup(cargo, "cargo")
+-
+
+ set_config("CARGO", cargo)
+ set_config("RUSTC", rustc)
+@@ -260,7 +257,9 @@
+ data.setdefault(key, []).append(namespace(rust_target=t, target=info))
+ return data
+
+-
++@imports('os')
++@imports(_from='mozbuild.util', _import='ensure_unicode')
++@imports(_from='mozbuild.util', _import='system_encoding')
+ def detect_rustc_target(
+ host_or_target, compiler_info, arm_target, rust_supported_targets
+ ):
+@@ -382,12 +381,12 @@
+
+ return None
+
+- rustc_target = find_candidate(candidates)
++ rustc_target = os.environ['RUST_TARGET']
+
+ if rustc_target is None:
+ die("Don't know how to translate {} for rustc".format(host_or_target.alias))
+
+- return rustc_target
++ return ensure_unicode(rustc_target, system_encoding)
+
+
+ @imports("os")
+@@ -410,35 +409,6 @@
+
+ os.write(in_fd, ensure_binary(source))
+ os.close(in_fd)
+-
+- cmd = [
+- rustc,
+- "--crate-type",
+- "staticlib",
+- target_arg,
+- "-o",
+- out_path,
+- in_path,
+- ]
+-
+- def failed():
+- die(
+- dedent(
+- """\
+- Cannot compile for {} with {}
+- The target may be unsupported, or you may not have
+- a rust std library for that target installed. Try:
+-
+- rustup target add {}
+- """.format(
+- host_or_target.alias, rustc, rustc_target
+- )
+- )
+- )
+-
+- check_cmd_output(*cmd, onerror=failed)
+- if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+- failed()
+ finally:
+ os.remove(in_path)
+ os.remove(out_path)
+@@ -462,28 +432,7 @@
+ host, compiler_info, arm_target, rust_supported_targets
+ )
+ if rustc_target != rustc_host:
+- if host.alias == rustc_target:
+- configure_host = host.alias
+- else:
+- configure_host = "{}/{}".format(host.alias, rustc_target)
+- die(
+- dedent(
+- """\
+- The rust compiler host ({rustc}) is not suitable for the configure host ({configure}).
+-
+- You can solve this by:
+- * Set your configure host to match the rust compiler host by editing your
+- mozconfig and adding "ac_add_options --host={rustc}".
+- * Or, install the rust toolchain for {configure}, if supported, by running
+- "rustup default stable-{rustc_target}"
+- """.format(
+- rustc=rustc_host,
+- configure=configure_host,
+- rustc_target=rustc_target,
+- )
+- )
+- )
+- assert_rust_compile(host, rustc_target, rustc)
++ return rustc_host
+ return rustc_target
+
+
diff --git a/srcpkgs/mozjs115/template b/srcpkgs/mozjs115/template
new file mode 100644
index 0000000000000..98ec034d5feb3
--- /dev/null
+++ b/srcpkgs/mozjs115/template
@@ -0,0 +1,154 @@
+# Template file for 'mozjs115'
+pkgname=mozjs115
+version=115.7.0
+revision=1
+build_helper=rust
+hostmakedepends="cargo clang lld llvm m4 perl pkg-config python3.11 rust"
+makedepends="icu-devel nspr-devel readline-devel rust-std zlib-devel"
+short_desc="SpiderMonkey JavaScript interpreter and library (115.x)"
+maintainer="chrysos349 <chrysostom349@gmail.com>"
+license="MPL-2.0"
+homepage="https://spidermonkey.dev"
+distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"
+checksum=13edffcd3ce9ff485eafe84ad256794a8ca3ca91fe06e5ed4df8e008c157a429
+
+do_build() {
+ ln -sf "/usr/bin/python3.11" "${XBPS_WRAPPERDIR}/python3"
+
+ export CC=clang
+ export CXX=clang++
+
+ if [ "$CROSS_BUILD" ]; then
+ mkdir -p wrapper
+
+ local gcc_version=$(gcc -dumpversion)
+ local clang_version=$(clang -dumpversion)
+
+ cat <<-! >"wrapper/${XBPS_TARGET_MACHINE}-clang"
+ #!/bin/sh
+ exec clang \
+ --target="${XBPS_CROSS_TRIPLET}" \
+ --gcc-toolchain=/usr \
+ --sysroot="${XBPS_CROSS_BASE}" \
+ -isystem "${XBPS_CROSS_BASE}/usr/include" \
+ -isystem "/usr/lib/clang/${clang_version}/include" \
+ "\$@"
+ !
+
+ cat <<-! >"wrapper/${XBPS_TARGET_MACHINE}-clang++"
+ #!/bin/sh
+ exec clang++ \
+ --target="${XBPS_CROSS_TRIPLET}" \
+ --gcc-toolchain=/usr \
+ --sysroot="${XBPS_CROSS_BASE}" \
+ -isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}" \
+ -isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}/${XBPS_CROSS_TRIPLET}" \
+ -isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}/backward" \
+ -isystem "${XBPS_CROSS_BASE}/usr/include" \
+ -isystem "/usr/lib/clang/${clang_version}/include" \
+ "\$@"
+ !
+
+ chmod +x wrapper/*
+
+ export PATH="${wrksrc}/wrapper:$PATH"
+ export CC=${XBPS_TARGET_MACHINE}-clang
+ export CXX=${XBPS_TARGET_MACHINE}-clang++
+ fi
+
+ export AR=llvm-ar
+ export NM=llvm-nm
+ export HOST_CC=clang
+ export HOST_CXX=clang++
+ export AS="${CC}"
+ export CFLAGS="-O2"
+ export CXXFLAGS="-O2"
+ export HOST_CFLAGS=""
+ export HOST_CXXFLAGS=""
+ export LDFLAGS="-Wl,-z,stack-size=1048576"
+
+ cat <<-! >.mozconfig
+ ac_add_options --enable-application=js
+ ac_add_options --prefix=/usr
+ ac_add_options --host=${XBPS_TRIPLET}
+ ac_add_options --target=${XBPS_CROSS_TRIPLET:-${XBPS_TRIPLET}}
+ ac_add_options --disable-bootstrap
+ ac_add_options --disable-debug
+ ac_add_options --disable-debug-symbols
+ ac_add_options --disable-jemalloc
+ ac_add_options --disable-strip
+ ac_add_options --enable-hardening
+ ac_add_options --enable-linker=lld
+ ac_add_options --enable-optimize="$CFLAGS"
+ ac_add_options --enable-release
+ mk_add_options MOZ_OBJDIR='${PWD}'/obj
+
+ ac_add_options --with-system-icu
+ ac_add_options --with-system-nspr
+ ac_add_options --with-system-zlib
+
+ ac_add_options --enable-readline
+ ac_add_options --enable-shared-js
+ ac_add_options --disable-tests
+ ac_add_options --with-intl-api
+ !
+
+ # disable simd for armhf/v7
+ case "$XBPS_TARGET_MACHINE" in
+ arm*) echo 'ac_add_options --disable-rust-simd' >> .mozconfig ;;
+ *) echo 'ac_add_options --enable-rust-simd' >> .mozconfig ;;
+ esac
+
+ export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
+ export MOZBUILD_STATE_PATH="${wrksrc}/mozbuild"
+ export MOZ_MAKE_FLAGS="${makejobs}"
+ export MOZ_NOSPAM=1
+ ./mach build
+}
+
+do_install() {
+ cd obj
+ make DESTDIR=${DESTDIR} install
+
+ # remove unneeded files
+ rm ${DESTDIR}/usr/lib/*.ajs
+ rm ${DESTDIR}/usr/bin/js115-config
+
+ # rename library, create symlinks
+ mv "${DESTDIR}"/usr/lib/libmozjs-115.so \
+ "${DESTDIR}"/usr/lib/libmozjs-115.so.0
+ ln -rs "${DESTDIR}"/usr/lib/libmozjs-115.so.0 \
+ "${DESTDIR}"/usr/lib/libmozjs-115.so
+}
+
+do_check() {
+ cat <<-! > known_failures.txt
+ non262/Intl/available-locales-supported.js
+ non262/Intl/available-locales-resolved.js
+ non262/Intl/supportedValuesOf-timeZones-canonical.js
+ non262/Intl/Collator/big5han-gb2312han.js
+ non262/Intl/Collator/implicithan.js
+ non262/Intl/DateTimeFormat/fractional-second-digits-append-item.js
+ non262/Intl/DateTimeFormat/day-period-hour-cycle.js
+ non262/Intl/DateTimeFormat/timeZone_backzone.js
+ !
+
+ export JSTESTS_EXTRA_ARGS="--format=none --exclude-random \
+ --wpt=disabled --exclude-file='${PWD}'/known_failures.txt"
+ export JITTEST_EXTRA_ARGS="--format=none --timeout 600"
+ export JITTEST_TEST_ARGS="basic"
+
+ cd obj
+ make -C js/src check-jstests check-jit-test
+}
+
+mozjs115-devel_package() {
+ depends="nspr-devel ${sourcepkg}>=${version}_${revision}"
+ short_desc+=" - development files"
+ pkg_install() {
+ vmove "usr/lib/*.so"
+ vmove usr/bin
+ vmove usr/include
+ vmove usr/lib/pkgconfig
+ }
+}
diff --git a/srcpkgs/mozjs115/update b/srcpkgs/mozjs115/update
new file mode 100644
index 0000000000000..61f68de4f42a5
--- /dev/null
+++ b/srcpkgs/mozjs115/update
@@ -0,0 +1,2 @@
+site="${MOZILLA_SITE}/firefox/releases/"
+pattern="[\d.]+(?=esr)"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New package: mozjs115-115.6.0
2024-01-20 2:46 [PR PATCH] New package: mozjs115-115.6.0 chrysos349
2024-01-31 1:37 ` [PR PATCH] [Updated] " chrysos349
@ 2024-01-31 1:38 ` chrysos349
2024-02-16 0:36 ` New package: mozjs115-115.7.0 chrysos349
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: chrysos349 @ 2024-01-31 1:38 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 165 bytes --]
New comment by chrysos349 on void-packages repository
https://github.com/void-linux/void-packages/pull/48295#issuecomment-1918207089
Comment:
updated to `115.7.0`
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New package: mozjs115-115.7.0
2024-01-20 2:46 [PR PATCH] New package: mozjs115-115.6.0 chrysos349
2024-01-31 1:37 ` [PR PATCH] [Updated] " chrysos349
2024-01-31 1:38 ` chrysos349
@ 2024-02-16 0:36 ` chrysos349
2024-02-16 2:48 ` oreo639
2024-03-05 5:56 ` [PR PATCH] [Closed]: " chrysos349
4 siblings, 0 replies; 6+ messages in thread
From: chrysos349 @ 2024-02-16 0:36 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 306 bytes --]
New comment by chrysos349 on void-packages repository
https://github.com/void-linux/void-packages/pull/48295#issuecomment-1947562217
Comment:
@oreo639 btw, could you explain to me why this template is not good enough that you decided it's better to create your own instead of helping me finish this one?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New package: mozjs115-115.7.0
2024-01-20 2:46 [PR PATCH] New package: mozjs115-115.6.0 chrysos349
` (2 preceding siblings ...)
2024-02-16 0:36 ` New package: mozjs115-115.7.0 chrysos349
@ 2024-02-16 2:48 ` oreo639
2024-03-05 5:56 ` [PR PATCH] [Closed]: " chrysos349
4 siblings, 0 replies; 6+ messages in thread
From: oreo639 @ 2024-02-16 2:48 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/48295#issuecomment-1947676479
Comment:
> btw, could you explain to me why this template is not good enough that you decided it's better to create your own instead of helping me finish this one?
This drops a lot of patches from mozjs102 that are still desirable. The configure setup is unnecessarily complicated. There is a `./configure` python script in the `js/src` folder which can be used to configure spidermonkey. I also made it work with python3.12 (which I also did for mozjs102), since the only real issue is an outdated bundled library. This PR also dropped the stacksize change, which is necessary for musl. I also wanted to try using gnome-builder 45 which requires gjs 1.78 so I ended up making a separate one myself. I did end up removing the MOZ_NO_RUST_LTO define as you did here since it doesn't appear to be necessary to avoid compile errors anymore. Sorry for being disrespectful, that wasn't my intention.
https://github.com/oreo639/void-packages/tree/gnome-builder
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PR PATCH] [Closed]: New package: mozjs115-115.7.0
2024-01-20 2:46 [PR PATCH] New package: mozjs115-115.6.0 chrysos349
` (3 preceding siblings ...)
2024-02-16 2:48 ` oreo639
@ 2024-03-05 5:56 ` chrysos349
4 siblings, 0 replies; 6+ messages in thread
From: chrysos349 @ 2024-03-05 5:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 808 bytes --]
There's a closed pull request on the void-packages repository
New package: mozjs115-115.7.0
https://github.com/void-linux/void-packages/pull/48295
Description:
Required for the latest versions of `gjs`, which in turn is required for `gnome-45.0`
Based on the current `firefox{,-esr}` and `mozjs102` templates.
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl x
- armv7l x
- armv6l-musl x
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-03-05 5:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-20 2:46 [PR PATCH] New package: mozjs115-115.6.0 chrysos349
2024-01-31 1:37 ` [PR PATCH] [Updated] " chrysos349
2024-01-31 1:38 ` chrysos349
2024-02-16 0:36 ` New package: mozjs115-115.7.0 chrysos349
2024-02-16 2:48 ` oreo639
2024-03-05 5:56 ` [PR PATCH] [Closed]: " chrysos349
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).