1{ stdenv, fetchFromGitHub, libusb }:
2
3let version = "2015-02-03"; in
4stdenv.mkDerivation rec {
5 name = "ipad_charge-${version}";
6
7 src = fetchFromGitHub {
8 sha256 = "0f40hqx1dbqpwrhyf42h5982jwqv8j5zp5hwwakz6600hyqvnnz7";
9 rev = "bb24e1c3a79016cfdffb9d28189485766d655ec6";
10 repo = "ipad_charge";
11 owner = "mkorenkov";
12 };
13
14 buildInputs = [ libusb ];
15
16 postPatch = ''
17 substituteInPlace Makefile \
18 --replace " -o root -g root" "" \
19 --replace "/usr" "$out"
20 sed "/rules\.d/d" -i Makefile
21 '';
22
23 enableParallelBuilding = true;
24
25 preInstall = ''
26 mkdir -p $out/bin
27 '';
28
29 meta = with stdenv.lib; {
30 inherit version;
31 inherit (src.meta) homepage;
32 description = "Apple device USB charging utility for Linux";
33 longDescription = ''
34 USB charging control utility used to enable/disable charging of an Apple
35 device connected to USB port. For a list of supported devices, see
36 https://github.com/mkorenkov/ipad_charge#supported-devices.
37 '';
38 license = licenses.gpl2Plus;
39 platforms = platforms.linux;
40 maintainers = with maintainers; [ nckx ];
41 };
42}