2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-01-02 11:29:13 +00:00
|
|
|
, cmake
|
|
|
|
, fetchpatch
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "heatshrink";
|
|
|
|
version = "0.4.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "atomicobject";
|
|
|
|
repo = "heatshrink";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
hash = "sha256-Nm9/+JFMDXY1N90hmNFGh755V2sXSRQ4VBN9f8TcsGk=";
|
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
# Add CMake build script, wanted by prusa-slicer and libbgcode, which are the only users of this library.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/atomicobject/heatshrink/commit/0886e9ca76552b8e325841e2b820b4563e5d5aba.patch";
|
|
|
|
hash = "sha256-13hy4+/RDaaKgQcdaSbACvMfElUIskvJ+owXqm40feY=";
|
|
|
|
})
|
|
|
|
];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
echo "Hello world" | \
|
|
|
|
$out/bin/heatshrink -e - | \
|
|
|
|
$out/bin/heatshrink -d - | \
|
|
|
|
grep "Hello world"
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Data compression/decompression library for embedded/real-time systems";
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://github.com/atomicobject/heatshrink";
|
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
platforms = platforms.all;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "heatshrink";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
})
|