2021-09-19 18:08:58 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, util-linux, bash }:
|
2014-02-01 11:30:23 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "bcache-tools";
|
2014-05-25 12:15:25 +01:00
|
|
|
version = "1.0.7";
|
2014-02-01 11:30:23 +00:00
|
|
|
|
2021-09-19 18:08:58 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "g2p";
|
|
|
|
repo = "bcache-tools";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-Ors2xXRrVTf8Cq3BYnSVSfJy/nyGjT5BGLSNpxOcHR4=";
|
2014-02-01 11:30:23 +00:00
|
|
|
};
|
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-11-24 15:29:28 +00:00
|
|
|
buildInputs = [ util-linux ];
|
2014-02-01 11:30:23 +00:00
|
|
|
|
|
|
|
# * Remove broken install rules (they ignore $PREFIX) for stuff we don't need
|
|
|
|
# anyway (it's distro specific stuff).
|
|
|
|
# * Fixup absolute path to modprobe.
|
|
|
|
prePatch = ''
|
|
|
|
sed -e "/INSTALL.*initramfs\/hook/d" \
|
|
|
|
-e "/INSTALL.*initcpio\/install/d" \
|
|
|
|
-e "/INSTALL.*dracut\/module-setup.sh/d" \
|
2020-06-19 18:15:47 +01:00
|
|
|
-e "s/pkg-config/$PKG_CONFIG/" \
|
2014-02-01 11:30:23 +00:00
|
|
|
-i Makefile
|
|
|
|
'';
|
|
|
|
|
2015-06-12 21:57:05 +01:00
|
|
|
patches = [
|
|
|
|
./bcache-udev-modern.patch
|
|
|
|
./fix-static.patch
|
|
|
|
];
|
2014-11-02 15:57:19 +00:00
|
|
|
|
2020-06-19 18:15:47 +01:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
"UDEVLIBDIR=${placeholder "out"}/lib/udev/"
|
|
|
|
];
|
|
|
|
|
2014-02-01 11:30:23 +00:00
|
|
|
preBuild = ''
|
2017-06-01 21:35:40 +01:00
|
|
|
sed -e "s|/bin/sh|${bash}/bin/sh|" -i *.rules
|
2014-02-01 11:30:23 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/sbin" "$out/lib/udev/rules.d" "$out/share/man/man8"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-02-01 11:30:23 +00:00
|
|
|
description = "User-space tools required for bcache (Linux block layer cache)";
|
|
|
|
longDescription = ''
|
|
|
|
Bcache is a Linux kernel block layer cache. It allows one or more fast
|
|
|
|
disk drives such as flash-based solid state drives (SSDs) to act as a
|
|
|
|
cache for one or more slower hard disk drives.
|
2021-01-19 21:20:11 +00:00
|
|
|
|
2014-02-01 11:30:23 +00:00
|
|
|
This package contains the required user-space tools.
|
|
|
|
|
|
|
|
User documentation is in Documentation/bcache.txt in the Linux kernel
|
|
|
|
tree.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://bcache.evilpiepirate.org/";
|
2014-02-01 11:30:23 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|