btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / libirecovery / package.nix
blobc58287aedad16d76c952319c4d3eaeba951ca929
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , autoreconfHook
5 , pkg-config
6 , libusb1
7 , readline
8 , libimobiledevice-glue
9 }:
11 stdenv.mkDerivation rec {
12   pname = "libirecovery";
13   version = "1.2.1";
15   outputs = [ "out" "dev" ];
17   src = fetchFromGitHub {
18     owner = "libimobiledevice";
19     repo = pname;
20     rev = version;
21     hash = "sha256-R+oBC7F4op0qoIk3d/WqS4MwzZY3WMAMIqlJfJb188Q=";
22   };
24   nativeBuildInputs = [
25     autoreconfHook
26     pkg-config
27   ];
29   buildInputs = [
30     libusb1
31     readline
32     libimobiledevice-glue
33   ];
35   preAutoreconf = ''
36     export RELEASE_VERSION=${version}
37   '';
39   # Packager note: Not clear whether this needs a NixOS configuration,
40   # as only the `idevicerestore` binary was tested so far (which worked
41   # without further configuration).
42   configureFlags = [
43     "--with-udevrulesdir=${placeholder "out"}/lib/udev/rules.d"
44     ''--with-udevrule="OWNER=\"root\", GROUP=\"myusergroup\", MODE=\"0660\""''
45   ];
47   meta = with lib; {
48     description = "Library and utility to talk to iBoot/iBSS via USB on Mac OS X, Windows, and Linux";
49     longDescription = ''
50       libirecovery is a cross-platform library which implements communication to
51       iBoot/iBSS found on Apple's iOS devices via USB. A command-line utility is also
52       provided.
53     '';
54     homepage = "https://github.com/libimobiledevice/libirecovery";
55     license = licenses.lgpl21Only;
56     maintainers = with maintainers; [ nh2 ];
57     mainProgram = "irecovery";
58     platforms = platforms.unix;
59   };