mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-13 01:03:25 +00:00
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" ```
61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, makeBinaryWrapper
|
|
, stdenv
|
|
, pkg-config
|
|
, openssl
|
|
, nmap
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "unimap";
|
|
version = "0.6.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Edu4rdSHL";
|
|
repo = "unimap";
|
|
rev = version;
|
|
hash = "sha256-7UbzE5VXycjo7KNpPe2oqwyZDT4Vk8rQZ6HXT1q9Cw4=";
|
|
};
|
|
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
outputHashes = {
|
|
"trust-dns-proto-0.20.4" = "sha256-+oAjyyTXbKir8e5kn8CUmQy5qmzQ47ryvBBdZtzj1TY=";
|
|
};
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
makeBinaryWrapper
|
|
] ++ lib.optionals (stdenv.hostPlatform.isAarch && stdenv.hostPlatform.isLinux) [
|
|
pkg-config
|
|
];
|
|
|
|
# only depends on openssl on aarch/arm linux
|
|
buildInputs = lib.optionals (stdenv.hostPlatform.isAarch && stdenv.hostPlatform.isLinux) [
|
|
openssl
|
|
];
|
|
|
|
env = lib.optionalAttrs (stdenv.hostPlatform.isAarch && stdenv.hostPlatform.isLinux) {
|
|
OPENSSL_NO_VENDOR = true;
|
|
};
|
|
|
|
postInstall = ''
|
|
installManPage unimap.1
|
|
wrapProgram $out/bin/unimap \
|
|
--prefix PATH : ${lib.makeBinPath [ nmap ]}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Scan only once by IP address and reduce scan times with Nmap for large amounts of data";
|
|
homepage = "https://github.com/Edu4rdSHL/unimap";
|
|
changelog = "https://github.com/Edu4rdSHL/unimap/releases/tag/${src.rev}";
|
|
license = licenses.gpl3Plus;
|
|
maintainers = with maintainers; [ figsoda ];
|
|
mainProgram = "unimap";
|
|
};
|
|
}
|