1
0
mirror of https://github.com/rtbrick/bngblaster.git synced 2024-05-06 15:54:57 +00:00
rtbrick-bngblaster/flake.nix
2021-05-26 20:33:19 +02:00

63 lines
2.0 KiB
Nix

{
inputs.nixpgks.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (nixpkgs) lib;
pkgs = nixpkgs.legacyPackages.${system};
buildTools = [ pkgs.cmake pkgs.ninja pkgs.gcc ];
dependencies = [ pkgs.ncurses pkgs.openssl pkgs.jansson ];
runTests = false;
in rec {
packages = {
libdict = pkgs.stdenv.mkDerivation {
pname = "libdict";
version = "1.0.1";
src = pkgs.fetchFromGitHub {
owner = "rtbrick";
repo = "libdict";
rev = "fea9fb240cfa08dc3bbfe425fb78466dbbf1aa56";
sha256 = "rnAvurPnmILMAB3Ingjw0lRJB6lcjdmUtPO6R3ek6e4=";
};
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DLIBDICT_STATIC=YES"
"-DLIBDICT_TOOLS=NO"
"-DLIBDICT_TESTS=NO"
"-DLIBDICT_SHARED=YES"
];
doCheck = false;
checkInputs = [ pkgs.cunit ];
nativeBuildInputs = buildTools;
};
bngblaster = pkgs.stdenv.mkDerivation {
pname = "bngblaster";
version = "0.52";
src = lib.cleanSource ./.;
doCheck = true;
cmakeFlags =
[ "-DCMAKE_BUILD_TYPE=Release" "-DBNGBLASTER_TESTS=ON" ];
checkInputs = [ pkgs.cmocka pkgs.libpcap ];
nativeBuildInputs = buildTools;
buildInputs = dependencies ++ [ packages.libdict ];
};
};
devShell = pkgs.mkShell {
buildInputs = dependencies
++ [ packages.libdict pkgs.bashInteractive ];
};
defaultPackage = packages.bngblaster;
apps.bngblaster = flake-utils.lib.mkApp { drv = packages.bngblaster; };
defaultApp = apps.bngblaster;
});
}