nixpkgs/pkgs/os-specific/linux/pommed-light/default.nix
Jonathan Ringer 9bb3fccb5b treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix
continuation of #109595

pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.

python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
2021-01-19 01:16:25 -08:00

66 lines
1.6 KiB
Nix

{ lib, stdenv
, fetchFromGitHub
, pciutils
, libconfuse
, alsaLib
, audiofile
, pkg-config
, zlib
, eject
}:
stdenv.mkDerivation rec {
pkgname = "pommed-light";
version = "1.51lw";
name = "${pkgname}-${version}";
src = fetchFromGitHub {
owner = "bytbox";
repo = pkgname;
rev = "v${version}";
sha256 = "18fvdwwhcl6s4bpf2f2i389s71c8k4g0yb81am9rdddqmzaw27iy";
};
postPatch = ''
substituteInPlace pommed.conf.mactel --replace /usr $out
substituteInPlace pommed.conf.pmac --replace /usr $out
substituteInPlace pommed/beep.h --replace /usr $out
substituteInPlace pommed/cd_eject.c --replace /usr/bin/eject ${eject}/bin/eject
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [
pciutils
libconfuse
alsaLib
audiofile
zlib
eject
];
installPhase = ''
install -Dm755 pommed/pommed $out/bin/pommed
install -Dm644 pommed.conf.mactel $out/etc/pommed.conf.mactel
install -Dm644 pommed.conf.pmac $out/etc/pommed.conf.pmac
# Man page
install -Dm644 pommed.1 $out/share/man/man1/pommed.1
# Sounds
install -Dm644 pommed/data/goutte.wav $out/share/pommed/goutte.wav
install -Dm644 pommed/data/click.wav $out/share/pommed/click.wav
'';
meta = {
description = "A trimmed version of the pommed hotkey handler for MacBooks";
longDescription = ''
This is a stripped-down version of pommed with client, dbus, and
ambient light sensor support removed, optimized for use with dwm
and the like.
'';
homepage = "https://github.com/bytbox/pommed-light";
platforms = [ "x86_64-linux" ];
license = lib.licenses.gpl2;
};
}