2021-04-17 17:17:46 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, lz4 }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nx2elf";
|
2022-01-18 17:10:01 +00:00
|
|
|
version = "unstable-2021-11-21";
|
2021-04-17 17:17:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "shuffle2";
|
|
|
|
repo = "nx2elf";
|
2022-01-18 17:10:01 +00:00
|
|
|
rev = "735aaa0648a5a6c996b48add9465db86524999f6";
|
|
|
|
sha256 = "sha256-cS8FFIEgDWva0j9JXhS+s7Y4Oh+mNhFaKRI7BF2hqvs=";
|
2021-04-17 17:17:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ lz4 ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-01-18 17:10:01 +00:00
|
|
|
# pkg-config is not supported, so we'll manually devendor lz4
|
2021-04-17 17:17:46 +00:00
|
|
|
cp ${lz4.src}/lib/lz4.{h,c} .
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
install -D nx2elf $out/bin/nx2elf
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/shuffle2/nx2elf";
|
|
|
|
description = "Convert Nintendo Switch executable files to ELFs";
|
|
|
|
license = licenses.unfree; # No license specified upstream
|
|
|
|
platforms = [ "x86_64-linux" ]; # Should work on Darwin as well, but this is untested. aarch64-linux fails.
|
2024-06-24 21:05:06 +00:00
|
|
|
maintainers = [ ];
|
2023-11-23 02:51:17 +00:00
|
|
|
mainProgram = "nx2elf";
|
2021-04-17 17:17:46 +00:00
|
|
|
};
|
|
|
|
}
|