2021-10-28 06:52:43 +00:00
|
|
|
{ lib
|
2020-11-09 15:59:12 +00:00
|
|
|
, rustPlatform
|
2021-10-28 06:52:43 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, stdenv
|
2020-11-09 15:59:12 +00:00
|
|
|
, pkg-config
|
|
|
|
, openssl
|
2022-02-10 20:34:41 +00:00
|
|
|
, just
|
|
|
|
, pandoc
|
2020-11-09 15:59:12 +00:00
|
|
|
, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "dogdns";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "unstable-2021-10-07";
|
2020-11-09 15:59:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ogham";
|
|
|
|
repo = "dog";
|
2022-02-10 20:34:41 +00:00
|
|
|
rev = "721440b12ef01a812abe5dc6ced69af6e221fad5";
|
|
|
|
sha256 = "sha256-y3T0vXg7631FZ4bzcbQjz3Buui/DFxh9LG8BZWwynp0=";
|
2020-11-09 15:59:12 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
patches = [
|
|
|
|
# remove date info to make the build reproducible
|
|
|
|
# remove commit hash to avoid dependency on git and the need to keep `.git`
|
|
|
|
./remove-date-info.patch
|
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles just pandoc ]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ];
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ];
|
2020-11-09 15:59:12 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2023-05-24 13:37:59 +00:00
|
|
|
"mutagen-0.2.0" = "sha256-FnSeNI9lAcxonRFTu7wnP/M/d5UbMzSZ97w+mUqoEg8=";
|
2023-03-27 19:17:25 +00:00
|
|
|
};
|
|
|
|
};
|
2020-11-09 15:59:12 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
dontUseJustBuild = true;
|
|
|
|
dontUseJustCheck = true;
|
|
|
|
dontUseJustInstall = true;
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
# update Cargo.lock to work with openssl 3
|
|
|
|
ln -sf ${./Cargo.lock} Cargo.lock
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
just man
|
|
|
|
'';
|
|
|
|
|
2020-11-09 15:59:12 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion completions/dog.{bash,fish,zsh}
|
2022-02-10 20:34:41 +00:00
|
|
|
installManPage ./target/man/*.1
|
2020-11-09 15:59:12 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-09 15:59:12 +00:00
|
|
|
description = "Command-line DNS client";
|
|
|
|
homepage = "https://dns.lookup.dog";
|
|
|
|
license = licenses.eupl12;
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2021-10-28 06:52:43 +00:00
|
|
|
mainProgram = "dog";
|
2020-11-09 15:59:12 +00:00
|
|
|
};
|
|
|
|
}
|