From da751d8fbd642192597abfa162b6f8457060afd1 Mon Sep 17 00:00:00 2001 From: David Wronek Date: Tue, 7 Oct 2025 12:39:42 +0200 Subject: [PATCH] loki-tool: init at 0-unstable-2016-06-27 Signed-off-by: David Wronek --- pkgs/by-name/lo/loki-tool/package.nix | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pkgs/by-name/lo/loki-tool/package.nix diff --git a/pkgs/by-name/lo/loki-tool/package.nix b/pkgs/by-name/lo/loki-tool/package.nix new file mode 100644 index 000000000000..2d66138e1d2d --- /dev/null +++ b/pkgs/by-name/lo/loki-tool/package.nix @@ -0,0 +1,47 @@ +{ + lib, + stdenv, + fetchFromGitHub, +}: +stdenv.mkDerivation { + pname = "loki-tool"; + version = "0-unstable-2016-06-27"; + + src = fetchFromGitHub { + owner = "djrbliss"; + repo = "loki"; + rev = "784e86f981b7b1c30bd0d6b401f071e47e738eb8"; + hash = "sha256-yeLTQP8TYDkaMmynRxmATPi2/5VxkUZsYd44UQwz4PY="; + }; + + strictDeps = true; + + # Static build does not work on darwin due to linker issues + postPatch = '' + substituteInPlace Makefile --replace-fail \ + "CFLAGS += -g -static -Wall" "CFLAGS += -g -Wall" + ''; + + # Default build target tries to compile binary for Android + buildPhase = '' + runHook preBuild + make CC=cc loki_tool + runHook postBuild + ''; + + # Upstream has no install target + installPhase = '' + runHook preInstall + install -Dm555 loki_tool -t $out/bin + runHook postInstall + ''; + + meta = { + homepage = "https://github.com/djrbliss/loki"; + description = "Tool for custom firmware on AT&T/Verizon Samsung and LG devices"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ ungeskriptet ]; + teams = [ lib.teams.android ]; + mainProgram = "loki_tool"; + }; +}