e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
49 lines
1.3 KiB
Nix
49 lines
1.3 KiB
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, stdenv
|
|
, pkg-config
|
|
, openssl
|
|
, pandoc
|
|
, darwin
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "dogedns";
|
|
version = "0.2.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Dj-Codeman";
|
|
repo = "doge";
|
|
rev = "6dd0383f31c096bfe2b6918c36b6e2c48414e753";
|
|
hash = "sha256-cvqDSTHFf/le2jItGTSkAGURj64WRvOmMRI+vFH0/50=";
|
|
};
|
|
|
|
cargoHash = "sha256-v9AuX7FZfy18yu4P9ovHsL5AQIYhPa8NEsMziEeHCJ8=";
|
|
|
|
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
|
|
];
|
|
|
|
nativeBuildInputs = [ installShellFiles pandoc ]
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ];
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ];
|
|
|
|
postInstall = ''
|
|
installShellCompletion completions/doge.{bash,fish,zsh}
|
|
installManPage ./target/man/*.1
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Reviving A command-line DNS client";
|
|
homepage = "https://github.com/Dj-Codeman/doge";
|
|
license = licenses.eupl12;
|
|
mainProgram = "doge";
|
|
maintainers = with maintainers; [ aktaboot ];
|
|
};
|
|
}
|