SHA256
1
0
forked from javascript/quickjs
Files
quickjs/quickjs.spec
Michal Suchanek 405dbfe9e5 Update to version 20250913+git83.bc629c8
(upstream git snapshot + cherry-picked fixes)
2026-02-16 13:04:36 +01:00

81 lines
2.0 KiB
RPMSpec

#
# spec file for package quickjs
#
# Copyright (c) 2026 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%if 0%{?suse_version} && 0%{?suse_version} < 1500
%define compiler CC=gcc-7
# /usr/include/c++/12/stdatomic.h
BuildRequires: gcc7-c++
%else
BuildRequires: gcc-c++
%endif
Name: quickjs
Version: 20250913+git83.bc629c8
Release: 0
Summary: Small and embeddable Javascript engine
License: MIT
URL: https://bellard.org/quickjs/
Source0: %{name}-%{version}.tar.xz
BuildRequires: make
%description
QuickJS is a small and embeddable JavaScript engine and compiler that supports reference ES2020.
%package docs
BuildArch: noarch
Summary: Documentation for quickjs
%description docs
Documentation for quickjs
%package devel
Summary: Development headers for quickjs
%description devel
Development headers for quickjs
%prep
%setup -q -n %{name}-%{version}
# inject optflags (cannot be passed normally to build)
cat >> "./Makefile" <<-EOF
CFLAGS += %{optflags} -ffat-lto-objects
LDFLAGS += %{optflags}
EOF
%build
%make_build PREFIX=%{_prefix}
%install
%make_install PREFIX=%{_prefix}
#remove extraneous binary
rm -f %{buildroot}%{_prefix}/lib/quickjs/libquickjs.lto.a
%files
%license LICENSE
%{_bindir}/qjs
%{_bindir}/qjsc
%dir %{_prefix}/lib/%{name}
%files devel
%{_includedir}/%{name}
%{_prefix}/lib/quickjs/libquickjs.a
%files docs
%doc doc
%changelog