Skip to content

Commit

Permalink
make+docs: pull in modules patch
Browse files Browse the repository at this point in the history
  • Loading branch information
djkazic committed Mar 31, 2023
1 parent 2f994ce commit bb5faf0
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 29 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GOIMPORTS_PKG := github.com/rinchsan/gosimports/cmd/gosimports
GO_BIN := ${GOPATH}/bin
BTCD_BIN := $(GO_BIN)/btcd
GOIMPORTS_BIN := $(GO_BIN)/gosimports
GOMOBILE_BIN := GO111MODULE=off $(GO_BIN)/gomobile
GOMOBILE_BIN := $(GO_BIN)/gomobile
GOACC_BIN := $(GO_BIN)/go-acc

MOBILE_BUILD_DIR :=${GOPATH}/src/$(MOBILE_PKG)/build
Expand Down Expand Up @@ -274,25 +274,25 @@ vendor:
@$(call print, "Re-creating vendor directory.")
rm -r vendor/; go mod vendor

apple: vendor mobile-rpc
apple: mobile-rpc
@$(call print, "Building iOS and macOS cxframework ($(IOS_BUILD)).")
mkdir -p $(IOS_BUILD_DIR)
$(GOMOBILE_BIN) bind -target=ios,iossimulator,macos -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" -ldflags "$(RELEASE_LDFLAGS)" -v -o $(IOS_BUILD) $(MOBILE_PKG)

ios: vendor mobile-rpc
ios: mobile-rpc
@$(call print, "Building iOS cxframework ($(IOS_BUILD)).")
mkdir -p $(IOS_BUILD_DIR)
$(GOMOBILE_BIN) bind -target=ios,iossimulator -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" -ldflags "$(RELEASE_LDFLAGS)" -v -o $(IOS_BUILD) $(MOBILE_PKG)

macos: vendor mobile-rpc
macos: mobile-rpc
@$(call print, "Building macOS cxframework ($(IOS_BUILD)).")
mkdir -p $(IOS_BUILD_DIR)
$(GOMOBILE_BIN) bind -target=macos -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" -ldflags "$(RELEASE_LDFLAGS)" -v -o $(IOS_BUILD) $(MOBILE_PKG)

android: vendor mobile-rpc
android: mobile-rpc
@$(call print, "Building Android library ($(ANDROID_BUILD)).")
mkdir -p $(ANDROID_BUILD_DIR)
$(GOMOBILE_BIN) bind -target=android -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" -ldflags "$(RELEASE_LDFLAGS)" -v -o $(ANDROID_BUILD) $(MOBILE_PKG)
$(GOMOBILE_BIN) bind -target=android -androidapi 21 -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" -ldflags "$(RELEASE_LDFLAGS)" -v -o $(ANDROID_BUILD) $(MOBILE_PKG)

mobile: ios android

Expand Down
3 changes: 0 additions & 3 deletions docs/release-notes/release-notes-0.16.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ https://github.com/lightningnetwork/lnd/pull/6963/)
* [A wire parsing bug has been fixed that would cause lnd to be unable _decode_
certain large transactions](https://github.com/lightningnetwork/lnd/pull/7100).

* [ldflags were being incorrectly passed](
https://github.com/lightningnetwork/lnd/pull/7359)

## Invoices

* Define a new [InvoiceDB](https://github.com/lightningnetwork/lnd/pull/7215)
Expand Down
4 changes: 4 additions & 0 deletions docs/release-notes/release-notes-0.16.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
`exclude_exhausted_sessions` boolean flag to the relevant lncli wtclient
commands.

## Build
* [ldflags were being incorrectly passed](
https://github.com/lightningnetwork/lnd/pull/7359)

## Misc

* [Return `FEE_INSUFFICIENT` before checking balance for incoming low-fee
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ require (
go.etcd.io/etcd/client/v3 v3.5.7
golang.org/x/crypto v0.1.0
golang.org/x/exp v0.0.0-20221111094246-ab4555d3164f
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028
golang.org/x/net v0.4.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde
golang.org/x/term v0.3.0
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
google.golang.org/grpc v1.41.0
Expand Down
4 changes: 3 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
Expand Down Expand Up @@ -721,8 +722,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc=
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down
30 changes: 12 additions & 18 deletions mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,8 @@ To build for Android, you need either

### Go and Go mobile

First, follow the instructions to [install Go](https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md#building-a-development-version-from-source).

Then, install [Go mobile](https://github.com/golang/go/wiki/Mobile) and
initialize it:

```shell
go install golang.org/x/mobile/cmd/gomobile@latest
go mod download golang.org/x/mobile
gomobile init
```
First, follow the instructions to [install
Go](https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md#building-a-development-version-from-source).

### Docker

Expand All @@ -42,14 +34,8 @@ Note that `gomobile` only supports building projects from `$GOPATH` at this
point. However, with the introduction of Go modules, the source code files are
no longer installed there by default.

To be able to do so, we must turn off module and using the now deprecated
`go get` command before turning modules back on again.

```shell
go env -w GO111MODULE="off"
go get github.com/lightningnetwork/lnd
go get golang.org/x/mobile/bind
go env -w GO111MODULE="on"
git clone https://github.com/lightningnetwork/lnd.git $GOPATH/src/github.com/lightningnetwork/lnd
```

Finally, let’s change directory to the newly created lnd folder inside `$GOPATH`:
Expand All @@ -58,13 +44,21 @@ Finally, let’s change directory to the newly created lnd folder inside `$GOPAT
cd $GOPATH/src/github.com/lightningnetwork/lnd
```

It is not recommended building from the master branch for mainnet. To checkout
It is not recommended building from the master branch for mainnet. To check out
the latest tagged release of lnd, run

```shell
git checkout $(git describe --match "v[0-9]*" --abbrev=0)
```

Then, install [Go mobile](https://github.com/golang/go/wiki/Mobile) and
initialize it:

```shell
go install golang.org/x/mobile/cmd/gomobile
gomobile init
```

### iOS

```shell
Expand Down
1 change: 1 addition & 0 deletions mobile/bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
flags "github.com/jessevdk/go-flags"
"github.com/lightningnetwork/lnd"
"github.com/lightningnetwork/lnd/signal"
_ "golang.org/x/mobile/bind"
"google.golang.org/grpc"
)

Expand Down

0 comments on commit bb5faf0

Please sign in to comment.