2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, pciutils
|
|
|
|
, libconfuse
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, audiofile
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, zlib
|
|
|
|
, eject
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-01-19 23:45:15 +00:00
|
|
|
pname = "pommed-light";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "1.51lw";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bytbox";
|
2022-01-19 23:45:15 +00:00
|
|
|
repo = "pommed-light";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "18fvdwwhcl6s4bpf2f2i389s71c8k4g0yb81am9rdddqmzaw27iy";
|
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
|
|
|
# Pull fix pending upstream inclusion for -fno-common toolchain support:
|
|
|
|
# https://github.com/bytbox/pommed-light/pull/38
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common.patch";
|
|
|
|
url = "https://github.com/bytbox/pommed-light/commit/5848b49b45a9c3ab047ebd17deb2162daab1e0b8.patch";
|
|
|
|
sha256 = "15rsq2i4rqp4ssab20486a1wgxi2cp87b7nxyk9h23gdwld713vf";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
pciutils
|
|
|
|
libconfuse
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
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" ];
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|