1{ lib, stdenv, fetchFromGitHub, pcsclite, pth, python2 }:
2
3stdenv.mkDerivation rec {
4 pname = "hexio";
5 version = "1.0-RC1";
6
7 src = fetchFromGitHub {
8 sha256 = "08jxkdi0gjsi8s793f9kdlad0a58a0xpsaayrsnpn9bpmm5cgihq";
9 rev = "version-${version}";
10 owner = "vanrein";
11 repo = "hexio";
12 };
13
14 strictDeps = true;
15
16 buildInputs = [ pcsclite pth python2 ];
17
18 patchPhase = ''
19 substituteInPlace Makefile \
20 --replace '-I/usr/local/include/PCSC/' '-I${lib.getDev pcsclite}/include/PCSC/' \
21 --replace '-L/usr/local/lib/pth' '-I${pth}/lib/'
22 '';
23
24 installPhase = ''
25 mkdir -p $out/bin $out/lib $out/sbin $out/man
26 make DESTDIR=$out PREFIX=/ all
27 make DESTDIR=$out PREFIX=/ install
28 '';
29
30 meta = with lib; {
31 description = "Low-level I/O helpers for hexadecimal, tty/serial devices and so on";
32 homepage = "https://github.com/vanrein/hexio";
33 license = licenses.bsd2;
34 platforms = platforms.linux;
35 maintainers = with maintainers; [ leenaars ];
36 };
37}