Skip to content

Commit f4cfaab

Browse files
committed
docs: add explanation about swiftpm2nix
1 parent 1a3e05c commit f4cfaab

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ This flake provides `protoc-gen-swift` and `protoc-gen-grpc-swift` packages for
2929

3030
## Develop
3131

32+
### build
33+
3234
`nix build .` builds `protoc-gen-swift` by default. Run `nix build .#protoc-gen-swift` and `nix build .#protoc-gen-grpc-swift` to build each package.
3335

3436
Derivations under `protoc-gen-swift/` and `protoc-gen-grpc-swift/` can be built by `nix-build` command. They have default grpc-swift source, but they are supposed to be used for debug purpose.
@@ -38,3 +40,18 @@ cd protoc-gen-swift
3840
nix-build .
3941
```
4042

43+
### swiftpm2nix
44+
45+
Files under grpc-swift-src/swiftpm2nix are generated by the following steps.
46+
47+
```sh
48+
git clone [email protected]:grpc/grpc-swift.git -b 1.23.0 grpc-swift-src
49+
cd grpc-swift-src
50+
nix-shell -p swift swiftpm swiftpm2nix
51+
swift package resolve
52+
swiftpm2nix
53+
# Move files under grpc-swift-src/nix to grpc-swift/swiftpm2nix.
54+
```
55+
56+
NOTE:
57+
These steps are taken from https://git.ri.se/lars.rasmusson/nixpkgs/-/blob/master/doc/languages-frameworks/swift.section.md.

0 commit comments

Comments
 (0)