Skip to content

Commit 5c40d4a

Browse files
authored
Tweak README instructions and add initial VSCode utils (#52)
* Tweak README instructions and add initial VSCode utils. * Delete VSCode config files from git.
1 parent 24c6fb4 commit 5c40d4a

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ ci/LDKSwift/Sources/*
2525
xcode/build
2626
xcuserdata/
2727
/bindings/artifacts
28+
29+
# VSCode
30+
.vscode/*

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ The `*.xcframework` files are either available on
1010
the [Releases](https://github.com/lightningdevkit/ldk-swift/releases) page, or can be [compiled](#Compilation)
1111
from scratch.
1212

13-
1413
## Compilation
1514

1615
### Prerequisites
1716

18-
- A Mac with Xcode 13.2.1 or lower (this is because there is a bug with `cc` that prevents it from compiling for Mac Catalyst targets with clang 13)
19-
- Python3
20-
- Rust
21-
- `gnu-sed` (optional; but will cut your compile times significantly!)
17+
- A machine running macOS
18+
- Xcode 13.2.1 or lower (this is because there is a bug with `cc` that prevents it from compiling for Mac Catalyst targets with clang 13)
19+
- [Python3](https://programwithus.com/learn/python/install-python3-mac)
20+
- [Rust](https://www.rust-lang.org/tools/install)
21+
- [GNU sed](https://formulae.brew.sh/formula/gnu-sed) (optional, but will cut your compile times significantly!)
2222

2323
For Rust specifically, there are a couple additional requirements that can be installed once the Rust toolchain
2424
is set up:
@@ -33,17 +33,20 @@ cargo install cbindgen
3333

3434
In order to generate these bindings from scratch, you will need to clone two dependency repositories:
3535

36-
**rust-lightning**, (a specific branch built for bindings compatibility)
36+
**[rust-lightning](https://github.com/lightningdevkit/rust-lightning)**, (a specific branch built for bindings compatibility):
37+
3738
```shell
3839
git clone --branch 2022-06-108-java-bindings https://github.com/TheBlueMatt/rust-lightning /path/to/rust-lightning
3940
```
4041

41-
**ldk-c-bindings**
42+
**[ldk-c-bindings](https://github.com/lightningdevkit/ldk-c-bindings)**:
43+
4244
```shell
4345
git clone --branch v0.0.108.2 https://github.com/lightningdevkit/ldk-c-bindings /path/to/ldk-c-bindings
4446
```
4547

4648
Take note of where you clone these directories, it's best you save the absolute path somewhere handy for the rest of the remaining steps.
49+
4750
### Generating Rust-to-C-bindings
4851

4952
Now, navigate to the `ldk-c-bindings` directory and run the `genbindings.sh` script:
@@ -85,6 +88,7 @@ git rev-parse HEAD
8588
```
8689

8790
Take that commit hash and replace the `xxx` instances with it.
91+
8892
</details>
8993

9094
#### Generating the Swift files
@@ -99,6 +103,7 @@ python3 ./
99103
Now, the contents of the `bindings/LDK` folder will have been completely regenerated.
100104

101105
### Preparing the correct Xcode version
106+
102107
To make sure the next two steps work correctly, you need to verify that you're using Xcode 13.2.1.
103108
If you have a later version, you can download the correct version from here: https://xcodereleases.com/
104109

@@ -116,6 +121,7 @@ sudo xcode-select -s /Applications/Xcode\ 13.2.1.app/Contents/Developer/
116121
```
117122

118123
### Building requisite binaries
124+
119125
Navigate (`cd`) to the `./src/scripts` folder, and run the following Python script:
120126

121127
```shell
@@ -130,7 +136,7 @@ Each of those folders will contain an `architectures` directory with subdirector
130136
or `x86_64`, as well as a `libldk.a` file, which is the `lipo` product of all the targeted
131137
architectures.
132138

133-
#### Generating the *.xcframework files
139+
#### Generating the \*.xcframework files
134140

135141
With all the binaries generated, still in the `./src/scripts` directory, you just need to run one
136142
last Python script to produce the framework:

0 commit comments

Comments
 (0)