%global dev bellard %global year 2026 %global month 06 %global date 04 # Upstream tarball uses hyphens: quickjs-2026-06-04.tar.xz # %%define ver %(echo %{version} | sed -e 's,\\.,-,g') Name: quickjs Version: %{year}.%{month}.%{date} Release: 0%{?dist} Summary: Small and embeddable JavaScript engine License: MIT URL: https://%{dev}.org/%{name} Source: %{url}/%{name}-%{year}-%{month}-%{date}.tar.xz BuildRequires: gcc BuildRequires: make %description QuickJS is a small and embeddable Javascript engine. It supports the ES2025 specification. Main Features: - Small and easily embeddable: just a few C files, no external dependency, 367 KiB of x86 code for a simple hello world program. - Fast interpreter with very low startup time: runs the ECMAScript Test Suite in about 2 minutes on a single core of a desktop PC. The complete life cycle of a runtime instance completes in less than 300 microseconds. - Almost complete ES2025 support including modules, asynchronous generators and full Annex B support (legacy web compatibility). - Passes nearly 100% of the ECMAScript Test Suite tests when selecting the ES2025 features (see test262.fyi). - Can compile Javascript sources to executables with no external dependency. - Garbage collection using reference counting (to reduce memory usage and have deterministic behavior) with cycle removal. - Command line interpreter with contextual colorization implemented in Javascript. - Small built-in standard library with C library wrappers. %files %license LICENSE %doc doc examples %{_bindir}/qjs* #------------------------------------------------------------------ %package devel Summary: Development files for QuickJS Requires: %name == %{version}-%{release} %description devel %summary %files devel %{_includedir}/%{name} #------------------------------------------------------------------ %package static Summary: Static libraries for QuickJS Requires: %name == %{version}-%{release} %description static %summary %files static %{_libdir}/%{name} #------------------------------------------------------------------ %prep %autosetup -n %{name}-%{year}-%{month}-%{date} sed -i 's|lib/quickjs|%{_lib}/quickjs|' Makefile qjsc.c sed -i 's|/usr/local|%{_prefix}|g' Makefile # inject optflags (cannot be passed normally to build) cat >> "./Makefile" <<-EOF CFLAGS += %{optflags} -fPIC -ffat-lto-objects LDFLAGS += %{optflags} EOF %build %make_build PREFIX=%{_prefix} %install %make_install PREFIX=%{_prefix} INSTALL_ROOT=%{buildroot} # install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}" "${_pv}"/doc/*.* # # # Fixup permissions # chmod 644 %{buildroot}%{_libdir}/%{name}/lib%{name}*.a %changelog * Sat Oct 24 2026 Hazel Bunny - 26.06.04-0 - initial package