2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libusb1 }:
|
2015-08-02 23:45:13 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "ipad_charge";
|
2016-01-24 19:31:44 +00:00
|
|
|
version = "2015-02-03";
|
2015-08-02 23:45:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
sha256 = "0f40hqx1dbqpwrhyf42h5982jwqv8j5zp5hwwakz6600hyqvnnz7";
|
|
|
|
rev = "bb24e1c3a79016cfdffb9d28189485766d655ec6";
|
|
|
|
repo = "ipad_charge";
|
|
|
|
owner = "mkorenkov";
|
|
|
|
};
|
|
|
|
|
2015-12-17 15:41:57 +00:00
|
|
|
buildInputs = [ libusb1 ];
|
2015-08-02 23:45:13 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace " -o root -g root" "" \
|
2019-02-21 07:33:18 +00:00
|
|
|
--replace "/usr" "$out" \
|
|
|
|
--replace "/etc/udev" "$out/lib/udev"
|
|
|
|
substituteInPlace *.rules \
|
2015-08-02 23:45:13 +00:00
|
|
|
--replace "/usr" "$out"
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
preInstall = ''
|
2019-02-21 07:33:18 +00:00
|
|
|
mkdir -p $out/{bin,lib/udev/rules.d}
|
2015-08-02 23:45:13 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-08-02 23:45:13 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Apple device USB charging utility for Linux";
|
|
|
|
longDescription = ''
|
|
|
|
USB charging control utility used to enable/disable charging of an Apple
|
|
|
|
device connected to USB port. For a list of supported devices, see
|
|
|
|
https://github.com/mkorenkov/ipad_charge#supported-devices.
|
|
|
|
'';
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "ipad_charge";
|
2015-08-02 23:45:13 +00:00
|
|
|
};
|
|
|
|
}
|