mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-11 08:13:04 +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" ```
68 lines
1.2 KiB
Nix
68 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, buildDunePackage
|
|
, fetchurl
|
|
, cstruct
|
|
, duration
|
|
, ethernet
|
|
, ipaddr
|
|
, logs
|
|
, lwt
|
|
, macaddr
|
|
, mirage-time
|
|
, alcotest
|
|
, mirage-clock-unix
|
|
, mirage-flow
|
|
, mirage-random
|
|
, mirage-random-test
|
|
, mirage-time-unix
|
|
, mirage-vnetif
|
|
, bisect_ppx
|
|
}:
|
|
|
|
buildDunePackage rec {
|
|
pname = "arp";
|
|
version = "3.1.1";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
|
|
hash = "sha256-6jPFiene6jAPtivCugtVfP3+6k9A5gBoWzpoxoaPBvE=";
|
|
};
|
|
|
|
minimalOCamlVersion = "4.08";
|
|
|
|
nativeBuildInputs = [
|
|
bisect_ppx
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
cstruct
|
|
duration
|
|
ethernet
|
|
ipaddr
|
|
logs
|
|
lwt
|
|
macaddr
|
|
mirage-time
|
|
];
|
|
|
|
## NOTE: As of 18 april 2023 and ARP version 3.0.0, tests fail on Darwin.
|
|
doCheck = ! stdenv.hostPlatform.isDarwin;
|
|
checkInputs = [
|
|
alcotest
|
|
mirage-clock-unix
|
|
mirage-flow
|
|
mirage-random
|
|
mirage-random-test
|
|
mirage-time-unix
|
|
mirage-vnetif
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Address Resolution Protocol purely in OCaml";
|
|
homepage = "https://github.com/mirage/arp";
|
|
license = licenses.isc;
|
|
maintainers = with maintainers; [ sternenseemann ];
|
|
};
|
|
}
|