about summary refs log tree commit diff
path: root/pkgs/tools/compression
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-04-17 18:10:38 +0000
committerGitHub <noreply@github.com>2021-04-17 18:10:38 +0000
commit8156636ab9d5291a8096af9e31bcb34a1c56fc2c (patch)
tree1d5ef4bfaf032b2f9e65ff3353060946b4390a29 /pkgs/tools/compression
parent85d9aa3a8b1fef006d0c30f7619a6c0701471604 (diff)
parentc27aea5e879748c79acf3b6681194fcf184e3eba (diff)
downloadnixlib-8156636ab9d5291a8096af9e31bcb34a1c56fc2c.tar
nixlib-8156636ab9d5291a8096af9e31bcb34a1c56fc2c.tar.gz
nixlib-8156636ab9d5291a8096af9e31bcb34a1c56fc2c.tar.bz2
nixlib-8156636ab9d5291a8096af9e31bcb34a1c56fc2c.tar.lz
nixlib-8156636ab9d5291a8096af9e31bcb34a1c56fc2c.tar.xz
nixlib-8156636ab9d5291a8096af9e31bcb34a1c56fc2c.tar.zst
nixlib-8156636ab9d5291a8096af9e31bcb34a1c56fc2c.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/tools/compression')
-rw-r--r--pkgs/tools/compression/nx2elf/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/tools/compression/nx2elf/default.nix b/pkgs/tools/compression/nx2elf/default.nix
new file mode 100644
index 000000000000..8b7f094bf39a
--- /dev/null
+++ b/pkgs/tools/compression/nx2elf/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, lz4 }:
+
+stdenv.mkDerivation rec {
+  pname = "nx2elf";
+  version = "unstable-2020-05-26";
+
+  src = fetchFromGitHub {
+    owner = "shuffle2";
+    repo = "nx2elf";
+    rev = "7212e82a77b84fcc18ef2d050970350dbf63649b";
+    sha256 = "1j4k5s86c6ixa3wdqh4cfm31fxabwn6jcjc6pippx8mii98ac806";
+  };
+
+  buildInputs = [ lz4 ];
+
+  postPatch = ''
+    # This project does not comply with C++14 standards, and compilation on that fails.
+    # This does however succesfully compile with the gnu++20 standard.
+    substituteInPlace Makefile --replace "c++14" "gnu++20"
+
+    # pkg-config is not supported, so we'll manually use a non-ancient version of 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 = [ maintainers.ivar ];
+  };
+}