12 # In order for the geoip part to work, you need to set up a link from
13 # geoip.dataDir to a directory containing the data files This would typically be
14 # /var/lib/geoip-databases pointing to geoip-legacy/share/GeoIP
16 stdenv.mkDerivation rec {
20 src = fetchFromGitLab {
24 hash = "sha256-9eaR1zG8tjSGlkpyY1zTHAVgN5ypuyRfeRq6ct6zsLU=";
28 # disable tests which fail in NixOS sandbox (trying to access the network)
32 # technically not needed as we do not support the paid maxmind databases, but
33 # keep it around if someone wants to add support and /usr/share/GeoIP is
36 substituteInPlace ipcalc-maxmind.c \
37 --replace /usr/share/GeoIP /var/lib/GeoIP
40 nativeBuildInputs = [ meson ninja pkg-config ronn ];
42 buildInputs = [ geoip ];
45 "-Duse_geoip=${if withGeo then "en" else "dis"}abled"
46 "-Duse_maxminddb=disabled"
47 # runtime linking doesn't work on NixOS anyway
48 "-Duse_runtime_linking=disabled"
54 description = "Simple IP network calculator";
55 homepage = "https://gitlab.com/ipcalc/ipcalc";
56 license = licenses.gpl2Plus;
57 maintainers = with maintainers; [ peterhoeg ];
58 platforms = platforms.unix;
59 mainProgram = "ipcalc";