nixpkgs/pkgs/by-name/nx/nx2elf/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

35 lines
935 B
Nix

{ lib, stdenv, fetchFromGitHub, lz4 }:
stdenv.mkDerivation rec {
pname = "nx2elf";
version = "unstable-2021-11-21";
src = fetchFromGitHub {
owner = "shuffle2";
repo = "nx2elf";
rev = "735aaa0648a5a6c996b48add9465db86524999f6";
sha256 = "sha256-cS8FFIEgDWva0j9JXhS+s7Y4Oh+mNhFaKRI7BF2hqvs=";
};
buildInputs = [ lz4 ];
postPatch = ''
# pkg-config is not supported, so we'll manually devendor lz4
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.
maintainers = [ ];
mainProgram = "nx2elf";
};
}