ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / nd / ndstrim / package.nix
blobedf35039388a9289e35ceb44b8d1eb2c7298dca1
1 { lib
2 , fetchFromGitHub
3 , fetchpatch
4 , rustPlatform
5 }:
7 rustPlatform.buildRustPackage rec {
8   pname = "ndstrim";
9   version = "0.2.1";
11   src = fetchFromGitHub {
12     owner = "Nemris";
13     repo = "ndstrim";
14     rev = "v${version}";
15     hash = "sha256-KgtejBbFg6+klc8OpCs1CIb+7uVPCtP0/EM671vxauk=";
16   };
18   patches = [
19     # https://github.com/Nemris/ndstrim/pull/1
20     (fetchpatch {
21       name = "update-cargo-lock.patch";
22       url = "https://github.com/Nemris/ndstrim/commit/8147bb31a8fb5765f33562957a61cb6ddbe65513.patch";
23       hash = "sha256-HsCc5un9dg0gRkRjwxtjms0cugqWhcTthGfcF50EgYA=";
24     })
25   ];
27   cargoHash = "sha256-k5SlsIWHEZaYwk5cmLb1QMs3lk0VGGwiGd1TSQJC3Ss=";
29   # TODO: remove this after upstream merge above patch.
30   # Without the workaround below the build results in the following error:
31   # Validating consistency between /build/source/Cargo.lock and /build/ndstrim-0.2.1-vendor.tar.gz/Cargo.lock
32   # <hash>
33   # < version = "0.2.1"
34   # ---
35   # > version = "0.1.0"
36   #
37   # ERROR: cargoHash or cargoSha256 is out of date
38   postPatch = ''
39     cargoSetupPostPatchHook() { true; }
40   '';
42   meta = with lib; {
43     description = "Trim the excess padding found in Nintendo DS(i) ROMs";
44     homepage = "https://github.com/Nemris/ndstrim";
45     changelog = "https://github.com/Nemris/ndstrim/blob/${src.rev}/CHANGELOG.md";
46     license = licenses.mit;
47     platforms = platforms.unix;
48     maintainers = with maintainers; [ thiagokokada ];
49     mainProgram = "ndstrim";
50   };