Merge master into staging-next

This commit is contained in:
nixpkgs-ci[bot]
2025-11-05 06:06:46 +00:00
committed by GitHub
57 changed files with 2130 additions and 836 deletions
+6 -5
View File
@@ -48,7 +48,8 @@ let
programs.actionlint.enable = true;
programs.biome = {
enable = true;
# FIXME: Disabled temporarily due to https://github.com/numtide/treefmt-nix/pull/430
enable = false;
settings.formatter = {
useEditorconfig = true;
};
@@ -58,10 +59,10 @@ let
};
settings.json.formatter.enabled = false;
};
settings.formatter.biome.excludes = [
"*.min.js"
"pkgs/*"
];
# settings.formatter.biome.excludes = [
# "*.min.js"
# "pkgs/*"
# ];
programs.keep-sorted.enable = true;
-6
View File
@@ -20018,12 +20018,6 @@
githubId = 6498458;
name = "pebble kite";
};
pbogdan = {
email = "ppbogdan@gmail.com";
github = "pbogdan";
githubId = 157610;
name = "Piotr Bogdan";
};
pborzenkov = {
email = "pavel@borzenkov.net";
github = "pborzenkov";
@@ -193,8 +193,6 @@ python3.pkgs.buildPythonApplication rec {
'';
homepage = "https://quodlibet.readthedocs.io/en/latest";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [
pbogdan
];
maintainers = [ ];
};
}
@@ -1,46 +0,0 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
gtk2,
SDL,
nasm,
zlib,
libpng,
libGLU,
libGL,
}:
stdenv.mkDerivation rec {
pname = "gens-gs";
version = "7";
src = fetchurl {
url = "http://retrocdn.net/images/6/6d/Gens-gs-r${version}.tar.gz";
sha256 = "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
gtk2
SDL
nasm
zlib
libpng
libGLU
libGL
];
# Work around build failures on recent GTK.
# See http://ubuntuforums.org/showthread.php?p=10535837
env.NIX_CFLAGS_COMPILE = "-UGTK_DISABLE_DEPRECATED -UGSEAL_ENABLE";
meta = with lib; {
homepage = "https://segaretro.org/Gens/GS";
description = "Genesis/Mega Drive emulator";
platforms = [ "i686-linux" ];
license = licenses.gpl2Plus;
maintainers = [ ];
};
}
@@ -687,11 +687,11 @@
"vendorHash": "sha256-47xWjlzpQ/EYzjbuuMKQiu5cfYAXdYkXRl+AOEP+sA4="
},
"heroku_heroku": {
"hash": "sha256-VGx2J7huF05HU/59Hyo2rxwV3SR+kVJWtrfWoRmln2o=",
"hash": "sha256-hR4DvSneqG/5P4tYljcuFxQ34AnDIjIt+JMn1BhloeU=",
"homepage": "https://registry.terraform.io/providers/heroku/heroku",
"owner": "heroku",
"repo": "terraform-provider-heroku",
"rev": "v5.3.1",
"rev": "v5.3.2",
"spdx": "MPL-2.0",
"vendorHash": null
},
+2 -18
View File
@@ -3,7 +3,6 @@
lib,
fetchFromGitHub,
fetchzip,
fetchpatch,
autoconf,
automake,
libtool,
@@ -245,31 +244,16 @@ stdenv.mkDerivation (
in
{
pname = "kodi";
version = "21.2";
version = "21.3";
kodiReleaseName = "Omega";
src = fetchFromGitHub {
owner = "xbmc";
repo = "xbmc";
rev = "${finalAttrs.version}-${finalAttrs.kodiReleaseName}";
hash = "sha256-RdTJcq6FPerQx05dU3r8iyaorT4L7162hg5RdywsA88=";
hash = "sha256-36wBAqGEDCRZ4t1ygTg03Pyk7Gg9quUTUGD3SBp6nCk=";
};
patches = [
# Backport to fix build with Pipewire 1.4
# FIXME: remove in the next update
(fetchpatch {
url = "https://github.com/xbmc/xbmc/commit/269053ebbfd3cc4a3156a511f54ab7f08a09a730.patch";
hash = "sha256-JzzrMJvAufrxTxtWnzknUS9JLJEed+qdtVnIYYe9LCw=";
})
# Backport to fix build with cURL 8.16
# FIXME: remove in the next update
(fetchpatch {
url = "https://github.com/xbmc/xbmc/commit/957b4faa0b765bc91e64c6d33f07e853decae0d0.patch";
hash = "sha256-zsqcZSjsApcgs/oEdFFlcwldGCVZxCsDG02ogs+q2uw=";
})
];
# make derivations declared in the let binding available here, so
# they can be overridden
inherit
+33 -23
View File
@@ -20,6 +20,21 @@ let
appendShort = lib.optionalString ((builtins.match "[a-f0-9]*" rev) != null) "-${shortRev}";
in
"${lib.sources.urlToName url}${if append == "" then appendShort else append}";
getRevWithTag =
{
rev ? null,
tag ? null,
}:
if tag != null && rev != null then
throw "fetchgit requires one of either `rev` or `tag` to be provided (not both)."
else if tag != null then
"refs/tags/${tag}"
else if rev != null then
rev
else
# FIXME fetching HEAD if no rev or tag is provided is problematic at best
"HEAD";
in
lib.makeOverridable (
@@ -27,8 +42,8 @@ lib.makeOverridable (
constructDrv = stdenvNoCC.mkDerivation;
excludeDrvArgNames = [
# Passed via `passthru`
"tag"
# Additional stdenv.mkDerivation arguments from derived fetchers.
"derivationArgs"
# Hashes, handled by `lib.fetchers.withNormalizedHash`
# whose outputs contain outputHash* attributes.
@@ -47,7 +62,7 @@ lib.makeOverridable (
rev ? null,
name ? urlToName {
inherit url;
rev = lib.revOrTag rev tag;
rev = lib.revOrTag finalAttrs.revCustom finalAttrs.tag;
# when rootDir is specified, avoid invalidating the result when rev changes
append = if rootDir != "" then "-${lib.strings.sanitizeDerivationName rootDir}" else "";
},
@@ -84,6 +99,10 @@ lib.makeOverridable (
rootDir ? "",
# GIT_CONFIG_GLOBAL (as a file)
gitConfigFile ? config.gitConfigFile,
# Additional stdenvNoCC.mkDerivation arguments.
# It is typically for derived fetchers to pass down additional arguments,
# and the specified arguments have lower precedence than other mkDerivation arguments.
derivationArgs ? { },
}:
/*
@@ -113,29 +132,13 @@ lib.makeOverridable (
assert fetchTags -> leaveDotGit;
assert rootDir != "" -> !leaveDotGit;
let
revWithTag =
let
warningMsg = "fetchgit requires one of either `rev` or `tag` to be provided (not both).";
otherIsNull = other: lib.assertMsg (other == null) warningMsg;
in
if tag != null then
assert (otherIsNull rev);
"refs/tags/${tag}"
else if rev != null then
assert (otherIsNull tag);
rev
else
# FIXME fetching HEAD if no rev or tag is provided is problematic at best
"HEAD";
in
if builtins.isString sparseCheckout then
# Changed to throw on 2023-06-04
throw
"Please provide directories/patterns for sparse checkout as a list of strings. Passing a (multi-line) string is not supported any more."
else
{
derivationArgs
// {
inherit name;
builder = ./builder.sh;
@@ -170,7 +173,12 @@ lib.makeOverridable (
rootDir
gitConfigFile
;
rev = revWithTag;
inherit tag;
revCustom = rev;
rev = getRevWithTag {
inherit (finalAttrs) tag;
rev = finalAttrs.revCustom;
};
postHook =
if netrcPhase == null then
@@ -210,7 +218,6 @@ lib.makeOverridable (
passthru = {
gitRepoUrl = url;
inherit tag;
}
// passthru;
}
@@ -220,3 +227,6 @@ lib.makeOverridable (
inheritFunctionArgs = false;
}
)
// {
inherit getRevWithTag;
}
+32 -11
View File
@@ -11,7 +11,8 @@ lib.makeOverridable (
repo,
tag ? null,
rev ? null,
name ? repoRevToNameMaybe repo (lib.revOrTag rev tag) "github",
# TODO(@ShamrockLee): Add back after reconstruction with lib.extendMkDerivation
# name ? repoRevToNameMaybe finalAttrs.repo (lib.revOrTag finalAttrs.revCustom finalAttrs.tag) "github",
fetchSubmodules ? false,
leaveDotGit ? null,
deepClone ? false,
@@ -110,9 +111,8 @@ lib.makeOverridable (
gitRepoUrl = "${baseUrl}.git";
revWithTag = if tag != null then "refs/tags/${tag}" else rev;
fetcherArgs =
finalAttrs:
passthruAttrs
// (
if useFetchGit then
@@ -127,9 +127,19 @@ lib.makeOverridable (
;
url = gitRepoUrl;
inherit passthru;
derivationArgs = {
inherit
githubBase
owner
repo
;
};
}
// lib.optionalAttrs (leaveDotGit != null) { inherit leaveDotGit; }
else
let
revWithTag = finalAttrs.rev;
in
{
# Use the API endpoint for private repos, as the archive URI doesn't
# support access with GitHub's fine-grained access tokens.
@@ -139,7 +149,7 @@ lib.makeOverridable (
url =
if private then
let
endpoint = "/repos/${owner}/${repo}/tarball/${revWithTag}";
endpoint = "/repos/${finalAttrs.owner}/${finalAttrs.repo}/tarball/${revWithTag}";
in
if githubBase == "github.com" then
"https://api.github.com${endpoint}"
@@ -148,7 +158,19 @@ lib.makeOverridable (
else
"${baseUrl}/archive/${revWithTag}.tar.gz";
extension = "tar.gz";
derivationArgs = {
inherit
githubBase
owner
repo
tag
;
rev = fetchgit.getRevWithTag {
inherit (finalAttrs) tag;
rev = finalAttrs.revCustom;
};
revCustom = rev;
};
passthru = {
inherit gitRepoUrl;
}
@@ -157,14 +179,13 @@ lib.makeOverridable (
)
// privateAttrs
// {
inherit name;
# TODO(@ShamrockLee): Change back to `inherit name;` after reconstruction with lib.extendMkDerivation
name =
args.name
or (repoRevToNameMaybe finalAttrs.repo (lib.revOrTag finalAttrs.revCustom finalAttrs.tag) "github");
meta = newMeta;
};
in
fetcher fetcherArgs
// {
meta = newMeta;
inherit owner repo tag;
rev = revWithTag;
}
)
+10 -1
View File
@@ -60,6 +60,9 @@ lib.extendMkDerivation {
# Passed via passthru
"url"
# Additional stdenv.mkDerivation arguments from derived fetchers.
"derivationArgs"
# Hash attributes will be map to the corresponding outputHash*
"hash"
"sha1"
@@ -139,6 +142,11 @@ lib.extendMkDerivation {
# Additional packages needed as part of a fetch
nativeBuildInputs ? [ ],
# Additional stdenvNoCC.mkDerivation arguments.
# It is typically for derived fetchers to pass down additional arguments,
# and the specified arguments have lower precedence than other mkDerivation arguments.
derivationArgs ? { },
}@args:
let
@@ -228,7 +236,8 @@ lib.extendMkDerivation {
"${lib.head mirrorList}${lib.elemAt mirrorSplit 1}";
in
{
derivationArgs
// {
name =
if pname != null && version != null then
"${finalAttrs.pname}-${finalAttrs.version}"
+16 -4
View File
@@ -20,7 +20,7 @@ lib.extendMkDerivation {
excludeDrvArgNames = [
"extraPostFetch"
# TODO(@ShamrockLee): Move these arguments to derivationArgs when available.
# Pass via derivationArgs
"extension"
"stripRoot"
];
@@ -42,14 +42,19 @@ lib.extendMkDerivation {
# an appropriate unpacking tool.
extension ? null,
# Additional stdenvNoCC.mkDerivation arguments.
# It is typically for derived fetchers to pass down additional arguments,
# and the specified arguments have lower precedence than other mkDerivation arguments.
derivationArgs ? { },
# the rest are given to fetchurl as is
...
}@args:
let
tmpFilename =
if extension != null then
"download.${extension}"
if finalAttrs.extension != null then
"download.${finalAttrs.extension}"
else
baseNameOf (if url != "" then url else builtins.head urls);
in
@@ -81,7 +86,7 @@ lib.extendMkDerivation {
chmod -R +w "$unpackDir"
''
+ (
if stripRoot then
if finalAttrs.stripRoot then
''
if [ $(ls -A "$unpackDir" | wc -l) != 1 ]; then
echo "error: zip file must contain a single file or directory."
@@ -109,5 +114,12 @@ lib.extendMkDerivation {
'';
# ^ Remove non-owner write permissions
# Fixes https://github.com/NixOS/nixpkgs/issues/38649
derivationArgs = derivationArgs // {
inherit
extension
stripRoot
;
};
};
}
+3 -3
View File
@@ -14,17 +14,17 @@
}:
buildGoModule (finalAttrs: {
pname = "avalanche-cli";
version = "1.9.2";
version = "1.9.3";
src = fetchFromGitHub {
owner = "ava-labs";
repo = "avalanche-cli";
tag = "v${finalAttrs.version}";
hash = "sha256-/HwZUsggBeuSZLYQDWUU4rfktnvwVolE5mKiZW4IXXs=";
hash = "sha256-1sQdQTWlUNWM8F/9/DZjn/WS3F0RTG4hglmoN2jjOyc=";
};
proxyVendor = true;
vendorHash = "sha256-JQEWEqseg5q0b8rPlO/19V1BLbWBdXldoWgUiqI9Qh4=";
vendorHash = "sha256-bId5FDdpgI8DTtY44cgATf41qLu8udLR00XioZOAh/Y=";
# Fix error: 'Caught SIGILL in blst_cgo_init'
# https://github.com/bnb-chain/bsc/issues/1521
+2 -2
View File
@@ -44,13 +44,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "cockpit";
version = "349";
version = "350";
src = fetchFromGitHub {
owner = "cockpit-project";
repo = "cockpit";
tag = finalAttrs.version;
hash = "sha256-MfZPT0gY3G4Tkp2TQN7HZVgy1oiJU9zrIzaLU8r9FjU=";
hash = "sha256-DOMX3msM5Ko7TDMRS+GcAf+gmyogjSExNEM9sjK0cCY=";
fetchSubmodules = true;
};
@@ -21,6 +21,9 @@
hash = "sha256-VFBkOWHGZP7GjekHL3GY3BGkVXQbtyD1YPmu0xaQ1ME=";
};
# drop upstreamed cmake-4 patch
patches = [ ];
postPatch =
builtins.replaceStrings
[
+2 -2
View File
@@ -12,13 +12,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "eiquadprog";
version = "1.3.0";
version = "1.3.1";
src = fetchFromGitHub {
owner = "stack-of-tasks";
repo = "eiquadprog";
rev = "v${finalAttrs.version}";
hash = "sha256-8CwyTREHzTtgXTnzAIcRAlKm3fBEUEeMxNwzzEMADqk=";
hash = "sha256-FV6A3cMaY7+eDip9YjuX0cYz0X6tdpDRV57eXOb9bKQ=";
};
outputs = [
+4 -4
View File
@@ -13,13 +13,13 @@
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "firefly-iii";
version = "6.4.2";
version = "6.4.4";
src = fetchFromGitHub {
owner = "firefly-iii";
repo = "firefly-iii";
tag = "v${finalAttrs.version}";
hash = "sha256-nGXFFGVw0TCXSBwMExk6wn0Es0HwCnY4P+nbJki+R6A=";
hash = "sha256-RRjTl3lZv/hoM6Jy3lB9/IFRq+w9ZKikOMqRRyV7MBw=";
};
buildInputs = [ php84 ];
@@ -38,13 +38,13 @@ stdenvNoCC.mkDerivation (finalAttrs: {
composerNoScripts = true;
composerStrictValidation = true;
strictDeps = true;
vendorHash = "sha256-siLLtF/B2eNsRaazq5zOXnFeFPlEeoSAIXYKEsrHv28=";
vendorHash = "sha256-lR900I79H5y+nDEXTvCUbHP4VpPsmNCIixUK1NtEiOQ=";
};
npmDeps = fetchNpmDeps {
inherit (finalAttrs) src;
name = "${finalAttrs.pname}-npm-deps";
hash = "sha256-WV1MsCbYxEHUEw0yYqD8b9jracyLVbpndWuHY0ZbaEM=";
hash = "sha256-d3x8Yw8ruIneaKCLsb1M9lwW2mtNmSkzVe8/4ia5GW0=";
};
preInstall = ''
@@ -11,13 +11,13 @@
buildGoModule rec {
pname = "fscrypt";
version = "0.3.5";
version = "0.3.6";
src = fetchFromGitHub {
owner = "google";
repo = "fscrypt";
rev = "v${version}";
hash = "sha256-US1jw0XK1BcP037XPhttzBloDU62m4BVSIbsGs9LaJU=";
hash = "sha256-iz/lkLDHJkyAHqSlzr8vbcbZv9N/c1evNufeAFNdcag=";
};
postPatch = ''
@@ -26,7 +26,7 @@ buildGoModule rec {
--replace "/usr/local" "$out"
'';
vendorHash = "sha256-FuVWV3Rimhd+Pm9wrKGLWQWtbP1hWvoWa22pQT+m2go=";
vendorHash = "sha256-0bCpmwWWTLWsa3P5ERwOCJ1we1sofqqPXy5JlZsqJpk=";
doCheck = false;
+2 -2
View File
@@ -8,11 +8,11 @@
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "gemini-cli-bin";
version = "0.10.0";
version = "0.11.3";
src = fetchurl {
url = "https://github.com/google-gemini/gemini-cli/releases/download/v${finalAttrs.version}/gemini.js";
hash = "sha256-jwyx5HWjPi2S5GQFxV+VeuwrmjmLi+F1nzw4YMfNSiA=";
hash = "sha256-JReB8+4+Pnbo8XsLGmcZ0xKjuFHeRC3e5uuhGOM/06I=";
};
dontUnpack = true;
-1
View File
@@ -87,7 +87,6 @@ python3.pkgs.buildPythonApplication rec {
homepage = "https://gitlab.gnome.org/World/gfeeds";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
pbogdan
aleksana
];
platforms = lib.platforms.linux;
+11 -5
View File
@@ -4,21 +4,23 @@
fetchFromGitLab,
cmake,
ffmpeg-headless,
kdsingleapplication,
libass,
kdePackages,
pkg-config,
qt6,
yt-dlp,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "haruna";
version = "1.4.0";
version = "1.6.0";
src = fetchFromGitLab {
owner = "multimedia";
repo = "haruna";
rev = "v${version}";
hash = "sha256-7983qZ7c3i8Ilyvu36t02zeIcVO96PXGNLH3wq6JsvI=";
rev = "v${finalAttrs.finalPackage.version}";
hash = "sha256-pAFO6zclJNmHD91ady0vlnBg6ebSWMzJq7TZN/uBGnM=";
domain = "invent.kde.org";
};
@@ -34,6 +36,8 @@ stdenv.mkDerivation rec {
yt-dlp
ffmpeg-headless
kdsingleapplication
libass
kdePackages.kconfig
kdePackages.kcoreaddons
kdePackages.kdeclarative
@@ -55,6 +59,8 @@ stdenv.mkDerivation rec {
qt6.wrapQtAppsHook
];
env.LANG = "C.UTF-8";
meta = {
homepage = "https://invent.kde.org/multimedia/haruna";
description = "Open source video player built with Qt/QML and libmpv";
@@ -73,4 +79,4 @@ stdenv.mkDerivation rec {
];
mainProgram = "haruna";
};
}
})
+2 -2
View File
@@ -7,13 +7,13 @@
buildGoModule (finalAttrs: {
pname = "lrcsnc";
version = "0.1.0";
version = "0.1.1";
src = fetchFromGitHub {
owner = "Endg4meZer0";
repo = "lrcsnc";
tag = "v${finalAttrs.version}";
hash = "sha256-gKb0cTpCPlyvJFthV1csn8HaVcUvXq+KC+nTT5sGhww=";
hash = "sha256-fXsXRv6h7HfEUhszxSIxv2mnkrm7DLm4Zpw7/beNn2I=";
};
vendorHash = "sha256-ww+SXy29woGlb120sj1oGb4MIQJzpBCKGpUKYsYxTMk=";
+9
View File
@@ -17,6 +17,7 @@
perl,
pkg-config,
python3Packages,
removeReferencesTo,
re2,
zlib,
protobuf,
@@ -44,6 +45,7 @@ let
stdenv = throw "Use effectiveStdenv instead";
effectiveStdenv = if cudaSupport then cudaPackages.backendStdenv else inputs.stdenv;
inherit (cudaPackages) cuda_nvcc;
cudaArchitecturesString = cudaPackages.flags.cmakeCudaArchitecturesString;
@@ -121,6 +123,7 @@ effectiveStdenv.mkDerivation rec {
++ lib.optionals cudaSupport [
cudaPackages.cuda_nvcc
cudaPackages.cudnn-frontend
removeReferencesTo
]
++ lib.optionals isCudaJetson [
cudaPackages.autoAddCudaCompatRunpath
@@ -318,6 +321,12 @@ effectiveStdenv.mkDerivation rec {
../include/onnxruntime/core/session/onnxruntime_*.h
'';
# See comments in `cudaPackages.nccl`
postFixup = lib.optionalString cudaSupport ''
remove-references-to -t "${lib.getBin cuda_nvcc}" ''${!outputLib}/lib/libonnxruntime_providers_cuda.so
'';
disallowedRequisites = [ (lib.getBin cuda_nvcc) ];
passthru = {
inherit cudaSupport cudaPackages ncclSupport; # for the python module
inherit protobuf;
+35
View File
@@ -0,0 +1,35 @@
{
fetchFromGitHub,
lib,
stdenv,
}:
stdenv.mkDerivation {
__structuredAttrs = true;
strictDeps = true;
pname = "phytool";
version = "2-unstable-2024-07-14";
src = fetchFromGitHub {
owner = "wkz";
repo = "phytool";
rev = "bcf23b0261aa9f352ee4b944e30e3482158640a4";
hash = "sha256-8e2DVjG/2CtJ/+FLzMa1VKajJZfFqjD54XQAMY+0q3U=";
};
makeFlags = [
"PREFIX=$(out)"
];
preInstall = ''
mkdir -p "$out/bin"
'';
meta = {
description = "Linux MDIO register access";
homepage = "https://github.com/wkz/phytool";
changelog = "https://github.com/wkz/phytool/releases";
license = lib.licenses.gpl2;
maintainers = [ lib.maintainers.connorbaker ];
};
}
+3 -3
View File
@@ -7,7 +7,7 @@
rainfrog,
}:
let
version = "0.3.8";
version = "0.3.9";
in
rustPlatform.buildRustPackage {
inherit version;
@@ -17,10 +17,10 @@ rustPlatform.buildRustPackage {
owner = "achristmascarl";
repo = "rainfrog";
tag = "v${version}";
hash = "sha256-VdfzNBPl32aUBQFHNFdjbZoTKhraOMlTw+tSlGSZ+yk=";
hash = "sha256-gfg73cvt0CJb80WOUlYZFWCuumFs4/nMZepmOPvYloY=";
};
cargoHash = "sha256-4Hom/93JU0YL4F/XL3zwWqWjfW5sW6HBeI/IpVbRoVs=";
cargoHash = "sha256-P1HJTYNROuoU1E4hmmpROMuudgYlRlWsRuUmJAEdY94=";
passthru = {
tests.version = testers.testVersion {
+2 -2
View File
@@ -14,14 +14,14 @@
python3Packages.buildPythonApplication rec {
pname = "ramalama";
version = "0.13.0";
version = "0.14.0";
pyproject = true;
src = fetchFromGitHub {
owner = "containers";
repo = "ramalama";
tag = "v${version}";
hash = "sha256-S4TZN+vExZ/5KJOgkhwlX0p+xPDI6tjmS2WDWgXzDOI=";
hash = "sha256-4RoZX8CzMGNGsh8TawPYYMi2ZZXDIGfD/p94SS+326Y=";
};
build-system = with python3Packages; [
+21 -5
View File
@@ -133,16 +133,16 @@ let
in
stdenv.mkDerivation {
pname = "wemeet";
version = "3.19.2.400";
version = "3.26.10.400";
src = selectSystem {
x86_64-linux = fetchurl {
url = "https://updatecdn.meeting.qq.com/cos/fb7464ffb18b94a06868265bed984007/TencentMeeting_0300000000_3.19.2.400_x86_64_default.publish.officialwebsite.deb";
hash = "sha256-PSGc4urZnoBxtk1cwwz/oeXMwnI02Mv1pN2e9eEf5kE=";
url = "https://updatecdn.meeting.qq.com/cos/9cfd93b10ee81b2fc3ad26357f27ed13/TencentMeeting_0300000000_3.26.10.400_x86_64_default.publish.officialwebsite.deb";
hash = "sha256-7gN40mkAD/0/k0E+bBNfiMcY+YtIaLWycFoI+hhrjgc=";
};
aarch64-linux = fetchurl {
url = "https://updatecdn.meeting.qq.com/cos/867a8a2e99a215dcd4f60fe049dbe6cf/TencentMeeting_0300000000_3.19.2.400_arm64_default.publish.officialwebsite.deb";
hash = "sha256-avN+PHKKC58lMC5wd0yVLD0Ct7sbb4BtXjovish0ULU=";
url = "https://updatecdn.meeting.qq.com/cos/e5f447f30343e27c49438db8d035ae23/TencentMeeting_0300000000_3.26.10.400_arm64_default.publish.officialwebsite.deb";
hash = "sha256-ShxcDwwBThwe2YKNy/5+HmYcnnodPhrMaOwkw3gTq0E=";
};
};
@@ -206,6 +206,21 @@ stdenv.mkDerivation {
runHook postInstall
'';
postInstall = selectSystem {
x86_64-linux = ''
# According to @mnixry:
# The thing is, it's a coroutine library that involves a series of low-level operations like stack and register restoration and saving, so there's quite a bit of code that looks like hand-written assembly.
# Then they apparently changed the usage of co_jump_to_link, but the registers used in the assembly weren't updated accordingly.
# And then under certain versions of libc/libcpp implementations, that original register happens to have a value, so the tests also pass.
# cmp rdi, 0 -> cmp r12, 0, at co_jump_to_link to address coroutine context resume issue
echo -ne '\x49\x83\xfc\x00' | dd of=$out/app/wemeet/lib/libwemeet_base.so bs=1 seek=$((0x94c833)) conv=notrunc
'';
aarch64-linux = ''
# I don't know if aarch64-linux version needs similar patch, I don't have aarch64 device.
'';
};
# set LP_NUM_THREADS limit the number of cores used by rendering
# set XDG_SESSION_TYPE; unset WAYLAND_DISPLAY getting border shadows to work
# set QT_STYLE_OVERRIDE solve the color of the font is not visible when using the included Qt
@@ -227,6 +242,7 @@ stdenv.mkDerivation {
];
xwaylandWrapperArgs = baseWrapperArgs ++ [
"--set XDG_SESSION_TYPE x11"
"--set QT_QPA_PLATFORM xcb"
"--unset WAYLAND_DISPLAY"
"--prefix LD_PRELOAD : ${libwemeetwrap}/lib/libwemeetwrap.so:${wemeet-wayland-screenshare}/lib/wemeet/libhook.so"
];
@@ -71,7 +71,7 @@ runCommand "flutter-artifacts-${flutterPlatform}-${systemPlatform}"
''
export FLUTTER_ROOT="$NIX_BUILD_TOP"
lndir -silent '${flutter'}' "$FLUTTER_ROOT"
rm -rf "$FLUTTER_ROOT/bin/cache"
rm --recursive --force "$FLUTTER_ROOT/bin/cache"
mkdir "$FLUTTER_ROOT/bin/cache"
''
+ lib.optionalString (lib.versionAtLeast flutter'.version "3.26") ''
@@ -89,18 +89,18 @@ runCommand "flutter-artifacts-${flutterPlatform}-${systemPlatform}"
flutter ? engine && flutter.engine.meta.available
) "--local-engine ${flutter.engine.outName}"
} \
-v '--${flutterPlatform}' ${
--verbose '--${flutterPlatform}' ${
builtins.concatStringsSep " " (map (p: "'--no-${p}'") (lib.remove flutterPlatform flutterPlatforms))
}
rm -rf "$FLUTTER_ROOT/bin/cache/lockfile"
rm --recursive --force "$FLUTTER_ROOT/bin/cache/lockfile"
''
+ lib.optionalString (lib.versionAtLeast flutter'.version "3.26") ''
rm -rf "$FLUTTER_ROOT/bin/cache/dart-sdk"
rm --recursive --force "$FLUTTER_ROOT/bin/cache/dart-sdk"
''
+ ''
find "$FLUTTER_ROOT" -type l -lname '${flutter'}/*' -delete
cp -r bin/cache "$out"
cp --recursive bin/cache "$out"
''
)
@@ -4,9 +4,9 @@
...
}:
{
# Use arm64 instead of arm64e.
postPatch = ''
if [ "$pname" == "flutter-tools" ]; then
# Use arm64 instead of arm64e.
substituteInPlace lib/src/ios/xcodeproj.dart \
--replace-fail arm64e arm64
fi
@@ -15,9 +15,9 @@
installPhase = ''
runHook preInstall
mkdir -p "$out/bin"
cp -r . "$out/bin/cache"
rm -f "$out/bin/cache/flutter.version.json"
mkdir --parents "$out/bin"
cp --recursive . "$out/bin/cache"
rm --force "$out/bin/cache/flutter.version.json"
runHook postInstall
'';
@@ -54,19 +54,19 @@ let
sources = {
"${dartVersion}-x86_64-linux" = fetchzip {
url = "https://storage.googleapis.com/dart-archive/channels/${channel}/release/${dartVersion}/sdk/dartsdk-linux-x64-release.zip";
sha256 = dartHash.x86_64-linux;
hash = dartHash.x86_64-linux;
};
"${dartVersion}-aarch64-linux" = fetchzip {
url = "https://storage.googleapis.com/dart-archive/channels/${channel}/release/${dartVersion}/sdk/dartsdk-linux-arm64-release.zip";
sha256 = dartHash.aarch64-linux;
hash = dartHash.aarch64-linux;
};
"${dartVersion}-x86_64-darwin" = fetchzip {
url = "https://storage.googleapis.com/dart-archive/channels/${channel}/release/${dartVersion}/sdk/dartsdk-macos-x64-release.zip";
sha256 = dartHash.x86_64-darwin;
hash = dartHash.x86_64-darwin;
};
"${dartVersion}-aarch64-darwin" = fetchzip {
url = "https://storage.googleapis.com/dart-archive/channels/${channel}/release/${dartVersion}/sdk/dartsdk-macos-arm64-release.zip";
sha256 = dartHash.aarch64-darwin;
hash = dartHash.aarch64-darwin;
};
};
};
@@ -75,7 +75,7 @@ let
source = fetchFromGitHub {
owner = "flutter";
repo = "flutter";
rev = version;
tag = version;
hash = flutterHash;
};
in
@@ -83,7 +83,7 @@ let
if lib.versionAtLeast version "3.32" then
# # Could not determine engine revision
(runCommand source.name { } ''
cp -r ${source} $out
cp --recursive ${source} $out
chmod +w $out/bin
mkdir $out/bin/cache
cp $out/bin/internal/engine.version $out/bin/cache/engine.stamp
@@ -3,13 +3,10 @@ runCommand "flutter-engine-${engine.version}-dart"
{
version = engine.dartSdkVersion;
inherit engine;
inherit (engine) outName;
meta = engine.meta // {
description = "Dart SDK compiled from the Flutter Engine";
};
}
''
ln -s ${engine}/out/$outName/dart-sdk $out
ln --symbolic ${engine}/out/${engine.outName}/dart-sdk $out
''
@@ -9,12 +9,9 @@
url,
patches,
runtimeModes,
isOptimized ? null,
lib,
stdenv,
dart,
mainRuntimeMode ? null,
altRuntimeMode ? null,
...
}@args:
let
mainRuntimeMode = args.mainRuntimeMode or builtins.elemAt runtimeModes 0;
@@ -41,25 +38,16 @@ in
stdenv.mkDerivation (
{
pname = "flutter-engine";
inherit url runtimeModes;
inherit (runtimeModesBuilds.${mainRuntimeMode})
meta
src
version
dartSdkVersion
isOptimized
runtimeMode
outName
dart
swiftshader
;
inherit altRuntimeMode;
inherit url runtimeModes altRuntimeMode;
inherit (runtimeModesBuilds.${mainRuntimeMode}) version src meta;
dontUnpack = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/out
runHook preInstall
mkdir --parents $out/out
''
+ lib.concatMapStrings (
runtimeMode:
@@ -68,9 +56,23 @@ stdenv.mkDerivation (
runtimeModeOut = runtimeModeBuild.outName;
in
''
ln -sf ${runtimeModeBuild}/out/${runtimeModeOut} $out/out/${runtimeModeOut}
ln --symbolic --force ${runtimeModeBuild}/out/${runtimeModeOut} $out/out/${runtimeModeOut}
''
) runtimeModes;
) runtimeModes
+ ''
runHook postInstall
'';
passthru = {
inherit (runtimeModesBuilds.${mainRuntimeMode})
dartSdkVersion
isOptimized
runtimeMode
outName
dart
swiftshader
;
};
}
// runtimeModesBuilds
)
@@ -1,11 +1,12 @@
{
lib,
callPackage,
writeText,
fetchurl,
bash,
bintools,
symlinkJoin,
darwin,
clang,
llvm,
tools ? callPackage ./tools.nix {
inherit (stdenv)
hostPlatform
@@ -13,10 +14,8 @@
;
},
stdenv,
stdenvNoCC,
dart,
fetchgit,
runCommand,
llvmPackages,
patchelf,
openbox,
@@ -49,18 +48,12 @@
isOptimized ? runtimeMode != "debug",
}:
let
expandSingleDep =
dep: lib.optionals (lib.isDerivation dep) ([ dep ] ++ map (output: dep.${output}) dep.outputs);
expandDeps = deps: lib.flatten (map expandSingleDep deps);
constants = callPackage ./constants.nix { platform = stdenv.targetPlatform; };
python3 = python312;
src = callPackage ./source.nix {
inherit
tools
flutterVersion
version
hashes
@@ -93,22 +86,11 @@ let
outName = "host_${runtimeMode}${lib.optionalString (!isOptimized) "_unopt"}";
dartPath = "${
if (lib.versionAtLeast flutterVersion "3.23") then "flutter/third_party" else "third_party"
}/dart";
dartPath = "flutter/third_party/dart";
in
stdenv.mkDerivation (finalAttrs: {
pname = "flutter-engine-${runtimeMode}${lib.optionalString (!isOptimized) "-unopt"}";
inherit
version
runtimeMode
patches
isOptimized
dartSdkVersion
src
outName
swiftshader
;
inherit version src patches;
setOutputFlags = false;
doStrip = isOptimized;
@@ -117,36 +99,39 @@ stdenv.mkDerivation (finalAttrs: {
name = "flutter-engine-toolchain-${version}";
paths =
expandDeps (
lib.optionals (stdenv.hostPlatform.isLinux) [
gtk3
wayland
libepoxy
libglvnd
freetype
at-spi2-atk
glib
gdk-pixbuf
harfbuzz
pango
cairo
xorg.libxcb
xorg.libX11
xorg.libXcursor
xorg.libXrandr
xorg.libXrender
xorg.libXinerama
xorg.libXi
xorg.libXext
xorg.libXfixes
xorg.libXxf86vm
xorg.xorgproto
zlib
]
++ lib.optionals (stdenv.hostPlatform.isDarwin) [
clang
llvm
]
lib.flatten (
map (dep: lib.optionals (lib.isDerivation dep) ([ dep ] ++ map (output: dep.${output}) dep.outputs))
(
lib.optionals (stdenv.hostPlatform.isLinux) [
gtk3
wayland
libepoxy
libglvnd
freetype
at-spi2-atk
glib
gdk-pixbuf
harfbuzz
pango
cairo
xorg.libxcb
xorg.libX11
xorg.libXcursor
xorg.libXrandr
xorg.libXrender
xorg.libXinerama
xorg.libXi
xorg.libXext
xorg.libXfixes
xorg.libXxf86vm
xorg.xorgproto
zlib
]
++ lib.optionals (stdenv.hostPlatform.isDarwin) [
clang
llvm
]
)
)
++ [
stdenv.cc.libc_dev
@@ -156,19 +141,16 @@ stdenv.mkDerivation (finalAttrs: {
# Needed due to Flutter expecting everything to be relative to $out
# and not true absolute path (ie relative to "/").
postBuild = ''
mkdir -p $(dirname $(dirname "$out/$out"))
ln -s $(dirname "$out") $out/$(dirname "$out")
mkdir --parents $(dirname $(dirname "$out/$out"))
ln --symbolic $(dirname "$out") $out/$(dirname "$out")
'';
};
NIX_CFLAGS_COMPILE = [
"-I${finalAttrs.toolchain}/include"
"-Wno-error"
]
++ lib.optional (!isOptimized) "-U_FORTIFY_SOURCE"
++ lib.optionals (lib.versionAtLeast flutterVersion "3.35") [
"-Wno-macro-redefined"
"-Wno-error=macro-redefined"
];
++ lib.optional (!isOptimized) "-U_FORTIFY_SOURCE";
nativeCheckInputs = lib.optionals stdenv.hostPlatform.isLinux [
xorg.xorgserver
@@ -195,77 +177,93 @@ stdenv.mkDerivation (finalAttrs: {
]
++ lib.optionals (stdenv.cc.libc ? bin) [ stdenv.cc.libc.bin ];
buildInputs = [ gtk3 ];
buildInputs = [
gtk3
libepoxy
];
patchtools = [ "flutter/third_party/gn/gn" ];
dontPatch = true;
patchgit = [
env.patchgit = toString [
dartPath
"flutter"
"."
]
++ lib.optional (lib.versionAtLeast flutterVersion "3.21") "flutter/third_party/skia";
"flutter/third_party/skia"
];
postUnpack = ''
pushd ${src.name}
sourceRoot = if lib.versionAtLeast flutterVersion "3.38" then "${src.name}/engine" else src.name;
cp ${./pkg-config.py} src/build/config/linux/pkg-config.py
postUnpack =
lib.optionalString (lib.versionAtLeast flutterVersion "3.38") ''
chmod --recursive +w ${src.name}
echo '#!${lib.getExe bash}' > ${src.name}/bin/internal/content_aware_hash.sh
echo 'echo 1111111111111111111111111111111111111111' >> ${src.name}/bin/internal/content_aware_hash.sh
''
+ ''
pushd ${finalAttrs.sourceRoot}
cp -pr --reflink=auto $swiftshader src/flutter/third_party/swiftshader
chmod -R u+w -- src/flutter/third_party/swiftshader
cp ${
fetchurl {
url = "https://raw.githubusercontent.com/chromium/chromium/631a813125b886a52274653144019fd1681a0e97/build/config/linux/pkg-config.py";
hash = "sha256-9coRpgCewlkFXSGrMVkudaZUll0IFc9jDRBP+2PloOI=";
}
} src/build/config/linux/pkg-config.py
ln -s ${llvmPackages.llvm.monorepoSrc} src/flutter/third_party/swiftshader/third_party/llvm-project
cp --preserve=mode,ownership,timestamps --recursive --reflink=auto ${swiftshader} src/flutter/third_party/swiftshader
chmod --recursive u+w -- src/flutter/third_party/swiftshader
mkdir -p src/flutter/buildtools/${constants.alt-platform}
ln -s ${llvm} src/flutter/buildtools/${constants.alt-platform}/clang
ln --symbolic ${llvmPackages.llvm.monorepoSrc} src/flutter/third_party/swiftshader/third_party/llvm-project
mkdir -p src/buildtools/${constants.alt-platform}
ln -s ${llvm} src/buildtools/${constants.alt-platform}/clang
mkdir --parents src/flutter/buildtools/${constants.alt-platform}
ln --symbolic ${llvm} src/flutter/buildtools/${constants.alt-platform}/clang
mkdir -p src/${dartPath}/tools/sdks
ln -s ${dart} src/${dartPath}/tools/sdks/dart-sdk
mkdir --parents src/buildtools/${constants.alt-platform}
ln --symbolic ${llvm} src/buildtools/${constants.alt-platform}/clang
${lib.optionalString (stdenv.hostPlatform.isLinux) ''
for patchtool in ''${patchtools[@]}; do
patchelf src/$patchtool --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker)
mkdir --parents src/${dartPath}/tools/sdks
ln --symbolic ${dart} src/${dartPath}/tools/sdks/dart-sdk
${lib.optionalString (stdenv.hostPlatform.isLinux) ''
for patchtool in ''${patchtools[@]}; do
patchelf src/$patchtool --set-interpreter ${bintools.dynamicLinker}
done
''}
for dir in ''${patchgit[@]}; do
pushd src/$dir
rm --recursive --force .git
git init
git add .
git config user.name "nobody"
git config user.email "nobody@local.host"
git commit --all --message="$dir" --quiet
popd
done
dart src/${dartPath}/tools/generate_package_config.dart
echo "${dartSdkVersion}" >src/${dartPath}/sdk/version
rm --recursive --force src/third_party/angle/.git
python3 src/flutter/tools/pub_get_offline.py
pushd src/flutter
for p in ''${patches[@]}; do
patch -p1 -i $p
done
''}
for dir in ''${patchgit[@]}; do
pushd src/$dir
rm -rf .git
git init
git add .
git config user.name "nobody"
git config user.email "nobody@local.host"
git commit -a -m "$dir" --quiet
popd
done
dart src/${dartPath}/tools/generate_package_config.dart
echo "${dartSdkVersion}" >src/${dartPath}/sdk/version
rm -rf src/third_party/angle/.git
python3 src/flutter/tools/pub_get_offline.py
pushd src/flutter
for p in ''${patches[@]}; do
patch -p1 -i $p
done
popd
''
# error: 'close_range' is missing exception specification 'noexcept(true)'
+ lib.optionalString (lib.versionAtLeast flutterVersion "3.35") ''
substituteInPlace src/flutter/third_party/dart/runtime/bin/process_linux.cc \
--replace-fail "(unsigned int first, unsigned int last, int flags)" "(unsigned int first, unsigned int last, int flags) noexcept(true)"
''
+ ''
popd
'';
''
# error: 'close_range' is missing exception specification 'noexcept(true)'
+ lib.optionalString (lib.versionAtLeast flutterVersion "3.35") ''
substituteInPlace src/flutter/third_party/dart/runtime/bin/process_linux.cc \
--replace-fail "(unsigned int first, unsigned int last, int flags)" "(unsigned int first, unsigned int last, int flags) noexcept(true)"
''
+ ''
popd
'';
configureFlags = [
"--no-prebuilt-dart-sdk"
@@ -281,7 +279,6 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional finalAttrs.finalPackage.doCheck "--enable-unittests"
++ lib.optional (!finalAttrs.finalPackage.doCheck) "--no-enable-unittests";
# NOTE: Once https://github.com/flutter/flutter/issues/127606 is fixed, use "--no-prebuilt-dart-sdk"
configurePhase = ''
runHook preConfigure
@@ -292,12 +289,13 @@ stdenv.mkDerivation (finalAttrs: {
''
+ ''
python3 ./src/flutter/tools/gn $configureFlags \
--runtime-mode $runtimeMode \
--runtime-mode ${runtimeMode} \
--out-dir $out \
--target-sysroot $toolchain \
--target-dir $outName \
--target-sysroot ${finalAttrs.toolchain} \
--target-dir ${outName} \
--target-triple ${stdenv.targetPlatform.config} \
--enable-fontconfig
--enable-fontconfig \
--no-prebuilt-dart-sdk
runHook postConfigure
'';
@@ -306,14 +304,14 @@ stdenv.mkDerivation (finalAttrs: {
runHook preBuild
export TERM=dumb
${lib.optionalString (lib.versionAtLeast flutterVersion "3.29") ''
# ValueError: ZIP does not support timestamps before 1980
substituteInPlace src/flutter/build/zip.py \
--replace-fail "zipfile.ZipFile(args.output, 'w', zipfile.ZIP_DEFLATED)" "zipfile.ZipFile(args.output, 'w', zipfile.ZIP_DEFLATED, strict_timestamps=False)"
''}
ninja -C $out/out/$outName -j$NIX_BUILD_CORES
''
# ValueError: ZIP does not support timestamps before 1980
+ lib.optionalString (lib.versionAtLeast flutterVersion "3.29") ''
substituteInPlace src/flutter/build/zip.py \
--replace-fail "zipfile.ZipFile(args.output, 'w', zipfile.ZIP_DEFLATED)" "zipfile.ZipFile(args.output, 'w', zipfile.ZIP_DEFLATED, strict_timestamps=False)"
''
+ ''
ninja -C $out/out/${outName} -j$NIX_BUILD_CORES
runHook postBuild
'';
@@ -321,28 +319,39 @@ stdenv.mkDerivation (finalAttrs: {
# Tests are broken
doCheck = false;
checkPhase = ''
ln -s $out/out src/out
runHook preCheck
ln --symbolic $out/out src/out
touch src/out/run_tests.log
sh src/flutter/testing/run_tests.sh $outName
sh src/flutter/testing/run_tests.sh ${outName}
rm src/out/run_tests.log
runHook postCheck
'';
installPhase = ''
runHook preInstall
rm -rf $out/out/$outName/{obj,exe.unstripped,lib.unstripped,zip_archives}
rm $out/out/$outName/{args.gn,build.ninja,build.ninja.d,compile_commands.json,toolchain.ninja}
find $out/out/$outName -name '*_unittests' -delete
find $out/out/$outName -name '*_benchmarks' -delete
rm -rf $out/out/${outName}/{obj,exe.unstripped,lib.unstripped,zip_archives}
rm $out/out/${outName}/{args.gn,build.ninja,build.ninja.d,compile_commands.json,toolchain.ninja}
find $out/out/${outName} -name '*_unittests' -delete
find $out/out/${outName} -name '*_benchmarks' -delete
''
+ lib.optionalString (finalAttrs.finalPackage.doCheck) ''
rm $out/out/$outName/{display_list_rendertests,flutter_tester}
rm $out/out/${outName}/{display_list_rendertests,flutter_tester}
''
+ ''
runHook postInstall
'';
passthru = {
inherit
dartSdkVersion
isOptimized
runtimeMode
outName
swiftshader
;
dart = callPackage ./dart.nix { engine = finalAttrs.finalPackage; };
};
@@ -359,6 +368,5 @@ stdenv.mkDerivation (finalAttrs: {
"x86_64-darwin"
"aarch64-darwin"
];
}
// lib.optionalAttrs (lib.versionOlder flutterVersion "3.22") { hydraPlatforms = [ ]; };
};
})
@@ -1,247 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import subprocess
import sys
import re
from optparse import OptionParser
# This script runs pkg-config, optionally filtering out some results, and
# returns the result.
#
# The result will be [ <includes>, <cflags>, <libs>, <lib_dirs>, <ldflags> ]
# where each member is itself a list of strings.
#
# You can filter out matches using "-v <regexp>" where all results from
# pkgconfig matching the given regular expression will be ignored. You can
# specify more than one regular expression my specifying "-v" more than once.
#
# You can specify a sysroot using "-s <sysroot>" where sysroot is the absolute
# system path to the sysroot used for compiling. This script will attempt to
# generate correct paths for the sysroot.
#
# When using a sysroot, you must also specify the architecture via
# "-a <arch>" where arch is either "x86" or "x64".
#
# CrOS systemroots place pkgconfig files at <systemroot>/usr/share/pkgconfig
# and one of <systemroot>/usr/lib/pkgconfig or <systemroot>/usr/lib64/pkgconfig
# depending on whether the systemroot is for a 32 or 64 bit architecture. They
# specify the 'lib' or 'lib64' of the pkgconfig path by defining the
# 'system_libdir' variable in the args.gn file. pkg_config.gni communicates this
# variable to this script with the "--system_libdir <system_libdir>" flag. If no
# flag is provided, then pkgconfig files are assumed to come from
# <systemroot>/usr/lib/pkgconfig.
#
# Additionally, you can specify the option --atleast-version. This will skip
# the normal outputting of a dictionary and instead print true or false,
# depending on the return value of pkg-config for the given package.
def SetConfigPath(options):
"""Set the PKG_CONFIG_LIBDIR environment variable.
This takes into account any sysroot and architecture specification from the
options on the given command line.
"""
sysroot = options.sysroot
assert sysroot
# Compute the library path name based on the architecture.
arch = options.arch
if sysroot and not arch:
print("You must specify an architecture via -a if using a sysroot.")
sys.exit(1)
libdir = sysroot + '/' + options.system_libdir + '/pkgconfig'
libdir += ':' + sysroot + '/share/pkgconfig'
os.environ['PKG_CONFIG_LIBDIR'] = libdir
return libdir
def GetPkgConfigPrefixToStrip(options, args):
"""Returns the prefix from pkg-config where packages are installed.
This returned prefix is the one that should be stripped from the beginning of
directory names to take into account sysroots.
"""
# Some sysroots, like the Chromium OS ones, may generate paths that are not
# relative to the sysroot. For example,
# /path/to/chroot/build/x86-generic/usr/lib/pkgconfig/pkg.pc may have all
# paths relative to /path/to/chroot (i.e. prefix=/build/x86-generic/usr)
# instead of relative to /path/to/chroot/build/x86-generic (i.e prefix=/usr).
# To support this correctly, it's necessary to extract the prefix to strip
# from pkg-config's |prefix| variable.
prefix = subprocess.check_output([options.pkg_config,
"--variable=prefix"] + args, env=os.environ).decode('utf-8')
return prefix
def MatchesAnyRegexp(flag, list_of_regexps):
"""Returns true if the first argument matches any regular expression in the
given list."""
for regexp in list_of_regexps:
if regexp.search(flag) != None:
return True
return False
def RewritePath(path, strip_prefix, sysroot):
"""Rewrites a path by stripping the prefix and prepending the sysroot."""
if os.path.isabs(path) and not path.startswith(sysroot):
if path.startswith(strip_prefix):
path = path[len(strip_prefix):]
path = path.lstrip('/')
return os.path.join(sysroot, path)
else:
return path
def main():
# If this is run on non-Linux platforms, just return nothing and indicate
# success. This allows us to "kind of emulate" a Linux build from other
# platforms.
if "linux" not in sys.platform:
print("[[],[],[],[],[]]")
return 0
parser = OptionParser()
parser.add_option('-d', '--debug', action='store_true')
parser.add_option('-p', action='store', dest='pkg_config', type='string',
default='pkg-config')
parser.add_option('-v', action='append', dest='strip_out', type='string')
parser.add_option('-s', action='store', dest='sysroot', type='string')
parser.add_option('-a', action='store', dest='arch', type='string')
parser.add_option('--system_libdir', action='store', dest='system_libdir',
type='string', default='lib')
parser.add_option('--atleast-version', action='store',
dest='atleast_version', type='string')
parser.add_option('--libdir', action='store_true', dest='libdir')
parser.add_option('--dridriverdir', action='store_true', dest='dridriverdir')
parser.add_option('--version-as-components', action='store_true',
dest='version_as_components')
(options, args) = parser.parse_args()
# Make a list of regular expressions to strip out.
strip_out = []
if options.strip_out != None:
for regexp in options.strip_out:
strip_out.append(re.compile(regexp))
if options.sysroot:
libdir = SetConfigPath(options)
if options.debug:
sys.stderr.write('PKG_CONFIG_LIBDIR=%s\n' % libdir)
prefix = GetPkgConfigPrefixToStrip(options, args)
else:
prefix = ''
if options.atleast_version:
# When asking for the return value, just run pkg-config and print the return
# value, no need to do other work.
if not subprocess.call([options.pkg_config,
"--atleast-version=" + options.atleast_version] +
args):
print("true")
else:
print("false")
return 0
if options.version_as_components:
cmd = [options.pkg_config, "--modversion"] + args
try:
version_string = subprocess.check_output(cmd).decode('utf-8')
except:
sys.stderr.write('Error from pkg-config.\n')
return 1
print(json.dumps(list(map(int, version_string.strip().split(".")))))
return 0
if options.libdir:
cmd = [options.pkg_config, "--variable=libdir"] + args
if options.debug:
sys.stderr.write('Running: %s\n' % cmd)
try:
libdir = subprocess.check_output(cmd).decode('utf-8')
except:
print("Error from pkg-config.")
return 1
sys.stdout.write(libdir.strip())
return 0
if options.dridriverdir:
cmd = [options.pkg_config, "--variable=dridriverdir"] + args
if options.debug:
sys.stderr.write('Running: %s\n' % cmd)
try:
dridriverdir = subprocess.check_output(cmd).decode('utf-8')
except:
print("Error from pkg-config.")
return 1
sys.stdout.write(dridriverdir.strip())
return
cmd = [options.pkg_config, "--cflags", "--libs"] + args
if options.debug:
sys.stderr.write('Running: %s\n' % ' '.join(cmd))
try:
flag_string = subprocess.check_output(cmd).decode('utf-8')
except:
sys.stderr.write('Could not run pkg-config.\n')
return 1
# For now just split on spaces to get the args out. This will break if
# pkgconfig returns quoted things with spaces in them, but that doesn't seem
# to happen in practice.
all_flags = flag_string.strip().split(' ')
sysroot = options.sysroot
if not sysroot:
sysroot = ''
includes = []
cflags = []
libs = []
lib_dirs = []
for flag in all_flags[:]:
if len(flag) == 0 or MatchesAnyRegexp(flag, strip_out):
continue;
if flag[:2] == '-l':
libs.append(RewritePath(flag[2:], prefix, sysroot))
elif flag[:2] == '-L':
lib_dirs.append(RewritePath(flag[2:], prefix, sysroot))
elif flag[:2] == '-I':
includes.append(RewritePath(flag[2:], prefix, sysroot))
elif flag[:3] == '-Wl':
# Don't allow libraries to control ld flags. These should be specified
# only in build files.
pass
elif flag == '-pthread':
# Many libs specify "-pthread" which we don't need since we always include
# this anyway. Removing it here prevents a bunch of duplicate inclusions
# on the command line.
pass
else:
cflags.append(flag)
# Output a GN array, the first one is the cflags, the second are the libs. The
# JSON formatter prints GN compatible lists when everything is a list of
# strings.
print(json.dumps([includes, cflags, libs, lib_dirs]))
return 0
if __name__ == '__main__':
sys.exit(main())
@@ -1,12 +1,10 @@
{
lib,
callPackage,
fetchgit,
tools ? null,
curl,
curlMinimal,
pkg-config,
git,
python3,
gitMinimal,
python312,
runCommand,
writeText,
cacert,
@@ -17,6 +15,7 @@
hostPlatform,
targetPlatform,
buildPlatform,
...
}@pkgs:
let
target-constants = callPackage ./constants.nix { platform = targetPlatform; };
@@ -24,20 +23,46 @@ let
tools = pkgs.tools or (callPackage ./tools.nix { inherit hostPlatform buildPlatform; });
boolOption = value: if value then "True" else "False";
gclient = writeText "flutter-engine-${version}.gclient" ''
solutions = [{
"managed": False,
"name": "${lib.optionalString (lib.versionAtLeast flutterVersion "3.29") "engine/"}src/flutter",
"url": "${url}",
"custom_vars": {
"download_fuchsia_deps": False,
"download_android_deps": False,
"download_linux_deps": ${boolOption targetPlatform.isLinux},
"setup_githooks": False,
"download_esbuild": False,
"download_dart_sdk": False,
"host_cpu": "${build-constants.alt-arch}",
"host_os": "${build-constants.alt-os}",
},
}]
target_os_only = True
target_os = [
"${target-constants.alt-os}"
]
target_cpu_only = True
target_cpu = [
"${target-constants.alt-arch}"
]
'';
in
runCommand "flutter-engine-source-${version}-${buildPlatform.system}-${targetPlatform.system}"
{
pname = "flutter-engine-source";
inherit version;
inherit (tools) depot_tools;
nativeBuildInputs = [
curl
curlMinimal
pkg-config
git
gitMinimal
tools.cipd
(python3.withPackages (
(python312.withPackages (
ps: with ps; [
httplib2
six
@@ -45,40 +70,14 @@ runCommand "flutter-engine-source-${version}-${buildPlatform.system}-${targetPla
))
];
gclient = writeText "flutter-engine-${version}.gclient" ''
solutions = [{
"managed": False,
"name": "${lib.optionalString (lib.versionAtLeast flutterVersion "3.29") "engine/"}src/flutter",
"url": "${url}",
"custom_vars": {
"download_fuchsia_deps": False,
"download_android_deps": False,
"download_linux_deps": ${boolOption targetPlatform.isLinux},
"setup_githooks": False,
"download_esbuild": False,
"download_dart_sdk": False,
"host_cpu": "${build-constants.alt-arch}",
"host_os": "${build-constants.alt-os}",
},
}]
target_os_only = True
target_os = [
"${target-constants.alt-os}"
]
target_cpu_only = True
target_cpu = [
"${target-constants.alt-arch}"
]
'';
NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
DEPOT_TOOLS_UPDATE = "0";
DEPOT_TOOLS_COLLECT_METRICS = "0";
PYTHONDONTWRITEBYTECODE = "1";
env = {
NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
DEPOT_TOOLS_UPDATE = "0";
DEPOT_TOOLS_COLLECT_METRICS = "0";
PYTHONDONTWRITEBYTECODE = "1";
};
outputHashAlgo = "sha256";
outputHashMode = "recursive";
@@ -96,34 +95,41 @@ runCommand "flutter-engine-source-${version}-${buildPlatform.system}-${targetPla
+ (
if lib.versionAtLeast flutterVersion "3.29" then
''
mkdir -p source
cp $gclient source/.gclient
mkdir --parents source
cp ${gclient} source/.gclient
cd source
''
else
''
mkdir -p $out
cp $gclient $out/.gclient
mkdir --parents $out
cp ${gclient} $out/.gclient
cd $out
''
)
+ ''
export PATH=$PATH:$depot_tools
python3 $depot_tools/gclient.py sync --no-history --shallow --nohooks -j $NIX_BUILD_CORES
export PATH=$PATH:${tools.depot_tools}
python3 ${tools.depot_tools}/gclient.py sync --no-history --shallow --nohooks -j $NIX_BUILD_CORES
''
+ lib.optionalString (lib.versionAtLeast flutterVersion "3.29") ''
cp -r engine/src/flutter/third_party/* engine/src/flutter/engine/src/flutter/third_party/
mv engine/src/flutter/engine $out
cp --recursive engine/src/flutter/third_party/* engine/src/flutter/engine/src/flutter/third_party/
${
if (lib.versionAtLeast flutterVersion "3.38") then
"mv engine/src/flutter $out"
else
"mv engine/src/flutter/engine $out"
}
''
+ ''
find $out -name '.git' -exec rm -rf {} \; || true
${if (lib.versionAtLeast flutterVersion "3.38") then "pushd $out/engine" else "pushd $out"}
find $out -name '.git' -exec rm --recursive --force {} \; || true
rm -rf $out/src/{buildtools,fuchsia}
rm -rf $out/src/flutter/{buildtools,prebuilts,third_party/swiftshader,third_party/gn/.versions}
rm -rf $out/src/flutter/{third_party/dart/tools/sdks/dart-sdk,third_party/ninja/ninja,third_party/java}
rm -rf $out/src/third_party/{dart/tools/sdks/dart-sdk,libcxx/test}
rm --recursive --force src/{buildtools,fuchsia}
rm --recursive --force src/flutter/{buildtools,prebuilts,third_party/swiftshader,third_party/gn/.versions}
rm --recursive --force src/flutter/{third_party/dart/tools/sdks/dart-sdk,third_party/ninja/ninja,third_party/java}
rm --recursive --force src/third_party/{dart/tools/sdks/dart-sdk,libcxx/test}
rm -rf $out/.cipd $out/.gclient $out/.gclient_entries $out/.gclient_previous_custom_vars $out/.gclient_previous_sync_commits
rm --recursive --force .cipd .gclient .gclient_entries .gclient_previous_custom_vars .gclient_previous_sync_commits
popd
''
)
@@ -9,25 +9,28 @@
runCommand,
darwin,
writeShellScriptBin,
depot_toolsCommit ? "7d95eb2eb054447592585c73a8ff7adad97ecba1",
depot_toolsHash ? "sha256-F7KDuVg11qLKkohIjuXpNdxpnSsT6Z3hE9+wFIG2sSk=",
cipdCommit ? "89ada246fcbf10f330011e4991d017332af2365b",
depot_toolsCommit ? "580b4ff3f5cd0dcaa2eacda28cefe0f45320e8f7",
depot_toolsHash ? "sha256-k+XQSYJQYc9vAUjwrRxaAlX/sK74W45m5byS31hSpwc=",
cipdCommit ? "7120a6a515089a3ff5d1f61ff4ee17750dc038af",
cipdHashes ? {
"linux-386" = "7f264198598af2ef9d8878349d33c1940f1f3739e46d986962c352ec4cce2690";
"linux-amd64" = "2ada6b46ad1cd1350522c5c05899d273f5c894c7665e30104e7f57084a5aeeb9";
"linux-arm64" = "96eca7e49f6732c50122b94b793c3a5e62ed77bce1686787a8334906791b4168";
"linux-armv6l" = "06394601130652c5e1b055a7e4605c21fc7c6643af0b3b3cac8d2691491afa81";
"linux-mips64" = "f3eda6542b381b7aa8f582698498b0e197972c894590ec35f18faa467c868f5c";
"linux-mips64le" = "74229ada8e2afd9c8e7c58991126869b2880547780d4a197a27c1dfa96851622";
"linux-mipsle" = "2f3c18ec0ad48cd44a9ff39bb60e9afded83ca43fb9c7a5ea9949f6fdd4e1394";
"linux-ppc64" = "79425c0795fb8ba12b39a8856bf7ccb853e85def4317aa6413222f307d4c2dbd";
"linux-ppc64le" = "f9b3d85dde70f1b78cd7a41d2477834c15ac713a59317490a4cdac9f8f092325";
"linux-riscv64" = "bd695164563a66e8d3799e8835f90a398fbae9a4eec24e876c92d5f213943482";
"linux-s390x" = "6f501af80541e733fda23b4208a21ea05919c95d236036a2121e6b6334a2792c";
"macos-amd64" = "41d05580c0014912d6c32619c720646fd136e4557c9c7d7571ecc8c0462733a1";
"macos-arm64" = "dc672bd16d9faf277dd562f1dc00644b10c03c5d838d3cc3d3ea29925d76d931";
"windows-386" = "fa6ed0022a38ffc51ff8a927e3947fe7e59a64b2019dcddca9d3afacf7630444";
"windows-amd64" = "b5423e4b4429837f7fe4d571ce99c068aa0ccb37ddbebc1978a423fd2b0086df";
"linux-386" = "sha256-CshLfw49uglvWNwWE4K7ucBUF+IZlXDaIQsTXtFEJ8U=";
"linux-amd64" = "sha256-rxpI+HqfZiOYvzyyQ9P93s70feDmrLgbm4Xh3o88LwQ=";
"linux-arm64" = "sha256-XTTKbw1Q2lin+pf7VADalpBy3AWMTEd7yItsE/pePxw=";
"linux-armv6l" = "sha256-e5qe2KcguRLPuAq6wOG7A3YghHHon+oHY3fRLhU+e9E=";
"linux-loong64" = "sha256-LPTK4Ly173jac+cSGrsWw0ajrWEYepeJDGtP/7Xh528=";
"linux-mips" = "sha256-nR5khvHbAijs0MEr8+UgbuHTRNQAsMOyGTU/DI3K5Os=";
"linux-mips64" = "sha256-4a/zD1CrC/sxtBHqSRpom0SYVoN38bz3FAM40OSdVI0=";
"linux-mips64le" = "sha256-JnfKuBGLHYNLnRieS0KV8sYaTjh2rbp1yijvNOrU0FE=";
"linux-mipsle" = "sha256-nWqoay8c4faRk2+G5TvwbsbnndjTU4oglOTfhSC+TLQ=";
"linux-ppc64" = "sha256-pjeI/bx0i+QchQLhNB88ACPI34SrFvvFA01F5Nb16Ys=";
"linux-ppc64le" = "sha256-ZDMDwrP1zYlOI1hdbd3iZwKr59v/8CWj2sZ1RdosAiE=";
"linux-riscv64" = "sha256-O2EvOnjwbNssB7FtbK44yFcXfkrh9HOsPs/HF+uD2m8=";
"linux-s390x" = "sha256-BKeNDtuc9IkmV4GpuZcdsGc2F039KQeLdozxh7u+FDw=";
"mac-amd64" = "sha256-ZKBm8PbKjg4t0jIBPRKAv85L8eZOwJ1wBvh3cRSqHOI=";
"mac-arm64" = "sha256-AvjJp7JF05CetYDnwNJneAsotm1vBHWqB/vCdcIohoU=";
"windows-386" = "sha256-AVLbWh+WtJKynFDS6IfhuvYudw4Ow9s6w2JyDWG/2CI=";
"windows-amd64" = "sha256-puAQhiPGuwzkElWiBdTRGWOaUR2AIP7Qv9S3pwEY74E=";
"windows-arm64" = "sha256-4wxOMG+zvkM7gjhAiQvvNqNS0AamKKJdaBM/+rRxgXk=";
},
}:
let
@@ -50,12 +53,12 @@ in
src = fetchurl {
name = "cipd-${cipdCommit}-unwrapped";
url = "https://chrome-infra-packages.appspot.com/client?platform=${stdenv-constants.platform}&version=git_revision:${cipdCommit}";
sha256 = cipdHashes.${stdenv-constants.platform};
hash = cipdHashes.${stdenv-constants.platform};
};
}
''
mkdir -p $out/bin
install -m755 $src $out/bin/cipd
mkdir --parents $out/bin
install --mode=0755 $src $out/bin/cipd
'';
in
writeShellScriptBin "cipd" ''
@@ -89,7 +92,10 @@ in
vpython =
pythonPkg:
runCommand "vpython3" { } "mkdir -p $out/bin && ln -s ${pythonPkg}/bin/python $out/bin/vpython3";
runCommand "vpython3" { } ''
mkdir --parents $out/bin
ln --symbolic ${pythonPkg}/bin/python $out/bin/vpython3
'';
xcode-select = writeShellScriptBin "xcode-select" ''
echo ${darwin.xcode}/Contents/Developer
@@ -37,11 +37,13 @@ buildDartApplication.override { inherit dart; } {
src = flutterSrc;
sourceRoot = "${flutterSrc.name}/packages/flutter_tools";
postUnpack = ''chmod -R u+w "$NIX_BUILD_TOP/source"'';
inherit patches;
# The given patches are made for the entire SDK source tree.
prePatch = ''pushd "$NIX_BUILD_TOP/source"'';
prePatch = ''
chmod --recursive u+w "../.."
pushd "../.."
'';
postPatch = ''
popd
''
@@ -66,9 +68,9 @@ buildDartApplication.override { inherit dart; } {
];
preConfigure = ''
export HOME=.
export FLUTTER_ROOT="$NIX_BUILD_TOP/source"
mkdir -p "$FLUTTER_ROOT/bin/cache"
ln -s '${dart}' "$FLUTTER_ROOT/bin/cache/dart-sdk"
export FLUTTER_ROOT="$(realpath ../../)"
mkdir --parents "$FLUTTER_ROOT/bin/cache"
ln --symbolic '${dart}' "$FLUTTER_ROOT/bin/cache/dart-sdk"
'';
dartCompileFlags = [ "--define=NIX_FLUTTER_HOST_PLATFORM=${systemPlatform}" ];
+27 -20
View File
@@ -29,6 +29,7 @@
gitMinimal,
which,
jq,
writableTmpDirAsHomeHook,
flutterTools ? null,
}@args:
@@ -90,34 +91,38 @@ let
'';
buildPhase = ''
# The flutter_tools package tries to run many Git commands. In most
# cases, unexpected output is handled gracefully, but commands are never
# expected to fail completely. A blank repository needs to be created.
rm -rf .git # Remove any existing Git directory
git init -b nixpkgs
runHook preBuild
''
# The flutter_tools package tries to run many Git commands. In most
# cases, unexpected output is handled gracefully, but commands are never
# expected to fail completely. A blank repository needs to be created.
+ ''
rm --recursive --force .git # Remove any existing Git directory
git init --initial-branch=nixpkgs
GIT_AUTHOR_NAME=Nixpkgs GIT_COMMITTER_NAME=Nixpkgs \
GIT_AUTHOR_EMAIL= GIT_COMMITTER_EMAIL= \
GIT_AUTHOR_DATE='1/1/1970 00:00:00 +0000' GIT_COMMITTER_DATE='1/1/1970 00:00:00 +0000' \
git commit --allow-empty -m "Initial commit"
git commit --allow-empty --message="Initial commit"
(. '${../../../build-support/fetchgit/deterministic-git}'; make_deterministic_repo .)
mkdir -p bin/cache
''
+ ''
mkdir --parents bin/cache
# Add a flutter_tools artifact stamp, and build a snapshot.
# This is the Flutter CLI application.
echo "$(git rev-parse HEAD)" > bin/cache/flutter_tools.stamp
ln -s '${flutterTools}/share/flutter_tools.snapshot' bin/cache/flutter_tools.snapshot
ln --symbolic '${flutterTools}/share/flutter_tools.snapshot' bin/cache/flutter_tools.snapshot
# Some of flutter_tools's dependencies contain static assets. The
# application attempts to read its own package_config.json to find these
# assets at runtime.
mkdir -p packages/flutter_tools/.dart_tool
ln -s '${flutterTools.pubcache}/package_config.json' packages/flutter_tools/.dart_tool/package_config.json
mkdir --parents packages/flutter_tools/.dart_tool
ln --symbolic '${flutterTools.pubcache}/package_config.json' packages/flutter_tools/.dart_tool/package_config.json
echo -n "${version}" > version
cat <<EOF > bin/cache/flutter.version.json
{
"devToolsVersion": "$(cat "${dart}/bin/resources/devtools/version.json" | jq -r .version)",
"devToolsVersion": "$(cat "${dart}/bin/resources/devtools/version.json" | jq --raw-output .version)",
"flutterVersion": "${version}",
"frameworkVersion": "${version}",
"channel": "${channel}",
@@ -131,22 +136,24 @@ let
# Suppress a small error now that `.gradle`'s location changed.
# Location changed because of the patch "gradle-flutter-tools-wrapper.patch".
mkdir -p "$out/packages/flutter_tools/gradle/.gradle"
mkdir --parents "$out/packages/flutter_tools/gradle/.gradle"
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r . $out
rm -rf $out/bin/cache/dart-sdk
ln -sf ${dart} $out/bin/cache/dart-sdk
mkdir --parents $out
cp --recursive . $out
rm --recursive --force $out/bin/cache/dart-sdk
ln --symbolic --force ${dart} $out/bin/cache/dart-sdk
# The regular launchers are designed to download/build/update SDK
# components, and are not very useful in Nix.
# Replace them with simple links and wrappers.
rm "$out/bin"/{dart,flutter}
ln -s "$out/bin/cache/dart-sdk/bin/dart" "$out/bin/dart"
ln --symbolic "$out/bin/cache/dart-sdk/bin/dart" "$out/bin/dart"
makeShellWrapper "$out/bin/dart" "$out/bin/flutter" \
--set-default FLUTTER_ROOT "$out" \
--set FLUTTER_ALREADY_LOCKED true \
@@ -158,15 +165,15 @@ let
doInstallCheck = true;
nativeInstallCheckInputs = [
which
writableTmpDirAsHomeHook
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ];
installCheckPhase = ''
runHook preInstallCheck
export HOME="$(mktemp -d)"
$out/bin/flutter config --android-studio-dir $HOME
$out/bin/flutter config --android-sdk $HOME
$out/bin/flutter --version | fgrep -q '${builtins.substring 0 10 engineVersion}'
$out/bin/flutter --version | fgrep --quiet '${builtins.substring 0 10 engineVersion}'
runHook postInstallCheck
'';
@@ -20,7 +20,7 @@ let
# symlinkJoin seems to be missing the .git directory for some reason.
if [ -d '${flutter.sdk}/.git' ]; then
ln -s '${flutter.sdk}/.git' "$out"
ln --symbolic '${flutter.sdk}/.git' "$out"
fi
# For iOS/macOS builds, *.xcframework/'s from the pre-built
@@ -40,8 +40,8 @@ let
# Remove the symlinkJoin .xcframework dir and replace it with a symlink
# to the unwrapped .xcframework dir.
frameworkDir="$(dirname "$file")"
rm -r "$frameworkDir"
ln -s "$origFrameworkDir" "$frameworkDir"
rm --recursive "$frameworkDir"
ln --symbolic "$origFrameworkDir" "$frameworkDir"
done
shopt -u globstar
'';
@@ -1,8 +1,8 @@
{ callPackage
, flutterPackages
, lib
, symlinkJoin
,
{
callPackage,
flutterPackages,
lib,
symlinkJoin,
}:
let
nixpkgsRoot = "@nixpkgs_root@";
@@ -25,25 +25,21 @@ let
"aarch64-darwin"
];
derivations =
lib.foldl'
(
acc: flutterPlatform:
acc
++ (map
(systemPlatform:
callPackage "${nixpkgsRoot}/pkgs/development/compilers/flutter/artifacts/fetch-artifacts.nix" {
flutter = flutterPackages."v${flutterCompactVersion}";
inherit flutterPlatform;
inherit systemPlatform;
hash = lib.fakeSha256;
})
systemPlatforms)
) [ ]
flutterPlatforms;
derivations = lib.foldl' (
acc: flutterPlatform:
acc
++ (map (
systemPlatform:
callPackage "${nixpkgsRoot}/pkgs/development/compilers/flutter/artifacts/fetch-artifacts.nix" {
flutter = flutterPackages."v${flutterCompactVersion}";
inherit flutterPlatform;
inherit systemPlatform;
hash = lib.fakeSha256;
}
) systemPlatforms)
) [ ] flutterPlatforms;
in
symlinkJoin {
name = "evaluate-derivations";
paths = derivations;
}
@@ -4,24 +4,29 @@ let
channel = "@channel@";
in
{
x86_64-linux = { fetchzip }:
x86_64-linux =
{ fetchzip }:
fetchzip {
url = "https://storage.googleapis.com/dart-archive/channels/${channel}/release/${dartVersion}/sdk/dartsdk-linux-x64-release.zip";
sha256 = "0000000000000000000000000000000000000000000000000000";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
aarch64-linux = { fetchzip }:
aarch64-linux =
{ fetchzip }:
fetchzip {
url = "https://storage.googleapis.com/dart-archive/channels/${channel}/release/${dartVersion}/sdk/dartsdk-linux-arm64-release.zip";
sha256 = "0000000000000000000000000000000000000000000000000000";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
x86_64-darwin = { fetchzip }:
x86_64-darwin =
{ fetchzip }:
fetchzip {
url = "https://storage.googleapis.com/dart-archive/channels/${channel}/release/${dartVersion}/sdk/dartsdk-macos-x64-release.zip";
sha256 = "0000000000000000000000000000000000000000000000000000";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
aarch64-darwin = { fetchzip }:
aarch64-darwin =
{ fetchzip }:
fetchzip {
url = "https://storage.googleapis.com/dart-archive/channels/${channel}/release/${dartVersion}/sdk/dartsdk-macos-arm64-release.zip";
sha256 = "0000000000000000000000000000000000000000000000000000";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
}.${platform}
}
.${platform}
@@ -1,4 +1,8 @@
{ callPackage, symlinkJoin, stdenv, lib }:
{
callPackage,
symlinkJoin,
lib,
}:
let
nixpkgsRoot = "@nixpkgs_root@";
version = "@flutter_version@";
@@ -9,25 +13,22 @@ let
"aarch64-linux"
];
derivations =
lib.foldl'
(
acc: buildPlatform:
acc
++ (map
(targetPlatform:
callPackage "${nixpkgsRoot}/pkgs/development/compilers/flutter/engine/source.nix" {
targetPlatform = lib.systems.elaborate targetPlatform;
hostPlatform = lib.systems.elaborate buildPlatform;
buildPlatform = lib.systems.elaborate buildPlatform;
flutterVersion = version;
version = engineVersion;
url = "https://github.com/flutter/flutter.git@${engineVersion}";
hashes."${buildPlatform}"."${targetPlatform}" = lib.fakeSha256;
})
systemPlatforms)
) [ ]
systemPlatforms;
derivations = lib.foldl' (
acc: buildPlatform:
acc
++ (map (
targetPlatform:
callPackage "${nixpkgsRoot}/pkgs/development/compilers/flutter/engine/source.nix" {
targetPlatform = lib.systems.elaborate targetPlatform;
hostPlatform = lib.systems.elaborate buildPlatform;
buildPlatform = lib.systems.elaborate buildPlatform;
flutterVersion = version;
version = engineVersion;
url = "https://github.com/flutter/flutter.git@${engineVersion}";
hashes."${buildPlatform}"."${targetPlatform}" = lib.fakeSha256;
}
) systemPlatforms)
) [ ] systemPlatforms;
in
symlinkJoin {
name = "evaluate-derivations";
@@ -2,6 +2,6 @@
fetchFromGitHub {
owner = "flutter";
repo = "flutter";
rev = "@flutter_version@";
tag = "@flutter_version@";
hash = "@hash@";
}
@@ -1,7 +1,7 @@
{ flutterPackages
, stdenv
, cacert
,
{
flutterPackages,
stdenv,
cacert,
}:
let
flutterCompactVersion = "@flutter_compact_version@";
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
diff --git a/packages/flutter_tools/lib/src/flutter_cache.dart b/packages/flutter_tools/lib/src/flutter_cache.dart
index df67547..eacc7c4 100644
--- a/packages/flutter_tools/lib/src/flutter_cache.dart
+++ b/packages/flutter_tools/lib/src/flutter_cache.dart
@@ -51,16 +51,6 @@ class FlutterCache extends Cache {
registerArtifact(IosUsbArtifacts(artifactName, this, platform: platform));
}
registerArtifact(FontSubsetArtifacts(this, platform: platform));
- registerArtifact(
- PubDependencies(
- logger: logger,
- // flutter root and pub must be lazily initialized to avoid accessing
- // before the version is determined.
- flutterRoot: () => Cache.flutterRoot!,
- pub: () => pub,
- projectFactory: projectFactory,
- ),
- );
}
}
@@ -0,0 +1,29 @@
diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart
index e4e474ab6e..5548599802 100644
--- a/packages/flutter_tools/lib/src/runner/flutter_command.dart
+++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart
@@ -1693,7 +1693,7 @@ Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and
// Populate the cache. We call this before pub get below so that the
// sky_engine package is available in the flutter cache for pub to find.
- if (shouldUpdateCache) {
+ if (false) {
// First always update universal artifacts, as some of these (e.g.
// ios-deploy on macOS) are required to determine `requiredArtifacts`.
final bool offline;
diff --git a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
index a1104da..1749d65 100644
--- a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
+++ b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
@@ -437,11 +437,6 @@
// Required to support `flutter --version` before artifacts are cached.
await globals.cache.updateAll(<DevelopmentArtifact>{DevelopmentArtifact.informative});
- globals.flutterVersion.ensureVersionFile();
- if (await _shouldCheckForUpdates(topLevelResults)) {
- await globals.flutterVersion.checkFlutterVersionFreshness();
- }
-
// See if the user specified a specific device.
final specifiedDeviceId = topLevelResults[FlutterGlobalOptions.kDeviceIdOption] as String?;
if (specifiedDeviceId != null) {
@@ -0,0 +1,68 @@
From 6df275df3b8694daf16302b407520e3b1dee6724 Mon Sep 17 00:00:00 2001
From: Philip Hayes <philiphayes9@gmail.com>
Date: Thu, 12 Sep 2024 13:23:00 -0700
Subject: [PATCH] fix: cleanup xcode_backend.sh to fix iOS build w/
`NixOS/nixpkgs` flutter
This patch cleans up `xcode_backend.sh`. It now effectively just runs
`exec $FLUTTER_ROOT/bin/dart ./xcode_backend.dart`.
The previous `xcode_backend.sh` tries to discover `$FLUTTER_ROOT` from
argv[0], even though its presence is already guaranteed (the wrapped
`xcode_backend.dart` also relies on this env).
When using nixpkgs flutter, the flutter SDK directory is composed of several
layers, joined together using symlinks (called a `symlinkJoin`). Without this
patch, the auto-discover traverses the symlinks into the wrong layer, and so it
uses an "unwrapped" `dart` command instead of a "wrapped" dart that sets some
important envs/flags (like `$FLUTTER_ROOT`).
Using the "unwrapped" dart then manifests in this error when compiling, since
it doesn't see the ios build-support artifacts:
```
$ flutter run -d iphone
Running Xcode build...
Xcode build done. 6.4s
Failed to build iOS app
Error (Xcode): Target debug_unpack_ios failed: Error: Flutter failed to create a directory at "/<nix-store>/XXXX-flutter-3.24.1-unwrapped/bin/cache/artifacts".
```
---
packages/flutter_tools/bin/xcode_backend.sh | 25 ++++-----------------
1 file changed, 4 insertions(+), 21 deletions(-)
diff --git a/packages/flutter_tools/bin/xcode_backend.sh b/packages/flutter_tools/bin/xcode_backend.sh
index 2889d7c8e4..48b9d06c6e 100755
--- a/packages/flutter_tools/bin/xcode_backend.sh
+++ b/packages/flutter_tools/bin/xcode_backend.sh
@@ -13,24 +13,7 @@
# exit on error, or usage of unset var
set -euo pipefail
-# Needed because if it is set, cd may print the path it changed to.
-unset CDPATH
-
-function follow_links() (
- cd -P "$(dirname -- "$1")"
- file="$PWD/$(basename -- "$1")"
- while [[ -h "$file" ]]; do
- cd -P "$(dirname -- "$file")"
- file="$(readlink -- "$file")"
- cd -P "$(dirname -- "$file")"
- file="$PWD/$(basename -- "$file")"
- done
- echo "$file"
-)
-
-PROG_NAME="$(follow_links "${BASH_SOURCE[0]}")"
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-FLUTTER_ROOT="$BIN_DIR/../../.."
-DART="$FLUTTER_ROOT/bin/dart"
-
-"$DART" "$BIN_DIR/xcode_backend.dart" "$@" "ios"
+# Run `dart ./xcode_backend.dart` with the dart from $FLUTTER_ROOT.
+dart="${FLUTTER_ROOT}/bin/dart"
+xcode_backend_dart="${BASH_SOURCE[0]%.sh}.dart"
+exec "${dart}" "${xcode_backend_dart}" "$@" "ios"
--
2.46.0
@@ -0,0 +1,59 @@
Fix for macOS build issue in Flutter >= 3.35
Since version 3.35, the behavior of macos_assemble.sh and xcode_backend.sh
is almost identical. This caused the same error for macOS that previously
occurred for iOS.
Derived from the iOS patch: ./fix-ios-build-xcode-backend-sh.patch
Example error:
```
$ flutter run -d macos
Launching lib/main.dart on macOS in debug mode...
Target debug_unpack_macos failed: Error: Flutter failed to create a directory at "/<nix-store>/XXXX-flutter-3.35.1-unwrapped/bin/cache/artifacts".
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
Failed to copy Flutter framework.
** BUILD FAILED **
```
---
diff --git a/packages/flutter_tools/bin/macos_assemble.sh b/packages/flutter_tools/bin/macos_assemble.sh
index 28acf8842..d0f2923df 100644
--- a/packages/flutter_tools/bin/macos_assemble.sh
+++ b/packages/flutter_tools/bin/macos_assemble.sh
@@ -13,29 +13,13 @@
# exit on error, or usage of unset var
set -euo pipefail
-# Needed because if it is set, cd may print the path it changed to.
-unset CDPATH
-
-function follow_links() (
- cd -P "$(dirname -- "$1")"
- file="$PWD/$(basename -- "$1")"
- while [[ -h "$file" ]]; do
- cd -P "$(dirname -- "$file")"
- file="$(readlink -- "$file")"
- cd -P "$(dirname -- "$file")"
- file="$PWD/$(basename -- "$file")"
- done
- echo "$file"
-)
-
-PROG_NAME="$(follow_links "${BASH_SOURCE[0]}")"
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-FLUTTER_ROOT="$BIN_DIR/../../.."
-DART="$FLUTTER_ROOT/bin/dart"
+# Run `dart ./xcode_backend.dart` with the dart from $FLUTTER_ROOT.
+dart="${FLUTTER_ROOT}/bin/dart"
+xcode_backend_dart="$(dirname "${BASH_SOURCE[0]}")/xcode_backend.dart"
# Main entry point.
if [[ $# == 0 ]]; then
- "$DART" "$BIN_DIR/xcode_backend.dart" "build" "macos"
+ exec "${dart}" "${xcode_backend_dart}" "build" "macos"
else
- "$DART" "$BIN_DIR/xcode_backend.dart" "$@" "macos"
+ exec "${dart}" "${xcode_backend_dart}" "$@" "macos"
fi
@@ -0,0 +1,220 @@
This patch introduces an intermediate Gradle build step to alter the behavior
of flutter_tools' Gradle project, specifically moving the creation of `build`
and `.gradle` directories from within the Nix Store to somewhere in `$HOME/.cache/flutter/nix-flutter-tools-gradle/$engineShortRev`.
Without this patch, flutter_tools' Gradle project tries to generate `build` and `.gradle`
directories within the Nix Store. Resulting in read-only errors when trying to build a
Flutter Android app at runtime.
This patch takes advantage of the fact settings.gradle takes priority over settings.gradle.kts to build the intermediate Gradle project
when a Flutter app runs `includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")`
`rootProject.buildFileName = "/dev/null"` so that the intermediate project doesn't use `build.gradle.kts` that's in the same directory.
The intermediate project makes a `settings.gradle` file in `$HOME/.cache/flutter/nix-flutter-tools-gradle/<short engine rev>/` and `includeBuild`s it.
This Gradle project will build the actual `packages/flutter_tools/gradle` project by setting
`rootProject.projectDir = new File("$settingsDir")` and `apply from: new File("$settingsDir/settings.gradle.kts")`.
To move `build` to `$HOME/.cache/flutter/nix-flutter-tools-gradle/<short engine rev>/`, we need to set `buildDirectory`.
To move `.gradle` as well, the `--project-cache-dir` argument must be passed to the Gradle wrapper.
Changing the `GradleUtils.getExecutable` function signature is a delibarate choice, to ensure that no new unpatched usages slip in.
--- /dev/null
+++ b/packages/flutter_tools/gradle/settings.gradle
@@ -0,0 +1,19 @@
+rootProject.buildFileName = "/dev/null"
+
+def engineShortRev = (new File("$settingsDir/../../../bin/internal/engine.version")).text.take(10)
+def dir = new File("$System.env.HOME/.cache/flutter/nix-flutter-tools-gradle/$engineShortRev")
+dir.mkdirs()
+def file = new File(dir, "settings.gradle")
+
+file.text = """
+rootProject.projectDir = new File("$settingsDir")
+apply from: new File("$settingsDir/settings.gradle.kts")
+
+gradle.allprojects { project ->
+ project.beforeEvaluate {
+ project.layout.buildDirectory = new File("$dir/build")
+ }
+}
+"""
+
+includeBuild(dir)
--- a/packages/flutter_tools/gradle/build.gradle.kts
+++ b/packages/flutter_tools/gradle/build.gradle.kts
@@ -4,6 +4,11 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
+// While flutter_tools runs Gradle with a --project-cache-dir, this startParameter
+// is not passed correctly to the Kotlin Gradle plugin for some reason, and so
+// must be set here as well.
+gradle.startParameter.projectCacheDir = layout.buildDirectory.dir("cache").get().asFile
+
plugins {
`java-gradle-plugin`
groovy
--- a/packages/flutter_tools/lib/src/android/gradle.dart
+++ b/packages/flutter_tools/lib/src/android/gradle.dart
@@ -474,9 +474,9 @@ class AndroidGradleBuilder implements AndroidBuilder {
// from the local.properties file.
updateLocalProperties(project: project, buildInfo: androidBuildInfo.buildInfo);
- final options = <String>[];
-
- final String gradleExecutablePath = _gradleUtils.getExecutable(project);
+ final [String gradleExecutablePath, ...List<String> options] = _gradleUtils.getExecutable(
+ project,
+ );
// All automatically created files should exist.
if (configOnly) {
@@ -797,7 +797,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
'aar_init_script.gradle',
);
final command = <String>[
- _gradleUtils.getExecutable(project),
+ ..._gradleUtils.getExecutable(project),
'-I=$initScript',
'-Pflutter-root=$flutterRoot',
'-Poutput-dir=${outputDirectory.path}',
@@ -912,6 +912,10 @@ class AndroidGradleBuilder implements AndroidBuilder {
final results = <String>[];
try {
+ final [String gradleExecutablePath, ...List<String> options] = _gradleUtils.getExecutable(
+ project,
+ );
+
exitCode = await _runGradleTask(
_kBuildVariantTaskName,
preRunTask: () {
@@ -927,10 +931,10 @@ class AndroidGradleBuilder implements AndroidBuilder {
),
);
},
- options: const <String>['-q'],
+ options: <String>[...options, '-q'],
project: project,
localGradleErrors: gradleErrors,
- gradleExecutablePath: _gradleUtils.getExecutable(project),
+ gradleExecutablePath: gradleExecutablePath,
outputParser: (String line) {
if (_kBuildVariantRegex.firstMatch(line) case final RegExpMatch match) {
results.add(match.namedGroup(_kBuildVariantRegexGroupName)!);
@@ -964,6 +968,10 @@ class AndroidGradleBuilder implements AndroidBuilder {
late Stopwatch sw;
var exitCode = 1;
try {
+ final [String gradleExecutablePath, ...List<String> options] = _gradleUtils.getExecutable(
+ project,
+ );
+
exitCode = await _runGradleTask(
taskName,
preRunTask: () {
@@ -979,10 +987,10 @@ class AndroidGradleBuilder implements AndroidBuilder {
),
);
},
- options: <String>['-q', '-PoutputPath=$outputPath'],
+ options: <String>[...options, '-q', '-PoutputPath=$outputPath'],
project: project,
localGradleErrors: gradleErrors,
- gradleExecutablePath: _gradleUtils.getExecutable(project),
+ gradleExecutablePath: gradleExecutablePath,
);
} on Error catch (error) {
_logger.printError(error.toString());
--- a/packages/flutter_tools/lib/src/android/gradle_errors.dart
+++ b/packages/flutter_tools/lib/src/android/gradle_errors.dart
@@ -228,7 +228,12 @@ final flavorUndefinedHandler = GradleHandledError(
},
handler: ({required String line, required FlutterProject project, required bool usesAndroidX}) async {
final RunResult tasksRunResult = await globals.processUtils.run(
- <String>[globals.gradleUtils!.getExecutable(project), 'app:tasks', '--all', '--console=auto'],
+ <String>[
+ ...globals.gradleUtils!.getExecutable(project),
+ 'app:tasks',
+ '--all',
+ '--console=auto',
+ ],
throwOnError: true,
workingDirectory: project.android.hostAppGradleRoot.path,
environment: globals.java?.environment,
--- a/packages/flutter_tools/lib/src/android/gradle_utils.dart
+++ b/packages/flutter_tools/lib/src/android/gradle_utils.dart
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import 'package:meta/meta.dart';
+import 'package:path/path.dart';
import 'package:process/process.dart';
import 'package:unified_analytics/unified_analytics.dart';
@@ -197,9 +198,29 @@ class GradleUtils {
final Logger _logger;
final OperatingSystemUtils _operatingSystemUtils;
+ List<String> get _requiredArguments {
+ final String cacheDir = join(
+ switch (globals.platform.environment['XDG_CACHE_HOME']) {
+ final String cacheHome => cacheHome,
+ _ => join(
+ globals.fsUtils.homeDirPath ?? throwToolExit('No cache directory has been specified.'),
+ '.cache',
+ ),
+ },
+ 'flutter',
+ 'nix-flutter-tools-gradle',
+ globals.flutterVersion.engineRevision.substring(0, 10),
+ );
+
+ return <String>[
+ '--project-cache-dir=${join(cacheDir, 'cache')}',
+ '-Pkotlin.project.persistent.dir=${join(cacheDir, 'kotlin')}',
+ ];
+ }
+
/// Gets the Gradle executable path and prepares the Gradle project.
/// This is the `gradlew` or `gradlew.bat` script in the `android/` directory.
- String getExecutable(FlutterProject project) {
+ List<String> getExecutable(FlutterProject project) {
final Directory androidDir = project.android.hostAppGradleRoot;
injectGradleWrapperIfNeeded(androidDir);
@@ -210,7 +231,7 @@ class GradleUtils {
// If the Gradle executable doesn't have execute permission,
// then attempt to set it.
_operatingSystemUtils.makeExecutable(gradle);
- return gradle.absolute.path;
+ return <String>[gradle.absolute.path, ..._requiredArguments];
}
throwToolExit(
'Unable to locate gradlew script. Please check that ${gradle.path} '
--- a/packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dart
+++ b/packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dart
@@ -2606,8 +2606,8 @@ Gradle Crashed
class FakeGradleUtils extends Fake implements GradleUtils {
@override
- String getExecutable(FlutterProject project) {
- return 'gradlew';
+ List<String> getExecutable(FlutterProject project) {
+ return const <String>['gradlew'];
}
}
--- a/packages/flutter_tools/test/general.shard/android/gradle_errors_test.dart
+++ b/packages/flutter_tools/test/general.shard/android/gradle_errors_test.dart
@@ -1633,8 +1633,8 @@ Platform fakePlatform(String name) {
class FakeGradleUtils extends Fake implements GradleUtils {
@override
- String getExecutable(FlutterProject project) {
- return 'gradlew';
+ List<String> getExecutable(FlutterProject project) {
+ return const <String>['gradlew'];
}
}
@@ -24,7 +24,7 @@
makeWrapper,
writeShellScript,
wrapGAppsHook3,
git,
gitMinimal,
which,
pkg-config,
atk,
@@ -64,8 +64,8 @@ let
name = "flutter-cache-dir";
paths = builtins.attrValues flutterPlatformArtifacts;
postBuild = ''
mkdir -p "$out/bin/cache"
ln -s '${flutter}/bin/cache/dart-sdk' "$out/bin/cache"
mkdir --parents "$out/bin/cache"
ln --symbolic '${flutter}/bin/cache/dart-sdk' "$out/bin/cache"
'';
passthru.flutterPlatform = flutterPlatformArtifacts;
};
@@ -79,7 +79,7 @@ let
# Tools that the Flutter tool depends on.
tools = [
git
gitMinimal
which
];
@@ -184,7 +184,7 @@ in
addToSearchPath FLUTTER_PKG_CONFIG_PATH "$path"
done
mkdir -p $out/bin
mkdir --parents $out/bin
makeWrapper '${immutableFlutter}' $out/bin/flutter \
--set-default ANDROID_EMULATOR_USE_SYSTEM_LIBS 1 \
''
@@ -10,6 +10,7 @@
flags,
lib,
python3,
removeReferencesTo,
which,
# passthru.updateScript
gitUpdater,
@@ -72,6 +73,7 @@ backendStdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
cuda_nvcc
python3
removeReferencesTo
which
];
@@ -117,8 +119,22 @@ backendStdenv.mkDerivation (finalAttrs: {
postFixup = ''
_overrideFirst outputStatic "static" "lib" "out"
moveToOutput lib/libnccl_static.a "''${!outputStatic:?}"
''
# Since CUDA 12.8, the cuda_nvcc path leaks in:
# - libnccl.so's .nv_fatbin section
# - libnccl_static.a
# &devrt -L /nix/store/00000000000000000000000000000000-...nvcc-.../bin/...
# This string makes cuda_nvcc a runtime dependency of nccl.
# See https://github.com/NixOS/nixpkgs/pull/457803
+ ''
remove-references-to -t "${lib.getBin cuda_nvcc}" \
''${!outputLib}/lib/libnccl.so.* \
''${!outputStatic}/lib/*.a
'';
# C.f. remove-references-to above. Ensure *all* references to cuda_nvcc are removed
disallowedRequisites = [ (lib.getBin cuda_nvcc) ];
passthru = {
platformAssertions = [
{
@@ -14,6 +14,8 @@ let
# Coerces a string to an int.
coerceInt = val: if lib.isInt val then val else lib.toIntBase10 val;
coerceIntVersion = v: coerceInt (lib.versions.major v);
# Parses a single version, substituting "latest" with the latest version.
parseVersion =
repo: key: version:
@@ -97,8 +99,8 @@ in
platformVersions ?
if minPlatformVersion != null && maxPlatformVersion != null then
let
minPlatformVersionInt = coerceInt (parseVersion repo "platforms" minPlatformVersion);
maxPlatformVersionInt = coerceInt (parseVersion repo "platforms" maxPlatformVersion);
minPlatformVersionInt = coerceIntVersion (parseVersion repo "platforms" minPlatformVersion);
maxPlatformVersionInt = coerceIntVersion (parseVersion repo "platforms" maxPlatformVersion);
in
lib.range (lib.min minPlatformVersionInt maxPlatformVersionInt) (
lib.max minPlatformVersionInt maxPlatformVersionInt
@@ -109,10 +111,8 @@ in
if minPlatformVersion == null then
1
else
coerceInt (parseVersion repo "platforms" minPlatformVersion);
latestPlatformVersionInt = lib.max minPlatformVersionInt (
coerceInt (lib.versions.major repo.latest.platforms)
);
coerceIntVersion (parseVersion repo "platforms" minPlatformVersion);
latestPlatformVersionInt = lib.max minPlatformVersionInt (coerceIntVersion repo.latest.platforms);
firstPlatformVersionInt = lib.max minPlatformVersionInt (
latestPlatformVersionInt - (lib.max 1 numLatestPlatformVersions) + 1
);
@@ -10,14 +10,14 @@
buildPythonPackage rec {
pname = "snakemake-storage-plugin-fs";
version = "1.1.2";
version = "1.1.3";
pyproject = true;
src = fetchFromGitHub {
owner = "snakemake";
repo = "snakemake-storage-plugin-fs";
tag = "v${version}";
hash = "sha256-bTkT1D2GJGS+zWvK/BUGLGE8ArZQikHHcdQjREJhldg=";
hash = "sha256-UdK0yhl7ljLh57CXAvH/OYiVyw+BjhPwGjSBXX8sbZk=";
};
build-system = [ poetry-core ];
+40 -22
View File
@@ -50,8 +50,8 @@ let
# Source corresponding to https://aur.archlinux.org/packages/nvidia-390xx-dkms
aurPatches = fetchgit {
url = "https://aur.archlinux.org/nvidia-390xx-utils.git";
rev = "94dffc01e23a93c354a765ea7ac64484a3ef96c1";
hash = "sha256-c94qXNZyMrSf7Dik7jvz2ECaGELqN7WEYNpnbUkzeeU=";
rev = "cf1a1c571c425b4b66d12e468fc4ce45a397c583";
hash = "sha256-SERB5ihOroagJn7apAiqjUckbrfP2FZPCuTLWcBccoM=";
};
# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/840
@@ -166,26 +166,39 @@ rec {
};
# Last one supporting Kepler architecture
legacy_470 = generic {
version = "470.256.02";
sha256_64bit = "sha256-1kUYYt62lbsER/O3zWJo9z6BFowQ4sEFl/8/oBNJsd4=";
sha256_aarch64 = "sha256-e+QvE+S3Fv3JRqC9ZyxTSiCu8gJdZXSz10gF/EN6DY0=";
settingsSha256 = "sha256-kftQ4JB0iSlE8r/Ze/+UMnwLzn0nfQtqYXBj+t6Aguk=";
persistencedSha256 = "sha256-iYoSib9VEdwjOPBP1+Hx5wCIMhW8q8cCHu9PULWfnyQ=";
legacy_470 =
let
# Source corresponding to https://aur.archlinux.org/packages/nvidia-470xx-dkms
aurPatches = fetchgit {
url = "https://aur.archlinux.org/nvidia-470xx-utils.git";
rev = "7c1c2c124147d960a6c7114eb26a4eadae9b9f3d";
hash = "sha256-sNW+I4dkPSudfORLEp1RNGHyQKWBYnBEeGrfJU7SYTs=";
};
in
generic {
version = "470.256.02";
sha256_64bit = "sha256-1kUYYt62lbsER/O3zWJo9z6BFowQ4sEFl/8/oBNJsd4=";
sha256_aarch64 = "sha256-e+QvE+S3Fv3JRqC9ZyxTSiCu8gJdZXSz10gF/EN6DY0=";
settingsSha256 = "sha256-kftQ4JB0iSlE8r/Ze/+UMnwLzn0nfQtqYXBj+t6Aguk=";
persistencedSha256 = "sha256-iYoSib9VEdwjOPBP1+Hx5wCIMhW8q8cCHu9PULWfnyQ=";
patches = [
"${aurPatches}/gcc-14.patch"
# fixes 6.10 follow_pfn
./follow_pfn.patch
# https://gist.github.com/joanbm/a6d3f7f873a60dec0aa4a734c0f1d64e
(fetchpatch {
url = "https://gist.github.com/joanbm/a6d3f7f873a60dec0aa4a734c0f1d64e/raw/6bae5606c033b6c6c08233523091992370e357b7/nvidia-470xx-fix-linux-6.12.patch";
hash = "sha256-6nbzcRTRCxW8GDAhB8Zwx9rVcCzwPtVYlqoUhL9gxlY=";
stripLen = 1;
extraPrefix = "kernel/";
})
];
};
patches = map (patch: "${aurPatches}/${patch}") [
"0001-Fix-conftest-to-ignore-implicit-function-declaration.patch"
"0002-Fix-conftest-to-use-a-short-wchar_t.patch"
"0003-Fix-conftest-to-use-nv_drm_gem_vmap-which-has-the-se.patch"
"nvidia-470xx-fix-gcc-15.patch"
"kernel-6.10.patch"
"kernel-6.12.patch"
"nvidia-470xx-fix-linux-6.13.patch"
"nvidia-470xx-fix-linux-6.14.patch"
"nvidia-470xx-fix-linux-6.15.patch"
"nvidia-470xx-fix-linux-6.17.patch"
];
patchFlags = [
"-p1"
"--directory=kernel"
];
};
# Last one supporting x86
legacy_390 = generic {
@@ -206,8 +219,13 @@ rec {
"gcc-14.patch"
"kernel-6.10.patch"
"kernel-6.12.patch"
"kernel-6.13.patch"
"kernel-6.14.patch"
"gcc-15.patch"
"kernel-6.15.patch"
"kernel-6.17.patch"
];
broken = kernel.kernelAtLeast "6.13";
broken = kernel.kernelAtLeast "6.18";
# fixes the bug described in https://bbs.archlinux.org/viewtopic.php?pid=2083439#p2083439
# see https://bbs.archlinux.org/viewtopic.php?pid=2083651#p2083651
@@ -1,61 +0,0 @@
diff -ruNb a/kernel/conftest.sh b/kernel/conftest.sh
--- a/kernel/conftest.sh 2024-07-19 04:36:26.183701185 -0500
+++ b/kernel/conftest.sh 2024-07-19 04:36:26.230366381 -0500
@@ -4464,20 +4464,22 @@
compile_check_conftest "$CODE" "NV_DRM_GEM_OBJECT_VMAP_HAS_MAP_ARG" "" "types"
;;
- unsafe_follow_pfn)
+ follow_pfn)
#
- # Determine if unsafe_follow_pfn() is present.
+ # Determine if follow_pfn() is present.
#
- # unsafe_follow_pfn() was added by commit 69bacee7f9ad
- # ("mm: Add unsafe_follow_pfn") in v5.13-rc1.
+ # follow_pfn() was added by commit 3b6748e2dd69
+ # ("mm: introduce follow_pfn()") in v2.6.31-rc1, and removed
+ # by commit 233eb0bf3b94 ("mm: remove follow_pfn")
+ # from linux-next 233eb0bf3b94.
#
CODE="
#include <linux/mm.h>
- void conftest_unsafe_follow_pfn(void) {
- unsafe_follow_pfn();
+ void conftest_follow_pfn(void) {
+ follow_pfn();
}"
- compile_check_conftest "$CODE" "NV_UNSAFE_FOLLOW_PFN_PRESENT" "" "functions"
+ compile_check_conftest "$CODE" "NV_FOLLOW_PFN_PRESENT" "" "functions"
;;
drm_plane_atomic_check_has_atomic_state_arg)
diff -ruNb a/kernel/nvidia/nvidia.Kbuild b/kernel/nvidia/nvidia.Kbuild
--- a/kernel/nvidia/nvidia.Kbuild 2022-10-12 04:29:57.000000000 -0500
+++ b/kernel/nvidia/nvidia.Kbuild 2024-07-19 05:17:39.148448922 -0500
@@ -164,7 +164,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += cc
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iterate_fd
NV_CONFTEST_FUNCTION_COMPILE_TESTS += seq_read_iter
NV_CONFTEST_FUNCTION_COMPILE_TESTS += sg_page_iter_page
-NV_CONFTEST_FUNCTION_COMPILE_TESTS += unsafe_follow_pfn
+NV_CONFTEST_FUNCTION_COMPILE_TESTS += follow_pfn
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_gem_object_get
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_gem_object_put_unlocked
NV_CONFTEST_FUNCTION_COMPILE_TESTS += set_close_on_exec
diff -ruNb a/kernel/nvidia/os-mlock.c b/kernel/nvidia/os-mlock.c
--- a/kernel/nvidia/os-mlock.c 2022-10-12 04:30:26.000000000 -0500
+++ b/kernel/nvidia/os-mlock.c 2024-07-19 04:36:26.230366381 -0500
@@ -18,10 +18,10 @@
unsigned long address,
unsigned long *pfn)
{
-#if defined(NV_UNSAFE_FOLLOW_PFN_PRESENT)
- return unsafe_follow_pfn(vma, address, pfn);
-#else
+#if defined(NV_FOLLOW_PFN_PRESENT)
return follow_pfn(vma, address, pfn);
+#else
+ return -1;
#endif
}
+1
View File
@@ -616,6 +616,7 @@ mapAliases {
gdc11 = throw "gdc11 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
gdc = throw "gdc has been removed from Nixpkgs, as recent versions require complex bootstrapping"; # Added 2025-08-08
gdmd = throw "gdmd has been removed from Nixpkgs, as it depends on GDC which was removed"; # Added 2025-08-08
gensgs = throw "gensgs has been removed as it was unmaintained, abandoned upstream since 2009 and relied on gtk2"; # Added 2025-10-29
geos_3_9 = throw "geos_3_9 has been removed from nixpkgs. Please use a more recent 'geos' instead."; # Added 2025-09-21
gfortran9 = throw "gfortran9 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
gfortran10 = throw "gfortran10 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
+1 -2
View File
@@ -1315,8 +1315,6 @@ with pkgs;
gcdemu = callPackage ../applications/emulators/cdemu/gui.nix { };
gensgs = pkgsi686Linux.callPackage ../applications/emulators/gens-gs { };
goldberg-emu = callPackage ../applications/emulators/goldberg-emu {
protobuf = protobuf_21;
};
@@ -4472,6 +4470,7 @@ with pkgs;
);
flutterPackages = flutterPackages-bin;
flutter = flutterPackages.stable;
flutter338 = flutterPackages.v3_38;
flutter335 = flutterPackages.v3_35;
flutter332 = flutterPackages.v3_32;
flutter329 = flutterPackages.v3_29;