@@ -0,0 +1,45 @@
1+{ stdenv
2+, lib
3+, fetchgit
4+, pkg-config
5+, meson
6+, ninja
7+, systemd
8+, liburing
9+, zstd
10+}:
11+
12+stdenv.mkDerivation rec {
13+ pname = "plocate";
14+ version = "1.1.7";
15+
16+ src = fetchgit {
17+ url = "https://git.sesse.net/plocate";
18+ rev = version;
19+ sha256 = "sha256-5Ie4qgiKUoI9Kma6YvjXirvBbpbKVuaMSSAZa36zN3M=";
20+ };
21+
22+ postPatch = ''
23+ sed -i meson.build \
24+ -e "s@unitdir =.*@unitdir = '$out/lib/systemd/system'@" \
25+ -e '/mkdir\.sh/d'
26+ '';
27+
28+ nativeBuildInputs = [ meson ninja pkg-config ];
29+
30+ buildInputs = [ systemd liburing zstd ];
31+
32+ mesonFlags = [
33+ # I don't know why we can't do this but instead have to resort to patching meson.build
34+ # "-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
35+ "-Dsharedstatedir=/var/lib"
36+ ];
37+
38+ meta = with lib; {
39+ description = "Much faster locate";
40+ homepage = "https://plocate.sesse.net/";
41+ license = licenses.mit;
42+ maintainers = with maintainers; [ peterhoeg ];
43+ platforms = platforms.linux;
44+ };
45+}