mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
smtp4dev: use finalAttrs pattern, fix updateScript, adopt (#411238)
This commit is contained in:
commit
fa1c082c37
2 changed files with 18 additions and 19 deletions
|
@ -7,27 +7,20 @@
|
||||||
npmHooks,
|
npmHooks,
|
||||||
fetchNpmDeps,
|
fetchNpmDeps,
|
||||||
dotnetCorePackages,
|
dotnetCorePackages,
|
||||||
nix-update-script,
|
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
|
buildDotnetModule (finalAttrs: {
|
||||||
|
pname = "smtp4dev";
|
||||||
version = "3.8.6";
|
version = "3.8.6";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "rnwood";
|
owner = "rnwood";
|
||||||
repo = "smtp4dev";
|
repo = "smtp4dev";
|
||||||
tag = version;
|
tag = finalAttrs.version;
|
||||||
hash = "sha256-k4nerh4cVVcFQF7a4Wvcfhefa3SstEOASk+0soN0n9k=";
|
hash = "sha256-k4nerh4cVVcFQF7a4Wvcfhefa3SstEOASk+0soN0n9k=";
|
||||||
};
|
};
|
||||||
npmRoot = "Rnwood.Smtp4dev/ClientApp";
|
|
||||||
patches = [ ./smtp4dev-npm-packages.patch ];
|
patches = [ ./smtp4dev-npm-packages.patch ];
|
||||||
in
|
|
||||||
buildDotnetModule {
|
|
||||||
inherit
|
|
||||||
version
|
|
||||||
src
|
|
||||||
npmRoot
|
|
||||||
patches
|
|
||||||
;
|
|
||||||
pname = "smtp4dev";
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
nodejs
|
nodejs
|
||||||
|
@ -36,10 +29,12 @@ buildDotnetModule {
|
||||||
stdenv.cc # c compiler is needed for compiling npm-deps
|
stdenv.cc # c compiler is needed for compiling npm-deps
|
||||||
];
|
];
|
||||||
|
|
||||||
|
npmRoot = "Rnwood.Smtp4dev/ClientApp";
|
||||||
|
|
||||||
npmDeps = fetchNpmDeps {
|
npmDeps = fetchNpmDeps {
|
||||||
inherit src patches;
|
inherit (finalAttrs) src patches;
|
||||||
hash = "sha256-Uj0EnnsA+QHq5KHF2B93OG8rwxYrV6sEgMTbd43ttCA=";
|
hash = "sha256-Uj0EnnsA+QHq5KHF2B93OG8rwxYrV6sEgMTbd43ttCA=";
|
||||||
postPatch = "cd ${npmRoot}";
|
postPatch = "cd ${finalAttrs.npmRoot}";
|
||||||
};
|
};
|
||||||
|
|
||||||
dotnet-sdk = dotnetCorePackages.sdk_8_0;
|
dotnet-sdk = dotnetCorePackages.sdk_8_0;
|
||||||
|
@ -52,9 +47,7 @@ buildDotnetModule {
|
||||||
mv $out/bin/Rnwood.Smtp4dev $out/bin/smtp4dev
|
mv $out/bin/Rnwood.Smtp4dev $out/bin/smtp4dev
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.updateScript = nix-update-script {
|
passthru.updateScript = ./update.sh;
|
||||||
extraArgs = [ "--version-regex=^(\\d+\\.\\d+\\.\\d+)$" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Fake smtp email server for development and testing";
|
description = "Fake smtp email server for development and testing";
|
||||||
|
@ -64,7 +57,8 @@ buildDotnetModule {
|
||||||
maintainers = with lib.maintainers; [
|
maintainers = with lib.maintainers; [
|
||||||
rucadi
|
rucadi
|
||||||
jchw
|
jchw
|
||||||
|
defelo
|
||||||
];
|
];
|
||||||
platforms = lib.platforms.unix;
|
platforms = lib.platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|
5
pkgs/by-name/sm/smtp4dev/update.sh
Executable file
5
pkgs/by-name/sm/smtp4dev/update.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p curl jq nix-update
|
||||||
|
|
||||||
|
version=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sfL "https://api.github.com/repos/rnwood/smtp4dev/releases/latest" | jq -r .tag_name)
|
||||||
|
nix-update --version="$version" smtp4dev
|
Loading…
Add table
Add a link
Reference in a new issue