2 # spec file for package gn
4 # Copyright (c) 2020 SUSE LLC
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
15 # Please submit bugfixes or comments via https://bugs.opensuse.org/
21 Summary: A meta-build system that generates build files for Ninja
23 URL: https://gn.googlesource.com/
24 #Source: https://dev.gentoo.org/~floppym/dist/%{name}-%{version}.tar.xz
25 Source0: %{name}-%{version}.tar.gz
26 Source1001: gn.manifest
27 BuildRequires: gcc-c++
29 BuildRequires: python3-base
30 Requires(post): /sbin/ldconfig
31 Requires(postun): /sbin/ldconfig
34 GN is a meta-build system that generates build files for Ninja.
44 export CXXFLAGS="%{optflags}"
47 python3 build/gen.py \
49 --no-last-commit-position \
52 cat >out/last_commit_position.h <<-EOF
53 #ifndef OUT_LAST_COMMIT_POSITION_H_
54 #define OUT_LAST_COMMIT_POSITION_H_
55 #define LAST_COMMIT_POSITION_NUM ${PV##0.}
56 #define LAST_COMMIT_POSITION "${PV}"
57 #endif // OUT_LAST_COMMIT_POSITION_H_
60 ninja -C out %{?_smp_mflags} gn
63 ninja -C out %{?_smp_mflags} gn_unittests
67 install -Dm 0755 out/%{name} %{buildroot}%{_bindir}/%{name}