1 { lib, stdenv, fetchFromGitHub, lz4 }:
3 stdenv.mkDerivation rec {
5 version = "unstable-2021-11-21";
7 src = fetchFromGitHub {
10 rev = "735aaa0648a5a6c996b48add9465db86524999f6";
11 sha256 = "sha256-cS8FFIEgDWva0j9JXhS+s7Y4Oh+mNhFaKRI7BF2hqvs=";
14 buildInputs = [ lz4 ];
17 # pkg-config is not supported, so we'll manually devendor lz4
18 cp ${lz4.src}/lib/lz4.{h,c} .
23 install -D nx2elf $out/bin/nx2elf
27 homepage = "https://github.com/shuffle2/nx2elf";
28 description = "Convert Nintendo Switch executable files to ELFs";
29 license = licenses.unfree; # No license specified upstream
30 platforms = [ "x86_64-linux" ]; # Should work on Darwin as well, but this is untested. aarch64-linux fails.
32 mainProgram = "nx2elf";