1{ lib, stdenv, fetchFromGitHub }:
2
3stdenv.mkDerivation rec {
4 pname = "bakelite";
5 version = "unstable-2022-02-12";
6
7 src = fetchFromGitHub {
8 owner = "richfelker";
9 repo = pname;
10 rev = "373901734d114e42aa385e6a7843745674e4ca08";
11 hash = "sha256-HBnYlUyTkvPTbdsZD02yCq5C7yXOHYK4l4mDRUkcN5I=";
12 };
13
14 hardeningEnable = [ "pie" ];
15 preBuild = ''
16 # pipe2() is only exposed with _GNU_SOURCE
17 # Upstream makefile explicitly uses -O3 to improve SHA-3 performance
18 makeFlagsArray+=( CFLAGS="-D_GNU_SOURCE -g -O3" )
19 '';
20
21 installPhase = ''
22 mkdir -p $out/bin
23 cp bakelite $out/bin
24 '';
25
26 meta = with lib; {
27 homepage = "https://github.com/richfelker/bakelite";
28 description = "Incremental backup with strong cryptographic confidentality";
29 license = licenses.gpl2;
30 maintainers = with maintainers; [ mvs ];
31 # no support for Darwin (yet: https://github.com/richfelker/bakelite/pull/5)
32 platforms = platforms.linux;
33 };
34}