about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libraspberrypi
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libraspberrypi')
-rw-r--r--nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix b/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix
new file mode 100644
index 000000000000..d4d69ed6afff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libraspberrypi";
+  version = "unstable-2021-03-17";
+
+  src = fetchFromGitHub {
+    owner = "raspberrypi";
+    repo = "userland";
+    rev = "3fd8527eefd8790b4e8393458efc5f94eb21a615";
+    sha256 = "099qxh4bjzwd431ffpdhzx0gzlrkdyf66wplgkwg2rrfrc9zlv5a";
+  };
+
+  patches = [
+    (fetchpatch {
+      # https://github.com/raspberrypi/userland/pull/670
+      url = "https://github.com/raspberrypi/userland/pull/670/commits/37cb44f314ab1209fe2a0a2449ef78893b1e5f62.patch";
+      sha256 = "1fbrbkpc4cc010ji8z4ll63g17n6jl67kdy62m74bhlxn72gg9rw";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  cmakeFlags = [
+    (if (stdenv.hostPlatform.isAarch64) then "-DARM64=ON" else "-DARM64=OFF")
+    "-DVMCS_INSTALL_PREFIX=${placeholder "out"}"
+  ];
+
+  meta = with lib; {
+    description = "Userland tools & libraries for interfacing with Raspberry Pi hardware";
+    homepage = "https://github.com/raspberrypi/userland";
+    license = licenses.bsd3;
+    platforms = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" "x86_64-linux" ];
+    maintainers = with maintainers; [ dezgeg tavyc tkerber ];
+  };
+}