@@ -0,0 +1,47 @@
1+{ stdenv, fetchgit, autoconf, automake, utillinux, openssl, libuuid, gnu-efi
2+, binutils, pkgconfig, help2man }:
3+
4+stdenv.mkDerivation rec {
5+ name = "sbsigntool-${version}";
6+ version = "0.5";
7+
8+ src = fetchgit {
9+ url = "git://kernel.ubuntu.com/jk/sbsigntool";
10+ rev = "951ee95a301674c046f55330cd7460e1314deff2";
11+ sha256 = "09k8by0qq8j7ff812l1l9z9frsx5c4cmhj5in3g1sgyz3v55nfy7";
12+ };
13+
14+ patches = [ ./autoconf.patch ];
15+
16+ buildInputs = [ autoconf automake utillinux openssl libuuid gnu-efi binutils pkgconfig help2man ];
17+
18+ configurePhase = ''
19+ substituteInPlace configure.ac --replace "@@NIX_GNUEFI@@" "${gnu-efi}"
20+
21+ lib/ccan.git/tools/create-ccan-tree --build-type=automake lib/ccan "talloc read_write_all build_assert array_size"
22+ touch AUTHORS
23+ touch ChangeLog
24+
25+ echo "SUBDIRS = lib/ccan src docs" >> Makefile.am
26+
27+ aclocal
28+ autoheader
29+ autoconf
30+ automake --add-missing -Wno-portability
31+
32+ ./configure --prefix=$out
33+ '';
34+
35+ installPhase = ''
36+ mkdir -p $out
37+ make install
38+ '';
39+
40+ meta = with stdenv.lib; {
41+ description = "Tools for maintaining UEFI signature databases";
42+ homepage = http://jk.ozlabs.org/docs/sbkeysync-maintaing-uefi-key-databases;
43+ maintainers = [ maintainers.tstrobel ];
44+ platforms = platforms.linux;
45+ };
46+}
47+