mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-01 02:23:54 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
68 lines
1.5 KiB
Nix
68 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitLab,
|
|
meson,
|
|
ninja,
|
|
pkg-config,
|
|
ronn,
|
|
withGeo ? true,
|
|
geoip,
|
|
}:
|
|
|
|
# In order for the geoip part to work, you need to set up a link from
|
|
# geoip.dataDir to a directory containing the data files This would typically be
|
|
# /var/lib/geoip-databases pointing to geoip-legacy/share/GeoIP
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "ipcalc";
|
|
version = "1.0.3";
|
|
|
|
src = fetchFromGitLab {
|
|
owner = "ipcalc";
|
|
repo = "ipcalc";
|
|
rev = version;
|
|
hash = "sha256-9eaR1zG8tjSGlkpyY1zTHAVgN5ypuyRfeRq6ct6zsLU=";
|
|
};
|
|
|
|
patches = [
|
|
# disable tests which fail in NixOS sandbox (trying to access the network)
|
|
./sandbox_tests.patch
|
|
];
|
|
|
|
# technically not needed as we do not support the paid maxmind databases, but
|
|
# keep it around if someone wants to add support and /usr/share/GeoIP is
|
|
# broken anyway
|
|
postPatch = ''
|
|
substituteInPlace ipcalc-maxmind.c \
|
|
--replace /usr/share/GeoIP /var/lib/GeoIP
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
meson
|
|
ninja
|
|
pkg-config
|
|
ronn
|
|
];
|
|
|
|
buildInputs = [ geoip ];
|
|
|
|
mesonFlags = [
|
|
"-Duse_geoip=${if withGeo then "en" else "dis"}abled"
|
|
"-Duse_maxminddb=disabled"
|
|
# runtime linking doesn't work on NixOS anyway
|
|
"-Duse_runtime_linking=disabled"
|
|
];
|
|
|
|
doCheck = true;
|
|
|
|
meta = with lib; {
|
|
description = "Simple IP network calculator";
|
|
homepage = "https://gitlab.com/ipcalc/ipcalc";
|
|
license = licenses.gpl2Plus;
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
platforms = platforms.unix;
|
|
mainProgram = "ipcalc";
|
|
};
|
|
}
|