Skip to content

Commit 38a5ef6

Browse files
committed
Update README
1 parent 54a106e commit 38a5ef6

File tree

1 file changed

+161
-22
lines changed

1 file changed

+161
-22
lines changed

README.md

Lines changed: 161 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ via USB.*
55

66
![](https://github.com/libimobiledevice/libirecovery/workflows/build/badge.svg)
77

8+
## Table of Contents
9+
- [Features](#features)
10+
- [Building](#building)
11+
- [Prerequisites](#prerequisites)
12+
- [Linux (Debian/Ubuntu based)](#linux-debianubuntu-based)
13+
- [macOS](#macos)
14+
- [Windows](#windows)
15+
- [Configuring the source tree](#configuring-the-source-tree)
16+
- [Building and installation](#building-and-installation)
17+
- [Usage](#usage)
18+
- [Contributing](#contributing)
19+
- [Links](#links)
20+
- [License](#license)
21+
- [Credits](#credits)
22+
823
## Features
924

1025
libirecovery is a cross-platform library which implements communication to
@@ -14,38 +29,164 @@ iBoot/iBSS found on Apple's iOS devices via USB. A command-line utility named
1429
This is a fork of an older version from former openjailbreak.org and is meant to
1530
be used with [idevicerestore](https://github.com/libimobiledevice/idevicerestore.git/) from the [libimobiledevice](https://github.com/libimobiledevice/) project.
1631

17-
## Installation / Getting started
32+
## Building
33+
34+
### Prerequisites
35+
36+
You need to have a working compiler (gcc/clang) and development environent
37+
available. This project uses autotools for the build process, allowing to
38+
have common build steps across different platforms.
39+
Only the prerequisites differ and they are described in this section.
40+
41+
libirecovery requires [libimobiledevice-glue](https://github.com/libimobiledevice/libimobiledevice-glue).
42+
Check the [Building](https://github.com/libimobiledevice/libimobiledevice-glue?tab=readme-ov-file#building)
43+
section of the README on how to build it. Note that some platforms might have it as a package.
44+
45+
#### Linux (Debian/Ubuntu based)
46+
47+
* Install all required dependencies and build tools:
48+
```shell
49+
sudo apt-get install \
50+
build-essential \
51+
pkg-config \
52+
checkinstall \
53+
git \
54+
autoconf \
55+
automake \
56+
libtool-bin \
57+
libimobiledevice-glue-dev \
58+
libreadline-dev \
59+
libusb-1.0-0-dev
60+
```
61+
62+
In case libimobiledevice-glue-dev is not available, you can manually build and install it. See note above.
63+
64+
#### macOS
65+
66+
* Make sure the Xcode command line tools are installed. Then, use either [MacPorts](https://www.macports.org/)
67+
or [Homebrew](https://brew.sh/) to install `automake`, `autoconf`, `libtool`, etc.
68+
69+
Using MacPorts:
70+
```shell
71+
sudo port install libtool autoconf automake pkgconfig
72+
```
73+
74+
Using Homebrew:
75+
```shell
76+
brew install libtool autoconf automake pkg-config
77+
```
1878

19-
### Debian / Ubuntu Linux
79+
#### Windows
80+
81+
* Using [MSYS2](https://www.msys2.org/) is the official way of compiling this project on Windows. Download the MSYS2 installer
82+
and follow the installation steps.
83+
84+
It is recommended to use the _MSYS2 MinGW 64-bit_ shell. Run it and make sure the required dependencies are installed:
85+
86+
```shell
87+
pacman -S base-devel \
88+
git \
89+
mingw-w64-x86_64-gcc \
90+
make \
91+
libtool \
92+
autoconf \
93+
automake-wrapper \
94+
pkg-config
95+
```
96+
NOTE: You can use a different shell and different compiler according to your needs. Adapt the above command accordingly.
97+
98+
### Configuring the source tree
99+
100+
You can build the source code from a git checkout, or from a `.tar.bz2` release tarball from [Releases](https://github.com/libimobiledevice/libirecovery/releases).
101+
Before we can build it, the source tree has to be configured for building. The steps depend on where you got the source from.
102+
103+
Since libirecovery depends on other packages, you should set the pkg-config environment variable `PKG_CONFIG_PATH`
104+
accordingly. Make sure to use a path with the same prefix as the dependencies. If they are installed in `/usr/local` you would do
20105

21-
First install all required dependencies and build tools:
22106
```shell
23-
sudo apt-get install \
24-
build-essential \
25-
pkg-config \
26-
checkinstall \
27-
git \
28-
autoconf \
29-
automake \
30-
libtool-bin \
31-
libimobiledevice-glue-dev \
32-
libreadline-dev \
33-
libusb-1.0-0-dev
107+
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
34108
```
35109

36-
Then clone the actual project repository:
110+
* **From git**
111+
112+
If you haven't done already, clone the actual project repository and change into the directory.
113+
```shell
114+
git clone https://github.com/libimobiledevice/libirecovery
115+
cd libirecovery
116+
```
117+
118+
Configure the source tree for building:
119+
```shell
120+
./autogen.sh
121+
```
122+
123+
* **From release tarball (.tar.bz2)**
124+
125+
When using an official [release tarball](https://github.com/libimobiledevice/libirecovery/releases) (`libirecovery-x.y.z.tar.bz2`)
126+
the procedure is slightly different.
127+
128+
Extract the tarball:
129+
```shell
130+
tar xjf libirecovery-x.y.z.tar.bz2
131+
cd libirecovery-x.y.z
132+
```
133+
134+
Configure the source tree for building:
135+
```shell
136+
./configure
137+
```
138+
139+
Both `./configure` and `./autogen.sh` (which generates and calls `configure`) accept a few options, for example `--prefix` to allow
140+
building for a different target folder. You can simply pass them like this:
141+
142+
```shell
143+
./autogen.sh --prefix=/usr/local
144+
```
145+
or
37146
```shell
38-
git clone https://github.com/libimobiledevice/libirecovery.git
39-
cd libirecovery
147+
./configure --prefix=/usr/local
40148
```
41149

42-
Now you can build and install it:
150+
Once the command is successful, the last few lines of output will look like this:
151+
```
152+
[...]
153+
config.status: creating config.h
154+
config.status: executing depfiles commands
155+
config.status: executing libtool commands
156+
157+
Configuration for libirecovery 1.2.0:
158+
-------------------------------------------
159+
160+
Install prefix: .........: /Users/nikias/coding/osx/libirecovery/libirecovery-1.2.0/_inst
161+
USB backend: ............: IOKit
162+
163+
Now type 'make' to build libirecovery 1.2.0,
164+
and then 'make install' for installation.
165+
```
166+
167+
### Building and installation
168+
169+
If you followed all the steps successfully, and `autogen.sh` or `configure` did not print any errors,
170+
you are ready to build the project. This is simply done with
171+
43172
```shell
44-
./autogen.sh
45173
make
174+
```
175+
176+
If no errors are emitted you are ready for installation. Depending on whether
177+
the current user has permissions to write to the destination directory or not,
178+
you would either run
179+
```shell
180+
make install
181+
```
182+
_OR_
183+
```shell
46184
sudo make install
47185
```
48186

187+
If you are on Linux, you want to run `sudo ldconfig` after installation to
188+
make sure the installed libraries are made available.
189+
49190
## Usage
50191

51192
First of all attach your device to your machine. Make sure your device is not
@@ -92,8 +233,6 @@ Please make sure your contribution adheres to:
92233
* Try to split larger changes into individual commits of a common domain
93234
* Use your real name and a valid email address for your commits
94235

95-
We are still working on the guidelines so bear with us!
96-
97236
## Links
98237

99238
* Homepage: https://libimobiledevice.org/
@@ -116,4 +255,4 @@ iPadOS, tvOS, watchOS, and macOS are trademarks of Apple Inc.
116255
This project is an independent software library and has not been authorized,
117256
sponsored, or otherwise approved by Apple Inc.
118257

119-
README Updated on: 2023-04-22
258+
README Updated on: 2024-03-23

0 commit comments

Comments
 (0)