Unverified Commit 3f9a09b8 authored by quantenzitrone's avatar quantenzitrone
Browse files

various: fix pname misuse in buildRustApplication packages

after this all uses of 'inherit (finalAttrs) pname;' or 'finalAttrs.pname'
in these packages are in my opinion legit uses. e.g.:
- for inheriting the pname and version in fetchPnpmDeps, fetchCargoDeps or fetchCrate
- for use in creating the (p-)name of small sub-packages like tests or updateScripts.
- for cargoDepsName
- for buildAndTestSubdir
parent ca363a08
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
  '';

  postFixup = ''
    patchelf --set-rpath "${lib.makeLibraryPath finalAttrs.buildInputs}" $out/bin/${finalAttrs.pname}
    patchelf --set-rpath "${lib.makeLibraryPath finalAttrs.buildInputs}" $out/bin/${finalAttrs.meta.mainProgram}
  '';

  passthru.updateScript = nix-update-script { };
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
  ];

  postInstall = ''
    installManPage docs/${finalAttrs.pname}.1
    installManPage docs/authoscope.1
  '';

  # Tests requires access to httpin.org
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
    mv $out/share/applications/software.Browsers.template.desktop $out/share/applications/software.Browsers.desktop
    substituteInPlace \
        $out/share/applications/software.Browsers.desktop \
        --replace-fail 'Exec=€ExecCommand€' 'Exec=${finalAttrs.pname} %u'
        --replace-fail 'Exec=€ExecCommand€' 'Exec=${finalAttrs.meta.mainProgram} %u'
    cp -r resources $out
    for size in 16 32 128 256 512; do
      install -m 444 \
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
  src = fetchFromGitHub {
    owner = "CycloneDX";
    repo = "cyclonedx-rust-cargo";
    rev = "${finalAttrs.pname}-${finalAttrs.version}";
    rev = "cargo-cyclonedx-${finalAttrs.version}";
    hash = "sha256-T/9eHI2P8eCZAqMTeZz1yEi5nljQWfHrdNiU3h3h74U=";
  };

+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
  ];

  env = {
    ENGAGE_DOCS_LINK = "file://${placeholder "doc"}/share/doc/${finalAttrs.pname}/index.html";
    ENGAGE_DOCS_LINK = "file://${placeholder "doc"}/share/doc/engage/index.html";
  };

  src = fetchFromGitLab {
@@ -57,7 +57,7 @@ rustPlatform.buildRustPackage (finalAttrs: {

    ${lib.getExe mdbook} build
    mkdir -p "$doc/share/doc"
    mv public "$doc/share/doc/${finalAttrs.pname}"
    mv public "$doc/share/doc/engage"
  '';

  meta = {
Loading