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:
7
default.nix
Normal file
7
default.nix
Normal 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
59
flake.nix
Normal 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;
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user