core/pkgs/by-name/sq/sqlite/sqlar.nix

47 lines
956 B
Nix
Raw Normal View History

2024-06-30 08:16:52 +00:00
{
lib,
stdenv,
fetchurl,
fuse,
zlib,
withFuse ? true,
}:
2024-05-02 00:46:19 +00:00
stdenv.mkDerivation {
pname = "sqlar";
version = "2018-01-07";
src = fetchurl {
url = "https://www.sqlite.org/sqlar/tarball/4824e73896/sqlar-src-4824e73896.tar.gz";
sha256 = "09pikkbp93gqypn3da9zi0dzc47jyypkwc9vnmfzhmw7kpyv8nm9";
};
postPatch = ''
substituteInPlace Makefile \
--replace 'gcc' '${stdenv.cc.targetPrefix}cc'
'';
2024-06-30 08:16:52 +00:00
buildInputs = [ zlib ] ++ lib.optional withFuse fuse;
2024-05-02 00:46:19 +00:00
2024-06-30 08:16:52 +00:00
buildFlags = [
"CFLAGS=-Wno-error"
"sqlar"
] ++ lib.optional withFuse "sqlarfs";
2024-05-02 00:46:19 +00:00
2024-06-30 08:16:52 +00:00
installPhase =
''
install -D -t $out/bin sqlar
''
+ lib.optionalString withFuse ''
install -D -t $out/bin sqlarfs
'';
2024-05-02 00:46:19 +00:00
meta = with lib; {
homepage = "https://sqlite.org/sqlar";
description = "SQLite Archive utilities";
license = licenses.bsd2;
platforms = platforms.all;
maintainers = with maintainers; [ dtzWill ];
};
}