2022-11-14 21:28:24 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, autoreconfHook
|
|
|
|
, pkg-config
|
|
|
|
, help2man
|
|
|
|
, python3
|
|
|
|
|
|
|
|
, alsa-lib
|
|
|
|
, libxslt
|
|
|
|
, systemd
|
|
|
|
, libusb-compat-0_1
|
|
|
|
, libftdi1
|
|
|
|
, libICE
|
|
|
|
, libSM
|
|
|
|
, libX11
|
|
|
|
}:
|
2012-01-09 10:25:49 +00:00
|
|
|
|
2022-09-08 00:45:21 +01:00
|
|
|
let
|
|
|
|
pythonEnv = python3.pythonForBuild.withPackages (p: with p; [ pyyaml setuptools ]);
|
|
|
|
in
|
2012-01-09 10:25:49 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-06-20 15:15:21 +01:00
|
|
|
pname = "lirc";
|
2022-11-10 17:07:57 +00:00
|
|
|
version = "0.10.2";
|
2012-01-09 10:25:49 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-06-20 15:15:21 +01:00
|
|
|
url = "mirror://sourceforge/lirc/${pname}-${version}.tar.bz2";
|
2022-11-10 17:07:57 +00:00
|
|
|
sha256 = "sha256-PUTsgnSIHPJi8WCAVkHwgn/8wgreDYXn5vO5Dg09Iio=";
|
2012-01-09 10:25:49 +00:00
|
|
|
};
|
|
|
|
|
2022-05-25 21:59:44 +01:00
|
|
|
patches = [
|
|
|
|
# Fix installation of Python bindings
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://sourceforge.net/p/lirc/tickets/339/attachment/0001-Fix-Python-bindings.patch";
|
|
|
|
sha256 = "088a39x8c1qd81qwvbiqd6crb2lk777wmrs8rdh1ga06lglyvbly";
|
|
|
|
})
|
|
|
|
|
|
|
|
# Add a workaround for linux-headers-5.18 until upstream adapts:
|
|
|
|
# https://sourceforge.net/p/lirc/git/merge-requests/45/
|
|
|
|
./linux-headers-5.18.patch
|
|
|
|
];
|
2018-10-12 18:39:26 +01:00
|
|
|
|
2017-11-25 21:23:57 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
|
|
|
|
# fix overriding PYTHONPATH
|
2017-12-09 22:35:13 +00:00
|
|
|
sed -i 's,^PYTHONPATH *= *,PYTHONPATH := $(PYTHONPATH):,' \
|
|
|
|
Makefile.in
|
2017-11-25 21:23:57 +00:00
|
|
|
sed -i 's,PYTHONPATH=,PYTHONPATH=$(PYTHONPATH):,' \
|
|
|
|
doc/Makefile.in
|
2021-12-15 22:01:35 +00:00
|
|
|
|
|
|
|
# Pull fix for new pyyaml pending upstream inclusion
|
|
|
|
# https://sourceforge.net/p/lirc/git/merge-requests/39/
|
|
|
|
substituteInPlace python-pkg/lirc/database.py --replace 'yaml.load(' 'yaml.safe_load('
|
2022-09-08 00:45:21 +01:00
|
|
|
|
|
|
|
# cant import '/build/lirc-0.10.1/python-pkg/lirc/_client.so' while cross-compiling to check the version
|
|
|
|
substituteInPlace python-pkg/setup.py \
|
|
|
|
--replace "VERSION='0.0.0'" "VERSION='${version}'"
|
2017-11-25 21:23:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# use empty inc file instead of a from linux kernel generated one
|
|
|
|
touch lib/lirc/input_map.inc
|
|
|
|
'';
|
2014-08-30 23:32:37 +01:00
|
|
|
|
2022-09-08 00:45:21 +01:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-11-16 16:33:01 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook help2man libxslt pythonEnv pkg-config ];
|
2022-09-08 00:45:21 +01:00
|
|
|
|
2022-11-14 21:28:24 +00:00
|
|
|
buildInputs = [ alsa-lib systemd libusb-compat-0_1 libftdi1 libICE libSM libX11 ];
|
2017-01-09 20:28:32 +00:00
|
|
|
|
2022-09-08 00:45:21 +01:00
|
|
|
DEVINPUT_HEADER = "include/linux/input-event-codes.h";
|
2012-01-09 10:25:49 +00:00
|
|
|
|
2013-01-21 18:06:22 +00:00
|
|
|
configureFlags = [
|
2015-04-25 23:07:34 +01:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2017-11-25 21:23:57 +00:00
|
|
|
"--with-systemdsystemunitdir=$(out)/lib/systemd/system"
|
2018-10-12 18:39:26 +01:00
|
|
|
"--enable-uinput" # explicit activation because build env has no uinput
|
|
|
|
"--enable-devinput" # explicit activation because build env has no /dev/input
|
2021-09-19 17:05:12 +01:00
|
|
|
"--with-lockdir=/run/lirc/lock" # /run/lock is not writable for 'lirc' user
|
2022-09-08 00:45:21 +01:00
|
|
|
"PYTHON=${pythonEnv.interpreter}"
|
2013-01-21 18:06:22 +00:00
|
|
|
];
|
2014-08-30 23:32:37 +01:00
|
|
|
|
2015-04-26 04:20:59 +01:00
|
|
|
installFlags = [
|
2017-11-25 21:23:57 +00:00
|
|
|
"sysconfdir=$out/etc"
|
|
|
|
"localstatedir=$TMPDIR"
|
2015-04-26 04:20:59 +01:00
|
|
|
];
|
2015-04-25 23:07:34 +01:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2014-08-30 23:32:37 +01:00
|
|
|
description = "Allows to receive and send infrared signals";
|
2020-04-24 15:58:45 +01:00
|
|
|
homepage = "https://www.lirc.org/";
|
2014-08-30 23:32:37 +01:00
|
|
|
license = licenses.gpl2;
|
2014-08-31 01:17:19 +01:00
|
|
|
platforms = platforms.linux;
|
2014-08-30 23:32:37 +01:00
|
|
|
maintainers = with maintainers; [ pSub ];
|
|
|
|
};
|
2012-01-09 10:25:49 +00:00
|
|
|
}
|