@@ -0,0 +1,31 @@
1+{ stdenv, fetchFromGitHub, cmake, pkgconfig }:
2+
3+stdenv.mkDerivation rec {
4+ name = "raspberrypi-tools-${version}";
5+ version = "2018-02-05";
6+
7+ src = fetchFromGitHub {
8+ owner = "raspberrypi";
9+ repo = "userland";
10+ rev = "a343dcad1dae4e93f4bfb99496697e207f91027e";
11+ sha256 = "1z4qrwjb7x3a45mx978q8vyhnx068sgzhymm4z0ayhckji4ngal1";
12+ };
13+
14+ patches = [ ./tools-dont-install-sysv-init-scripts.patch ];
15+
16+ nativeBuildInputs = [ cmake pkgconfig ];
17+
18+ preConfigure = ''
19+ cmakeFlagsArray+=("-DVMCS_INSTALL_PREFIX=$out")
20+ '' + stdenv.lib.optionalString stdenv.isAarch64 ''
21+ cmakeFlagsArray+=("-DARM64=1")
22+ '';
23+
24+ meta = with stdenv.lib; {
25+ description = "Userland tools for the Raspberry Pi board";
26+ homepage = https://github.com/raspberrypi/userland;
27+ license = licenses.bsd3;
28+ platforms = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" ];
29+ maintainers = with maintainers; [ dezgeg viric tavyc ];
30+ };
31+}