diff options
author | Yueh-Shun Li <shamrocklee@posteo.net> | 2024-03-09 01:04:40 +0800 |
---|---|---|
committer | Yueh-Shun Li <shamrocklee@posteo.net> | 2024-03-09 07:53:25 +0800 |
commit | 91b3db13093b1aecdba07041eb44b7103c235d94 (patch) | |
tree | ee602af3a19fea3d77135eaf8c1818f2ec261706 /pkgs/applications/networking/localsend | |
parent | 89d56ddd5bf9d731f6d723aa4b4f374ecc4b80e4 (diff) |
treewide: fix sourceRoot for fetchgit-based src
According to Nixpkgs manual[1] and NixOS 23.11 Release Note[2], the `sourceRoot` attribute passed to `stdenv.mkDerivation` should be specified as `"${src.name}"` or `"${src.name}/subdir"` when `src` is produced using `fetchgit`-based fetchers. `sourceRoot = "source"` or `sourceRoot = "source/subdir"` is based on the assumption that the `name` attribute of these pre-unpacked fetchers are always `"source"`, which is not the case. Expecting constant `name` also makes the source FODs prone to irrelevent hashes during version bumps. [1]: https://nixos.org/manual/nixpkgs/unstable/#var-stdenv-sourceRoot [2]: https://nixos.org/manual/nixos/stable/release-notes#sec-release-23.11
Diffstat (limited to 'pkgs/applications/networking/localsend')
-rw-r--r-- | pkgs/applications/networking/localsend/default.nix | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkgs/applications/networking/localsend/default.nix b/pkgs/applications/networking/localsend/default.nix index 95506e98dc9a0..6bff0e0fbc6cd 100644 --- a/pkgs/applications/networking/localsend/default.nix +++ b/pkgs/applications/networking/localsend/default.nix @@ -13,7 +13,7 @@ let pname = "localsend"; version = "1.14.0"; - linux = flutter313.buildFlutterApplication { + linux = flutter313.buildFlutterApplication rec { inherit pname version; src = fetchFromGitHub { @@ -23,7 +23,7 @@ let hash = "sha256-CO0uFcZnOfE31EZxRUpgtod3+1lyXPpbytHB45DEM98="; }; - sourceRoot = "source/app"; + sourceRoot = "${src.name}/app"; pubspecLock = lib.importJSON ./pubspec.lock.json; @@ -59,7 +59,7 @@ let passthru.updateScript = ./update.sh; - meta = meta // { + meta = metaCommon // { mainProgram = "localsend_app"; }; }; @@ -81,13 +81,13 @@ let cp -r *.app $out/Applications ''; - meta = meta // { + meta = metaCommon // { sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; platforms = [ "x86_64-darwin" "aarch64-darwin" ]; }; }; - meta = with lib; { + metaCommon = with lib; { description = "An open source cross-platform alternative to AirDrop"; homepage = "https://localsend.org/"; license = licenses.mit; |