-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
gn: modernize; add marcin-serwin and emilylange to maintainers; 0-unstable-2025-04-28 -> 0-unstable-2025-06-19 #419337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b0986e8
gn: merge generic and package
marcin-serwin 44f4405
gn: get revNum and revShort in src's postFetch
marcin-serwin ec54698
gn: drop "-unstable" suffix from pname
marcin-serwin d66400c
gn: run hooks in build phases
marcin-serwin 4f436a3
gn: remove with lib; from meta
marcin-serwin a760bcc
gn: add update script
marcin-serwin d654f14
gn: add marcin-serwin to maintainers
marcin-serwin e2e3860
gn: make src version overridable
marcin-serwin ab74600
chromium, electron: use override instead of overrideAttrs for gn
marcin-serwin e5a7616
electron: adapt updater to the new gn package
marcin-serwin 9b4cbad
chromium: adapt updater to the new gn package
marcin-serwin b59bfde
gn: 0-unstable-2025-04-28 -> 0-unstable-2025-06-19
marcin-serwin 4e3a8af
gn: remove outdated comment
marcin-serwin 1282ed5
gn: add emilylange to maintainers
marcin-serwin 28cefc6
gn: enable ninja verbose mode to show build progress
marcin-serwin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,102 @@ | ||
| { callPackage, ... }@args: | ||
| { | ||
| stdenv, | ||
| lib, | ||
| fetchgit, | ||
| cctools, | ||
| ninja, | ||
| python3, | ||
|
|
||
| callPackage ./generic.nix args { | ||
| # Note: Please use the recommended version for Chromium stable, i.e. from | ||
| # <nixpkgs>/pkgs/applications/networking/browsers/chromium/info.json | ||
| rev = "85cc21e94af590a267c1c7a47020d9b420f8a033"; | ||
| revNum = "2233"; # git describe $rev --match initial-commit | cut -d- -f3 | ||
| version = "2025-04-28"; | ||
| sha256 = "sha256-+nKP2hBUKIqdNfDz1vGggXSdCuttOt0GwyGUQ3Z1ZHI="; | ||
| version ? | ||
| # This is a workaround for update-source-version to be able to update this | ||
| let | ||
| _version = "0-unstable-2025-06-19"; | ||
| in | ||
| _version, | ||
| rev ? "97b68a0bb62b7528bc3491c7949d6804223c2b82", | ||
| hash ? "sha256-gwptzuirIdPAV9XCaAT09aM/fY7d6xgBU7oSu9C4tmE=", | ||
| }: | ||
|
|
||
| stdenv.mkDerivation { | ||
| pname = "gn"; | ||
| inherit version; | ||
|
|
||
| src = fetchgit { | ||
| url = "https://gn.googlesource.com/gn"; | ||
| inherit rev hash; | ||
| leaveDotGit = true; | ||
| deepClone = true; | ||
| postFetch = '' | ||
| cd "$out" | ||
| mkdir .nix-files | ||
| git rev-parse --short=12 HEAD > .nix-files/REV_SHORT | ||
| git describe --match initial-commit | cut -d- -f3 > .nix-files/REV_NUM | ||
| find "$out" -name .git -print0 | xargs -0 rm -rf | ||
| ''; | ||
| }; | ||
|
|
||
| nativeBuildInputs = [ | ||
| ninja | ||
| python3 | ||
| ]; | ||
| buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ | ||
| cctools | ||
| ]; | ||
|
|
||
| env.NIX_CFLAGS_COMPILE = "-Wno-error"; | ||
| # Relax hardening as otherwise gn unstable 2024-06-06 and later fail with: | ||
| # cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security] | ||
| hardeningDisable = [ "format" ]; | ||
|
|
||
| configurePhase = '' | ||
| runHook preConfigure | ||
marcin-serwin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| python build/gen.py --no-last-commit-position | ||
| cat > out/last_commit_position.h << EOF | ||
| #ifndef OUT_LAST_COMMIT_POSITION_H_ | ||
| #define OUT_LAST_COMMIT_POSITION_H_ | ||
|
|
||
| #define LAST_COMMIT_POSITION_NUM $(<.nix-files/REV_NUM) | ||
| #define LAST_COMMIT_POSITION "$(<.nix-files/REV_NUM) ($(<.nix-files/REV_SHORT))" | ||
|
|
||
| #endif // OUT_LAST_COMMIT_POSITION_H_ | ||
| EOF | ||
|
|
||
| runHook postConfigure | ||
| ''; | ||
|
|
||
| buildPhase = '' | ||
| runHook preBuild | ||
|
|
||
| ninja -v -j $NIX_BUILD_CORES -C out gn | ||
|
|
||
| runHook postBuild | ||
| ''; | ||
|
|
||
| installPhase = '' | ||
| runHook preInstall | ||
|
|
||
| install -vD out/gn "$out/bin/gn" | ||
|
|
||
| runHook postInstall | ||
| ''; | ||
|
|
||
| setupHook = ./setup-hook.sh; | ||
|
|
||
| passthru.updateScript = ./update.sh; | ||
|
|
||
| meta = { | ||
| description = "Meta-build system that generates build files for Ninja"; | ||
| mainProgram = "gn"; | ||
| homepage = "https://gn.googlesource.com/gn"; | ||
| license = lib.licenses.bsd3; | ||
| platforms = lib.platforms.unix; | ||
| maintainers = with lib.maintainers; [ | ||
marcin-serwin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| stesie | ||
| matthewbauer | ||
| marcin-serwin | ||
| emilylange | ||
| ]; | ||
| }; | ||
| } | ||
marcin-serwin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/usr/bin/env nix-shell | ||
| #!nix-shell -i bash -p jq curl common-updater-scripts | ||
|
|
||
| set -ex | ||
|
|
||
| rev=$( | ||
| curl --location "https://raw.githubusercontent.com/NixOS/nixpkgs/refs/heads/master/pkgs/applications/networking/browsers/chromium/info.json" \ | ||
| | jq -r ".chromium.deps.gn.rev" | ||
| ) | ||
|
|
||
| commit_time=$( | ||
| curl "https://gn.googlesource.com/gn/+/$rev?format=json" \ | ||
| | sed "s/)]}'//" \ | ||
| | jq -r ".committer.time" \ | ||
| | awk '{print $2, $3, $5, $4 $6}' | ||
| ) | ||
|
|
||
| commit_date=$(TZ= date --date "$commit_time" --iso-8601) | ||
| version="0-unstable-$commit_date" | ||
|
|
||
| update-source-version --rev="$rev" --version-key="_version" "gn" "$version" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.