Skip to content

Commit 6c4002b

Browse files
authored
pngpaste: refactor package.nix and hardcode repo. (#414766)
2 parents e36dab0 + 34a118f commit 6c4002b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

pkgs/by-name/pn/pngpaste/package.nix

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,21 @@
44
fetchFromGitHub,
55
}:
66

7-
let
7+
stdenv.mkDerivation (finalAttrs: {
88
pname = "pngpaste";
99
version = "0.2.3";
10-
in
11-
stdenv.mkDerivation {
12-
inherit pname version;
10+
1311
src = fetchFromGitHub {
1412
owner = "jcsalterego";
15-
repo = pname;
16-
rev = version;
13+
repo = "pngpaste";
14+
tag = finalAttrs.version;
1715
sha256 = "uvajxSelk1Wfd5is5kmT2fzDShlufBgC0PDCeabEOSE=";
1816
};
1917

2018
installPhase = ''
21-
mkdir -p $out/bin
22-
cp pngpaste $out/bin
19+
runHook preInstall
20+
install -Dm555 pngpaste $out/bin
21+
runHook postInstall
2322
'';
2423

2524
meta = {
@@ -32,9 +31,9 @@ stdenv.mkDerivation {
3231
falling back to PNG.
3332
'';
3433
homepage = "https://github.com/jcsalterego/pngpaste";
35-
changelog = "https://github.com/jcsalterego/pngpaste/raw/${version}/CHANGELOG.md";
34+
changelog = "https://github.com/jcsalterego/pngpaste/raw/${finalAttrs.version}/CHANGELOG.md";
3635
platforms = lib.platforms.darwin;
3736
license = lib.licenses.bsd2;
3837
maintainers = with lib.maintainers; [ samw ];
3938
};
40-
}
39+
})

0 commit comments

Comments
 (0)