about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorThiago Kenji Okada <thiagokokada@gmail.com>2024-03-13 16:11:44 +0000
committerGitHub <noreply@github.com>2024-03-13 16:11:44 +0000
commita0906f14161a5c5792e9883117b9471f5bf6df72 (patch)
tree5a7c553558591b1250b3012b529ff0e171c89436 /pkgs/by-name
parent064bd955a09bb8d24c4141c48c639d45027c2890 (diff)
parente908c6a0e66617d4f8cc7aa031d2f204660d55ba (diff)
downloadnixlib-a0906f14161a5c5792e9883117b9471f5bf6df72.tar
nixlib-a0906f14161a5c5792e9883117b9471f5bf6df72.tar.gz
nixlib-a0906f14161a5c5792e9883117b9471f5bf6df72.tar.bz2
nixlib-a0906f14161a5c5792e9883117b9471f5bf6df72.tar.lz
nixlib-a0906f14161a5c5792e9883117b9471f5bf6df72.tar.xz
nixlib-a0906f14161a5c5792e9883117b9471f5bf6df72.tar.zst
nixlib-a0906f14161a5c5792e9883117b9471f5bf6df72.zip
Merge pull request #295353 from thiagokokada/ndstrim-init
ndstrim: init at 0.2.1
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/nd/ndstrim/package.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/by-name/nd/ndstrim/package.nix b/pkgs/by-name/nd/ndstrim/package.nix
new file mode 100644
index 000000000000..403bd831a76b
--- /dev/null
+++ b/pkgs/by-name/nd/ndstrim/package.nix
@@ -0,0 +1,50 @@
+{ lib
+, fetchFromGitHub
+, fetchpatch
+, rustPlatform
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "ndstrim";
+  version = "0.2.1";
+
+  src = fetchFromGitHub {
+    owner = "Nemris";
+    repo = "ndstrim";
+    rev = "v${version}";
+    hash = "sha256-KgtejBbFg6+klc8OpCs1CIb+7uVPCtP0/EM671vxauk=";
+  };
+
+  patches = [
+    # https://github.com/Nemris/ndstrim/pull/1
+    (fetchpatch {
+      name = "update-cargo-lock.patch";
+      url = "https://github.com/Nemris/ndstrim/commit/8147bb31a8fb5765f33562957a61cb6ddbe65513.patch";
+      hash = "sha256-HsCc5un9dg0gRkRjwxtjms0cugqWhcTthGfcF50EgYA=";
+    })
+  ];
+
+  cargoHash = "sha256-k5SlsIWHEZaYwk5cmLb1QMs3lk0VGGwiGd1TSQJC3Ss=";
+
+  # TODO: remove this after upstream merge above patch.
+  # Without the workaround below the build results in the following error:
+  # Validating consistency between /build/source/Cargo.lock and /build/ndstrim-0.2.1-vendor.tar.gz/Cargo.lock
+  # <hash>
+  # < version = "0.2.1"
+  # ---
+  # > version = "0.1.0"
+  #
+  # ERROR: cargoHash or cargoSha256 is out of date
+  postPatch = ''
+    cargoSetupPostPatchHook() { true; }
+  '';
+
+  meta = with lib; {
+    description = "Trim the excess padding found in Nintendo DS(i) ROMs";
+    homepage = "https://github.com/Nemris/ndstrim";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ thiagokokada ];
+    mainProgram = "ndstrim";
+  };
+}