Commit 591ccfe5 authored by Jan Malakhovski's avatar Jan Malakhovski Committed by Anderson Torres
Browse files

treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases

This continues where d8f7f6a5 left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.

Also, similarly to d8f7f6a5 some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
parent 979f71ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
  nativeBuildInputs = [ cmake pkg-config copyDesktopItems ];
  buildInputs = [ bluez dbus glew glfw imgui ];

  sourceRoot = "./source/Client";
  sourceRoot = "./${src.name}/Client";

  cmakeFlags = [ "-Wno-dev" ];

+35 −28
Original line number Diff line number Diff line
@@ -16,38 +16,45 @@
  proxmox-backup-client,
}:

rustPlatform.buildRustPackage rec {
let
  pname = "proxmox-backup-client";
  version = "3.0.1";

  srcs = [
    (fetchgit {
  proxmox-backup_src = fetchgit {
    url = "git://git.proxmox.com/git/proxmox-backup.git";
    rev = "v${version}";
    name = "proxmox-backup";
    hash = "sha256-a6dPBZBBh//iANXoPmOdgxYO0qNszOYI3QtrjQr4Cxc=";
    })
    (fetchgit {
  };

  proxmox_src = fetchgit {
    url = "git://git.proxmox.com/git/proxmox.git";
    rev = "2a070da0651677411a245f1714895235b1caf584";
    name = "proxmox";
    hash = "sha256-WH6oW2MB2yN1Y2zqOuXewI9jHqev/xLcJtb7D1J4aUE=";
    })
    (fetchgit {
  };

  proxmox-fuse_src = fetchgit {
    url = "git://git.proxmox.com/git/proxmox-fuse.git";
    rev = "93099f76b6bbbc8a0bbaca9b459a1ce4dc5e0a79";
    name = "proxmox-fuse";
    hash = "sha256-3l0lAZVFQC0MYaqZvB+S+ihb1fTkEgs5i9q463+cbvQ=";
    })
    (fetchgit {
  };

  proxmox-pxar_src = fetchgit {
    url = "git://git.proxmox.com/git/pxar.git";
    rev = "6ad046f9f92b40413f59cc5f4c23d2bafdf141f2";
    name = "pxar";
    hash = "sha256-I9kk27oN9BDQpnLDWltjZMrh2yJitCpcD/XAhkmtJUg=";
    })
  ];
  };
in

rustPlatform.buildRustPackage {
  inherit pname version;

  srcs = [ proxmox-backup_src proxmox_src proxmox-fuse_src proxmox-pxar_src ];

  sourceRoot = "proxmox-backup";
  sourceRoot = proxmox-backup_src.name;

  # These patches are essentially un-upstreamable, due to being "workarounds" related to the
  # project structure.
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ stdenvNoCC.mkDerivation {
  };

  nativeBuildInputs = [ undmg ];
  sourceRoot = "${appName}";
  sourceRoot = appName;

  installPhase = ''
    runHook preInstall
+24 −19
Original line number Diff line number Diff line
@@ -31,27 +31,32 @@

assert withMPI -> trilinos.withMPI;

stdenv.mkDerivation rec {
  pname = "xyce";
let
  version = "7.6.0";

  srcs = [
  # useing fetchurl or fetchFromGitHub doesn't include the manuals
  # due to .gitattributes files
    (fetchgit {
  xyce_src = fetchgit {
    url = "https://github.com/Xyce/Xyce.git";
    rev = "Release-${version}";
    sha256 = "sha256-HYIzmODMWXBuVRZhcC7LntTysuyXN5A9lb2DeCQQtVw=";
    })
    (fetchFromGitHub {
  };

  regression_src = fetchFromGitHub {
    owner = "Xyce";
    repo = "Xyce_Regression";
    rev = "Release-${version}";
    sha256 = "sha256-uEoiKpYyHmdK7LZ1UNm2d3Jk8+sCwBwB0TCoHilIh74=";
    })
  ];
  };
in

stdenv.mkDerivation rec {
  pname = "xyce";
  inherit version;

  srcs = [ xyce_src regression_src ];

  sourceRoot = "./Xyce";
  sourceRoot = "./${xyce_src.name}";

  preConfigure = "./bootstrap";

@@ -101,7 +106,7 @@ stdenv.mkDerivation rec {
  doCheck = enableTests;

  postPatch = ''
    pushd ../source
    pushd ../${regression_src.name}
    find Netlists -type f -regex ".*\.sh\|.*\.pl" -exec chmod ugo+x {} \;
    # some tests generate new files, some overwrite netlists
    find . -type d -exec chmod u+w {} \;
@@ -124,7 +129,7 @@ stdenv.mkDerivation rec {
  checkPhase = ''
    XYCE_BINARY="$(pwd)/src/Xyce"
    EXECSTRING="${lib.optionalString withMPI "mpirun -np 2 "}$XYCE_BINARY"
    TEST_ROOT="$(pwd)/../source"
    TEST_ROOT="$(pwd)/../${regression_src.name}"

    # Honor the TMP variable
    sed -i -E 's|/tmp|\$TMP|' $TEST_ROOT/TestScripts/suggestXyceTagList.sh
+2 −2
Original line number Diff line number Diff line
@@ -63,8 +63,8 @@ mkDerivation rec {

  postUnpack = ''
    for dep in AuxiliarCustomWidgets QPinnableTabWidget QLogger git; do
      rmdir "source/src/$dep"
      ln -sf "../../$dep" "source/src/$dep"
      rmdir "${main_src.name}/src/$dep"
      ln -sf "../../$dep" "${main_src.name}/src/$dep"
    done
  '';

Loading