## START: Set by rpmautospec ## (rpmautospec version 0.3.0) %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 6; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Build HTML docs from markdown using pandoc? %bcond_without html_docs # Normally, treating warnings as errors is too strict for downstream builds. # It’s nice to be able to turn it on, though. %bcond_with werror Name: gn # Upstream uses the number of commits in the git history as the version number. # See gn --version, which outputs something like “1874 (2b683eff)”. The commit # position and short commit hash in this string come from “git describe HEAD # --match initial-commit”; see build/gen.py. This means that a complete git # checkout is required to establish the version number; the information is not # in the tarball! This is terribly inconvenient. See # https://bugs.chromium.org/p/gn/issues/detail?id=3. # # As a result, it is necessary to use our custom update-version script, # supplying the new full commit hash as the sole argument or providing no # arguments to select the latest commit. This will: # 1. Clone the git repository from the Internet (a substantial download) # 2. Run build/gen.py to generate last_commit_position.h, the header with # version information, and copy it into the same directory as the script # 3. Modify the commit and access macros and the Version field in this spec # file. # 4. Download the source tarball (spectool -g) # 5. Update the sources (fedpkg new-sources %%{commit}.tar.gz) # 6. Stage all changes in git # 7. Commit the changes # # See https://gn.googlesource.com/gn/+log for the latest changes. %global commit 5e19d2fb166fbd4f6f32147fbb2f497091a54ad8 %global access 20220714 %global shortcommit %(echo '%{commit}' | cut -b -12) %global position 2077 Version: %{position}^%{access}git%{shortcommit} Release: %autorelease Summary: Meta-build system that generates build files for Ninja # The entire source is BSD-3-Clause, except: # - src/base/third_party/icu/ is (Unicode AND ICU); see # src/base/third_party/icu/LICENSE and also the header comment in # src/base/third_party/icu/icu_utf.h. # # Note that src/util/test/gn_test.cc, which is licensed Apache-2.0, does not # contribute to the binary RPMs, only to the gn_unittests executable, which is # not installed; you may verify this with: # gdb -ex 'set pagination off' -ex 'info sources' gn | grep -F gn_test.cc License: BSD-3-Clause AND Unicode AND ICU URL: https://gn.googlesource.com/gn Source0: %{url}/+archive/%{commit}.tar.gz#/gn-%{shortcommit}.tar.gz # Generated using script update-version: Source1: last_commit_position.h Source2: update-version # Stop overriding optimization flags; not sent upstream because this is # intentional on their part Patch: gn-0153d369-no-O3.patch # Error: redundant move in return statement (GCC 13) # https://bugs.chromium.org/p/gn/issues/detail?id=318 Patch: gn-5e19d2fb166f-redundant-move.patch # Missing #include for uint8_t (GCC 13) # https://bugs.chromium.org/p/gn/issues/detail?id=319 Patch: gn-5e19d2fb166f-stdint.patch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: python3-devel BuildRequires: ninja-build BuildRequires: gcc-c++ # For RPM macros: BuildRequires: emacs-common %if %{with html_docs} BuildRequires: pandoc BuildRequires: parallel %endif BuildRequires: help2man Requires: vim-filesystem Requires: python3 Provides: vim-gn = %{version}-%{release} Requires: emacs-filesystem >= %{_emacs_version} Provides: emacs-gn = %{version}-%{release} # src/base/third_party/icu/icu_utf.h: # # This file has the relevant components from ICU copied to handle basic # UTF8/16/32 conversions. Components are copied from umachine.h, utf.h, # utf8.h, and utf16.h into icu_utf.h. # # The forked, bundled ICU components are copied from Chromium. Because of the # downstream changes (primarily, changing namespaces and symbol prefixes), # there is no clear path to unbundling. # # See src/base/third_party/icu/README.chromium, from which the version number # is taken. Provides: bundled(icu) = 60 %description GN is a meta-build system that generates build files for Ninja. %package doc Summary: Documentation for GN BuildArch: noarch %description doc The gn-doc package contains detailed documentation for GN. %prep %autosetup -c -n gn-%{commit} -p1 # Use pre-generated last_commit_position.h. mkdir -p ./out cp -vp '%{SOURCE1}' ./out # Copy and rename vim extensions readme for use in the main documentation # directory. cp -vp misc/vim/README.md README-vim.md # Fix shebangs in examples and such. %py3_shebang_fix . %build AR='gcc-ar'; export AR %set_build_flags # Both --use-icf and --use-lto add compiler flags that only work with clang++, # not with g++. We do get LTO on Fedora anyway, since we respect the # distribution’s build flags. %{python3} build/gen.py \ %{?!with_werror:--allow-warnings} \ --no-last-commit-position \ --no-strip \ --no-static-libstdc++ ninja -C out -v %if %{with html_docs} # There is a script, misc/help_as_html.py, that generates some HTML help, but # pandoc does a better job and we can cover more Markdown sources. find . -type f -name '*.md' | parallel -v pandoc -o '{.}.html' '{}' %endif help2man \ --name='%{summary}' \ --version-string="gn $(./out/gn --version)" \ --no-info \ ./out/gn | # Clean up a couple of stray binary bytes in the help output tr -d '\302\240' | # Format the entries within the sections as tagged paragraphs, and italicise # [placeholders in square brackets]. sed -r -e 's/(^[[:alnum:]_]+:)/.TP\n.B \1\n/' \ -e 's/\[([^]]+)\]/\\fI[\1]\\fR/g' > out/gn.1 %install install -t '%{buildroot}%{_bindir}' -D -p out/gn install -d '%{buildroot}%{_datadir}/vim/vimfiles' cp -vrp misc/vim/* '%{buildroot}%{_datadir}/vim/vimfiles' find '%{buildroot}%{_datadir}/vim/vimfiles' \ -type f -name 'README.*' -print -delete %py_byte_compile %{python3} '%{buildroot}%{_datadir}/vim/vimfiles/gn-format.py' install -t '%{buildroot}%{_emacs_sitestartdir}' -D -p -m 0644 misc/emacs/*.el install -t '%{buildroot}%{_mandir}/man1' -D -m 0644 -p out/gn.1 %check out/gn_unittests # Verify consistency of the version header with the spec file grep -E '^#define[[:blank:]]+LAST_COMMIT_POSITION_NUM[[:blank:]]+'\ '%{position}[[:blank:]]*' \ 'out/last_commit_position.h' >/dev/null grep -E '^#define[[:blank:]]+LAST_COMMIT_POSITION[[:blank:]]+'\ '"%{position} \(%{shortcommit}\)"[[:blank:]]*' \ 'out/last_commit_position.h' >/dev/null %files %license LICENSE %{_bindir}/gn %{_mandir}/man1/gn.1* %{_datadir}/vim/vimfiles/gn-format.py %{_datadir}/vim/vimfiles/autoload/gn.vim %{_datadir}/vim/vimfiles/ftdetect/gnfiletype.vim %{_datadir}/vim/vimfiles/ftplugin/gn.vim %{_datadir}/vim/vimfiles/syntax/gn.vim %{_emacs_sitestartdir}/gn-mode.el %files doc %license LICENSE src/base/third_party/icu/README.chromium %doc AUTHORS %doc OWNERS %doc README*.md %if %{with html_docs} %doc README*.html %endif %doc docs/ %doc examples/ %doc infra/ %doc tools/ %changelog * Thu Jan 19 2023 Benjamin A. Beasley 2077^20220714git5e19d2fb166f-6 - Add two patches for GCC 13 * Thu Jan 19 2023 Benjamin A. Beasley 2077^20220714git5e19d2fb166f-5 - Build without -Werror * Thu Jan 19 2023 Fedora Release Engineering 2077^20220714git5e19d2fb166f-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Tue Dec 20 2022 Benjamin A. Beasley 2077^20220714git5e19d2fb166f-3 - Leaf package: remove i686 support * Tue Dec 20 2022 Benjamin A. Beasley 2077^20220714git5e19d2fb166f-2 - Indicate dirs. in files list with trailing slashes * Wed Dec 14 2022 Benjamin A. Beasley 2077^20220714git5e19d2fb166f-1 - Update to version 2077 * Fri Dec 02 2022 Benjamin A. Beasley 2073^20220714git70d6c60823c0-1 - Update to version 2073 * Sun Nov 13 2022 Benjamin A. Beasley 2072^20220714git1c4151ff5c1d-1 - Update to version 2072 * Sat Oct 29 2022 Benjamin A. Beasley 2071^20220714gita4d67be044b4-1 - Update to version 2071 * Sat Oct 22 2022 Benjamin A. Beasley 2067^20220714git27b90626701a-1 - Update to version 2067 * Wed Oct 19 2022 Benjamin A. Beasley 2066^20220714git57c352b2b034-1 - Update to version 2066 * Sat Oct 08 2022 Benjamin A. Beasley 2065^20220714gitb9c6c19be95a-1 - Update to version 2065 * Tue Sep 20 2022 Benjamin A. Beasley 2064^20220714gitcc28efe62ef0-1 - Update to version 2064 * Sun Sep 11 2022 Benjamin A. Beasley 2059^20220714gitb4851eb2062f-1 - Update to version 2059 * Tue Sep 06 2022 Benjamin A. Beasley 2058^20220714git00b741b1568d-1 - Update to version 2058 * Tue Aug 30 2022 Benjamin A. Beasley 2057^20220714git5705e56a0e58-1 - Update to version 2057 * Sat Aug 13 2022 Benjamin A. Beasley 2056^20220714git0bcd37bd2b83-1 - Update to version 2056 * Thu Aug 04 2022 Benjamin A. Beasley 2051^20220714gitc8c63300ac8e-2 - Fix typo in SPDX expression * Wed Aug 03 2022 Benjamin A. Beasley 2051^20220714gitc8c63300ac8e-1 - Update to version 2051 * Wed Aug 03 2022 Benjamin A. Beasley 2050^20220714git9ef321772ecc-3 - Convert License to SPDX * Thu Jul 21 2022 Fedora Release Engineering 2050^20220714git9ef321772ecc-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Thu Jul 14 2022 Benjamin A. Beasley 2050^20220714git9ef321772ecc-1 - Update to version 2050 * Thu Jul 07 2022 Benjamin A. Beasley 2049^20220707git03ce92df-1 - Update to version 2049 * Thu Jun 23 2022 Benjamin A. Beasley 2047^20220623git29accf5a-1 - Update to version 2047 * Wed Jun 15 2022 Benjamin A. Beasley 2043^20220615gite62d4e19-1 - Update to version 2043 * Mon Jun 13 2022 Benjamin A. Beasley 2042^20220613git2ecd43a1-1 - Update to version 2042 * Wed Jun 08 2022 Benjamin A. Beasley 2041^20220608gitfd6cae41-1 - Update to version 2041 * Mon May 02 2022 Benjamin A. Beasley 2014^20220413gitc114b7e0-2 - Add patch upstream status for gn-0153d369-no-O3.patch * Sun May 01 2022 Benjamin A. Beasley 2014^20220413gitc114b7e0-1 - Handle snapshot info the “modern” way, in the Version * Sat Apr 30 2022 Benjamin A. Beasley 2014-3.20220413gitc114b7e0 - Improve handling of bundled ICU components * Sat Apr 16 2022 Benjamin A. Beasley 2014-2.20220413gitc114b7e0 - Stop numbering patches * Wed Apr 13 2022 Benjamin A. Beasley 2014-1.20220413gitc114b7e0 - Update to version 2014 * Thu Apr 07 2022 Benjamin A. Beasley 2011-1.20220407gitae110f8b - Update to version 2011 * Thu Mar 31 2022 Benjamin A. Beasley 1998-1.20220331git93f0d7a7 - Update to version 1998 * Mon Mar 21 2022 Benjamin A. Beasley 1985-1.20220321gitbd99dbf9 - Update to version 1985 * Mon Mar 14 2022 Benjamin A. Beasley 1983-1.20220314gitf27bae88 - Update to version 1983 * Fri Mar 04 2022 Benjamin A. Beasley 1977-1.20220304gitd7c2209c - Update to version 1977 * Tue Feb 22 2022 Benjamin A. Beasley 1975-1.20220222git6109f626 - Update to version 1975 * Sat Feb 12 2022 Benjamin A. Beasley 1972-2.20220212git377f566a - BR emacs-common for RPM macros * Sat Feb 12 2022 Benjamin A. Beasley 1972-1.20220212git377f566a - Update to version 1972 * Fri Feb 04 2022 Benjamin A. Beasley 1970-3.20220201git4b613b10 - Drop even the emacs-nox BR * Fri Feb 04 2022 Benjamin A. Beasley 1970-2.20220201git4b613b10 - BR emacs-nox instead of full emacs * Tue Feb 01 2022 Benjamin A. Beasley 1970-1.20220201git4b613b10 - Update to version 1970 * Thu Jan 20 2022 Fedora Release Engineering 1967-2.20220112git80a40b07 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Wed Jan 12 2022 Benjamin A. Beasley 1967-1.20220112git80a40b07 - Update to version 1967 * Fri Jan 07 2022 Benjamin A. Beasley 1966-1.20220107gitf1b14125 - Update to version 1966 * Wed Dec 22 2021 Benjamin A. Beasley 1961-1.20211222git281ba2c9 - Update to version 1961 * Wed Dec 15 2021 Benjamin A. Beasley 1959-1.20211215git2e56c317 - Update to version 1959 * Sat Dec 11 2021 Benjamin A. Beasley 1958-1.20211211gitd417bc7e - Update to version 1958 * Sun Dec 05 2021 Benjamin A. Beasley 1953-1.20211205gite0afadf7 - Update to version 1953 * Fri Dec 03 2021 Benjamin A. Beasley 1951-2.20211128gitb7903130 - Drop BR on python3, redundant with python3-devel * Sun Nov 28 2021 Benjamin A. Beasley 1951-1.20211128gitb7903130 - Update to version 1951 * Fri Nov 19 2021 Benjamin A. Beasley 1945-1.20211119git4aa9bdfa - Update to version 1945 * Tue Nov 16 2021 Benjamin A. Beasley 1944-1.20211116git18512455 - Update to version 1944 * Sun Nov 07 2021 Benjamin A. Beasley 1943-2.20211107git90294ccd - Drop “gcc cleanup” patch (finally upstreamed) * Sun Nov 07 2021 Benjamin A. Beasley 1943-1.20211107git90294ccd - Update to version 1943 * Tue Nov 02 2021 Benjamin A. Beasley 1942-1.20211102git8926696a - Update to version 1942 * Mon Oct 25 2021 Benjamin A. Beasley 1939-2.20211018git693f9fb8 - Use %%%%python3 macro instead of %%%%__python3 * Mon Oct 18 2021 Benjamin A. Beasley 1939-1.20211018git693f9fb8 - Update to version 1939 * Mon Sep 27 2021 Benjamin A. Beasley 1938-3.20210927git0153d369 - Reduce macro indirection in the spec file * Mon Sep 27 2021 Benjamin A. Beasley 1938-2.20210927git0153d369 - Correctly stop overriding optimization flags * Mon Sep 27 2021 Benjamin A. Beasley 1938-1.20210927git0153d369 - Update to version 1938 * Sun Sep 19 2021 Benjamin A. Beasley 1937-1.20210919gitde86ec41 - Update to version 1937 * Sat Sep 11 2021 Benjamin A. Beasley 1936-1.20210911git07e2e1b9 - Update to version 1936 (Fix typos in README.md) * Mon Sep 06 2021 Benjamin A. Beasley 1935-1.20210906git46b572ce - Update to version 1935 * Thu Aug 12 2021 Benjamin A. Beasley 1934-1.20210812git69ec4fca - Update to version 1934 * Tue Aug 03 2021 Benjamin A. Beasley 1931-1.20210803giteea3906f - Update to version 1931 * Thu Jul 22 2021 Fedora Release Engineering 1929-3.20210720gitd565aa3e - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Tue Jul 20 2021 Benjamin A. Beasley 1929-2.20210720gitd565aa3e - Drop workarounds for F32 and EPEL * Tue Jul 20 2021 Benjamin A. Beasley 1929-1.20210720gitd565aa3e - Update to version 1929 * Thu Jul 08 2021 Benjamin A. Beasley - 1924-1.20210708git24e2f7df - Update to version 1924 * Sun Jun 27 2021 Benjamin A. Beasley - 1921-1.20210627git4d207c94 - Update to version 1921 * Wed Jun 23 2021 Benjamin A. Beasley - 1920-1.20210623gitd924640c - Update to version 1920 - Stop overriding optimization flags * Tue Jun 22 2021 Benjamin A. Beasley - 1919-1.20210622gite9b84332 - Update to version 1919 * Wed Jun 16 2021 Benjamin A. Beasley - 1916-1.20210616gitd2dce752 - Update to version 1916 * Tue May 11 2021 Benjamin A. Beasley - 1910-2.20210511git39a87c0b - Rebase chromium-84.0.4147.105-gn-gcc-cleanup.patch as gn-39a87c0b-gcc-cleanup.patch * Tue May 11 2021 Benjamin A. Beasley - 1910-1.20210511git39a87c0b - Update to version 1910 * Sun May 02 2021 Benjamin A. Beasley - 1898-1.20210502git6771ce56 - Update to version 1898 * Sat Apr 10 2021 Benjamin A. Beasley - 1897-1.20210410gitdba01723 - Update to version 1897 * Tue Apr 06 2021 Benjamin A. Beasley - 1896-1.20210406gita95c8a3c - Update to version 1896 - Do not use %%exclude for unpackaged files (RPM 4.17 compatibility) * Mon Mar 29 2021 Benjamin A. Beasley - 1894-4.20210329gitb2e3d862 - Update to version 1894 * Wed Mar 17 2021 Benjamin A. Beasley - 1893-3.20210314git64b3b940 - Stop installing xemacs plugins (https://fedoraproject.org/wiki/Changes/Deprecate_xemacs) * Wed Mar 17 2021 Benjamin A. Beasley - 1893-2.20210314git64b3b940 - Improved source URL based on package review feedback * Mon Mar 1 2021 Benjamin A. Beasley - 1893-1.20210314git64b3b940 - Update to version 1893 * Mon Mar 1 2021 Benjamin A. Beasley - 1891-1.20210127gitdfcbc6fe - Update to version 1891 * Sun Jan 3 2021 Benjamin A. Beasley - 1884-1.20210127git94bda7cc - Update to version 1884 * Sun Jan 3 2021 Benjamin A. Beasley - 1876-1.20210103git0d67e272 - Update to version 1876 * Sat Dec 19 2020 Benjamin A. Beasley - 1875-1.20201219git4e260f1d - Initial spec file