From eda0e2250e0a3672a199fe7a05481180c9ce44d5 Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Sat, 20 Jan 2024 20:35:51 +0400 Subject: [PATCH] c-periphery: init at 2.4.2 --- pkgs/by-name/c-/c-periphery/package.nix | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pkgs/by-name/c-/c-periphery/package.nix diff --git a/pkgs/by-name/c-/c-periphery/package.nix b/pkgs/by-name/c-/c-periphery/package.nix new file mode 100644 index 000000000000..7e033a1a3327 --- /dev/null +++ b/pkgs/by-name/c-/c-periphery/package.nix @@ -0,0 +1,35 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "c-periphery"; + version = "2.4.2"; + + src = fetchFromGitHub { + owner = "vsergeev"; + repo = "c-periphery"; + rev = "v${finalAttrs.version}"; + hash = "sha256-uUSXvMQcntUqD412UWkMif0wLxPhpPdnMb96Pqqh/B4="; + }; + + outputs = [ "dev" "lib" "out" ]; + + postPatch = '' + substituteInPlace src/libperiphery.pc.in \ + --replace '=''${prefix}/' '=' \ + --replace '=''${exec_prefix}/' '=' + ''; + + nativeBuildInputs = [ cmake ]; + + meta = with lib; { + description = "A C library for peripheral I/O (GPIO, LED, PWM, SPI, I2C, MMIO, Serial) in Linux"; + homepage = "https://github.com/vsergeev/c-periphery"; + license = licenses.mit; + maintainers = with maintainers; [ sikmir ]; + platforms = platforms.linux; + }; +})