emscripten: 3.1.64 -> 3.1.73 (#343743)
[NixPkgs.git] / pkgs / by-name / he / heatshrink / package.nix
blobb7508030f9cc45a931e44237219601f84da6128d
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , fetchpatch
6 }:
8 stdenv.mkDerivation (finalAttrs: {
9   pname = "heatshrink";
10   version = "0.4.1";
12   src = fetchFromGitHub {
13     owner = "atomicobject";
14     repo = "heatshrink";
15     rev = "v${finalAttrs.version}";
16     hash = "sha256-Nm9/+JFMDXY1N90hmNFGh755V2sXSRQ4VBN9f8TcsGk=";
17   };
19   patches = [
20     # Add CMake build script, wanted by prusa-slicer and libbgcode, which are the only users of this library.
21     (fetchpatch {
22       url = "https://github.com/atomicobject/heatshrink/commit/0886e9ca76552b8e325841e2b820b4563e5d5aba.patch";
23       hash = "sha256-13hy4+/RDaaKgQcdaSbACvMfElUIskvJ+owXqm40feY=";
24     })
25   ];
27   nativeBuildInputs = [
28     cmake
29   ];
31   doInstallCheck = true;
32   installCheckPhase = ''
33     runHook preInstallCheck
34     echo "Hello world" | \
35       $out/bin/heatshrink -e - | \
36       $out/bin/heatshrink -d - | \
37       grep "Hello world"
38     runHook postInstallCheck
39   '';
41   meta = with lib; {
42     description = "Data compression/decompression library for embedded/real-time systems";
43     homepage = "https://github.com/atomicobject/heatshrink";
44     license = licenses.isc;
45     maintainers = with maintainers; [ fgaz ];
46     platforms = platforms.all;
47     mainProgram = "heatshrink";
48   };