base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / ip / ipad_charge / package.nix
blobfdbab82aabcdc54dde78f411a32a2182b1e810d6
1 { lib, stdenv, fetchFromGitHub, libusb1 }:
3 stdenv.mkDerivation rec {
4   pname = "ipad_charge";
5   version = "2015-02-03";
7   src = fetchFromGitHub {
8     sha256 = "0f40hqx1dbqpwrhyf42h5982jwqv8j5zp5hwwakz6600hyqvnnz7";
9     rev = "bb24e1c3a79016cfdffb9d28189485766d655ec6";
10     repo = "ipad_charge";
11     owner = "mkorenkov";
12   };
14   buildInputs = [ libusb1 ];
16   postPatch = ''
17     substituteInPlace Makefile \
18       --replace " -o root -g root" "" \
19       --replace "/usr" "$out" \
20       --replace "/etc/udev" "$out/lib/udev"
21     substituteInPlace *.rules \
22       --replace "/usr" "$out"
23   '';
25   enableParallelBuilding = true;
27   preInstall = ''
28     mkdir -p $out/{bin,lib/udev/rules.d}
29   '';
31   meta = with lib; {
32     inherit (src.meta) homepage;
33     description = "Apple device USB charging utility for Linux";
34     longDescription = ''
35       USB charging control utility used to enable/disable charging of an Apple
36       device connected to USB port. For a list of supported devices, see
37       https://github.com/mkorenkov/ipad_charge#supported-devices.
38     '';
39     license = licenses.gpl2Plus;
40     platforms = platforms.linux;
41     mainProgram = "ipad_charge";
42   };