@@ -0,0 +1,58 @@
1+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
2+, curl
3+, libimobiledevice
4+, libirecovery
5+, libzip
6+, libusbmuxd
7+}:
8+
9+stdenv.mkDerivation rec {
10+ pname = "idevicerestore";
11+ version = "2019-02-14";
12+
13+ src = fetchFromGitHub {
14+ owner = "libimobiledevice";
15+ repo = pname;
16+ rev = "8a882038b2b1e022fbd19eaf8bea51006a373c06";
17+ sha256 = "17lisl7ll43ixl1zqwchn7jljrdyl2p9q99w30i6qaci71mas37m";
18+ };
19+
20+ nativeBuildInputs = [
21+ autoreconfHook
22+ pkgconfig
23+ ];
24+
25+ buildInputs = [
26+ curl
27+ libimobiledevice
28+ libirecovery
29+ libzip
30+ libusbmuxd
31+ # Not listing other dependencies specified in
32+ # https://github.com/libimobiledevice/idevicerestore/blob/8a882038b2b1e022fbd19eaf8bea51006a373c06/README#L20
33+ # because they are inherited `libimobiledevice`.
34+ ];
35+
36+ meta = with stdenv.lib; {
37+ homepage = https://github.com/libimobiledevice/idevicerestore;
38+ description = "Restore/upgrade firmware of iOS devices";
39+ longDescription = ''
40+ The idevicerestore tool allows to restore firmware files to iOS devices.
41+
42+ It is a full reimplementation of all granular steps which are performed during
43+ restore of a firmware to a device.
44+
45+ In general, upgrades and downgrades are possible, however subject to
46+ availability of SHSH blobs from Apple for signing the firmare files.
47+
48+ To restore a device to some firmware, simply run the following:
49+ $ sudo idevicerestore -l
50+
51+ This will download and restore a device to the latest firmware available.
52+ '';
53+ license = licenses.lgpl21Plus;
54+ # configure.ac suggests it should work for darwin and mingw as well but not tried yet
55+ platforms = platforms.linux;
56+ maintainers = with maintainers; [ nh2 ];
57+ };
58+}