1
0
mirror of https://github.com/rtbrick/bngblaster.git synced 2024-05-06 15:54:57 +00:00

add: nix files for building and developing with nix(os)

This commit is contained in:
Istvan Ruzman
2021-05-26 11:52:37 +02:00
parent 26c59e3517
commit eaf0d99d4b
3 changed files with 73 additions and 0 deletions

7
default.nix Normal file
View File

@ -0,0 +1,7 @@
(import (
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; }
) {
src = ./.;
}).defaultNix

59
flake.nix Normal file
View File

@ -0,0 +1,59 @@
{
inputs.nixpgks.url = "github:NixOS/nixpkgs";
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 ./.;
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
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;
});
}

7
shell.nix Normal file
View File

@ -0,0 +1,7 @@
(import (
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; }
) {
src = ./.;
}).shellNix