Unverified Commit b658c824 authored by Daniel Schaefer's avatar Daniel Schaefer Committed by GitHub
Browse files

libtypec: init at 0.6.1 (#270763)

parents 3f24c45f bd9441ae
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  meson,
  ninja,
  pkg-config,
  libusb1,
  systemd,
  libudev0-shim,
  gtk3, # utils
}:

stdenv.mkDerivation rec {
  pname = "libtypec";
  version = "0.6.1";

  src = fetchFromGitHub {
    owner = "libtypec";
    repo = pname;
    rev = "${pname}-${version}";
    hash = "sha256-XkT0bgBjoJTAFa9NLZdzbJSpchiXxKjeu88PeT/AlPY=";
  };

  outputs = [
    "out"
    "lib"
    "dev"
  ];

  nativeBuildInputs = [
    meson
    ninja
    pkg-config
  ];

  buildInputs = [
    libusb1
    libudev0-shim
    systemd
    gtk3
  ];

  mesonFlags = [
    (lib.mesonBool "utils" true)
    "--prefix=${placeholder "dev"}"
  ];

  # Don't propagate out to the dev output to avoid pulling in GUI dependencies
  propagatedBuildOutputs = [ "lib" ];

  meta = with lib; {
    homepage = "https://github.com/libtypec/libtypec";
    description = "generic diagnostic tool interface for usb-c ports";
    longDescription = "libtypec is aimed to provide a generic interface abstracting all platform complexity for user space to develop tools for efficient USB-C port management. The library can also enable development of diagnostic and debug tools to debug system issues around USB-C/USB PD topology.";
    platforms = platforms.linux;
    license = with licenses; [
      mit
      gpl2Only
    ];
    maintainers = with maintainers; [ johnazoidberg ];
  };
}