nixpkgs/pkgs/by-name/ip/ipad_charge/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

44 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, libusb1 }:
stdenv.mkDerivation rec {
pname = "ipad_charge";
version = "2015-02-03";
src = fetchFromGitHub {
sha256 = "0f40hqx1dbqpwrhyf42h5982jwqv8j5zp5hwwakz6600hyqvnnz7";
rev = "bb24e1c3a79016cfdffb9d28189485766d655ec6";
repo = "ipad_charge";
owner = "mkorenkov";
};
buildInputs = [ libusb1 ];
postPatch = ''
substituteInPlace Makefile \
--replace " -o root -g root" "" \
--replace "/usr" "$out" \
--replace "/etc/udev" "$out/lib/udev"
substituteInPlace *.rules \
--replace "/usr" "$out"
'';
enableParallelBuilding = true;
preInstall = ''
mkdir -p $out/{bin,lib/udev/rules.d}
'';
meta = with lib; {
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;
mainProgram = "ipad_charge";
};
}