Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

59 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
pkgsBuildHost,
versionCheckHook,
}:
# Changing the variables CPPFLAGS and BUILD_CONFIG_NAME can be done by
# overriding the same-named attributes. See ./presets.nix for examples.
stdenv.mkDerivation (finalAttrs: {
pname = "mkspiffs";
version = "0.2.3";
src = fetchFromGitHub {
owner = "igrr";
repo = "mkspiffs";
tag = finalAttrs.version;
fetchSubmodules = true;
hash = "sha256-oa6Lmo2yb66IjtEKkZyJBgM/p7rdvmrKfgNd2rAM/Lk=";
};
# 1) Fix build for Darwin
# 2) Fix cross
# 3) Do not run test as part of the buildPhase - the checkPhase will run it as `make test`
postPatch = ''
substituteInPlace Makefile \
--replace-fail "-arch i386 -arch x86_64" "" \
--replace-fail "strip" "${pkgsBuildHost.binutils.targetPrefix}strip" \
--replace-fail "dist: test" ""
'';
strictDeps = true;
buildFlags = [ "dist" ];
makeFlags = [
"VERSION=${finalAttrs.version}"
"SPIFFS_VERSION=unknown"
];
installPhase = ''
install -Dm755 -t $out/bin mkspiffs
'';
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
meta = {
description = "Tool to build and unpack SPIFFS images";
license = lib.licenses.mit;
homepage = "https://github.com/igrr/mkspiffs";
maintainers = [ lib.maintainers.haslersn ];
platforms = lib.platforms.all;
mainProgram = "mkspiffs";
};
})