From db3dd279bff489e1caa4c2b8c68e45ddb47cd4bb Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Sat, 15 May 2021 08:38:53 +0200 Subject: [PATCH] Add nix derivation Convenience for NixOS / Nixpkgs users, `nix-build` ran in main project directory should build this and create a `result/` symlink pointing at a built package. --- .gitignore | 2 ++ default.nix | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 default.nix diff --git a/.gitignore b/.gitignore index 2733c9b8..f06ab551 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ src/tools/idb_extract src/tools/jffs2extract src/tools/lzhs_scanner src/tools/lzhsenc + +result diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..b7221083 --- /dev/null +++ b/default.nix @@ -0,0 +1,33 @@ +{ pkgs ? import {} }: + +pkgs.stdenv.mkDerivation rec { + pname = "epk2extract"; + version = "devel"; + + src = ./.; + + buildInputs = [ + pkgs.cmake + pkgs.openssl.dev + pkgs.lzo + pkgs.zlib + ]; + + configurePhase = '' + cmake . + ''; + + buildPhase = '' + make + ''; + + installPhase = '' + mkdir -p $out/bin + cd src + cp epk2extract tools/lzhsenc tools/lzhs_scanner tools/idb_extract tools/jffs2extract $out/bin + + chmod -x ../keys/* + cp ../keys/*.key ../keys/*.pem $out/bin + ''; +} +