Commit 91b3db13 authored by Yueh-Shun Li's avatar Yueh-Shun Li
Browse files

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
parent 89d56ddd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -996,7 +996,7 @@
      spectre_oxi = rustPlatform.buildRustPackage {
        pname = "spectre_oxi";
        inherit (old) version src;
        sourceRoot = "source/spectre_oxi";
        sourceRoot = "${old.src.name}/spectre_oxi";

        cargoHash = "sha256-gCGuD5kipgfR0Le8npNmyBxNsUq0PavXvKkxkiPx13E=";

+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ let
  qtnproperty = mkDerivation {
    name = "qtnproperty";
    inherit src;
    sourceRoot = "AwesomeBump/Sources/utils/QtnProperty";
    sourceRoot = "${src.name}/Sources/utils/QtnProperty";
    patches = [ ./qtnproperty-parallel-building.patch ];
    buildInputs = [ qtscript qtbase qtdeclarative ];
    nativeBuildInputs = [ qmake flex bison ];
+2 −2
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ in
      pname = "${pname}-pnpm-deps";
      inherit src version;

      sourceRoot = "source/gephgui-wry/gephgui";
      sourceRoot = "${src.name}/gephgui-wry/gephgui";

      nativeBuildInputs = [
        jq
@@ -95,7 +95,7 @@ in
      pname = "gephgui-wry";
      inherit version src;

      sourceRoot = "source/gephgui-wry";
      sourceRoot = "${src.name}/gephgui-wry";

      cargoLock = {
        lockFile = ./Cargo.lock;
+5 −5
Original line number Diff line number Diff line
@@ -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;
+4 −4
Original line number Diff line number Diff line
@@ -20,10 +20,10 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-yguUMEX0tn75wKrPKyqlCYbBFaEwC5b1s3k9xept1Fw=";
  };

  sourceRoot =
    if stdenv.isDarwin
    then "source/build/mac/release"
    else "source/build/linux/release";
  sourceRoot = "${finalAttrs.src.name}/build/${
    if stdenv.hostPlatform.isDarwin then "mac"
    else "linux"
  }/release";

  buildInputs = [
    boost'
Loading