1{ lib, stdenv
2, fetchFromGitHub
3, fetchpatch
4, cmake
5, pkg-config
6}:
7
8stdenv.mkDerivation rec {
9 pname = "libraspberrypi";
10 version = "unstable-2022-06-16";
11
12 src = fetchFromGitHub {
13 owner = "raspberrypi";
14 repo = "userland";
15 rev = "54fd97ae4066a10b6b02089bc769ceed328737e0";
16 hash = "sha512-f7tBgIykcIdkwcFjBKk5ooD/5Bsyrd/0OFr7LNCwWFYeE4DH3XA7UR7YjArkwqUVCVBByr82EOaacw0g1blOkw==";
17 };
18
19 patches = [
20 (fetchpatch {
21 # https://github.com/raspberrypi/userland/pull/670
22 url = "https://github.com/raspberrypi/userland/commit/37cb44f314ab1209fe2a0a2449ef78893b1e5f62.patch";
23 sha256 = "1fbrbkpc4cc010ji8z4ll63g17n6jl67kdy62m74bhlxn72gg9rw";
24 })
25 ];
26
27 nativeBuildInputs = [ cmake pkg-config ];
28 cmakeFlags = [
29 (if (stdenv.hostPlatform.isAarch64) then "-DARM64=ON" else "-DARM64=OFF")
30 "-DVMCS_INSTALL_PREFIX=${placeholder "out"}"
31 ];
32
33 meta = with lib; {
34 description = "Userland tools & libraries for interfacing with Raspberry Pi hardware";
35 homepage = "https://github.com/raspberrypi/userland";
36 license = licenses.bsd3;
37 platforms = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" "x86_64-linux" ];
38 maintainers = with maintainers; [ dezgeg tkerber ];
39 };
40}