Skip to content

Commit

Permalink
Merge pull request #3 from xanimo/go-wrappers
Browse files Browse the repository at this point in the history
bindings: add golang build.sh script
  • Loading branch information
jaxlotl authored May 28, 2022
2 parents 1f9b644 + b970c92 commit 59648e4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ jobs:
make check -j"$(getconf _NPROCESSORS_ONLN)" V=1
python3 tooltests.py
./bindings/python/pytest/cython_tests.sh
./bindings/golang/libdogecoin/build.sh
;;
"i686-linux")
make check -j"$(getconf _NPROCESSORS_ONLN)" V=1
Expand Down
27 changes: 27 additions & 0 deletions bindings/golang/libdogecoin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -e

pushd `pwd`/bindings/golang/libdogecoin

if ! command -v go &> /dev/null
then
wget https://go.dev/dl/go1.18.2.linux-amd64.tar.gz
echo "e54bec97a1a5d230fc2f9ad0880fcbabb5888f30ed9666eca4a91c5a32e86cbc go1.18.2.linux-amd64.tar.gz" | sha256sum -c
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.2.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
if ! command -v go &> /dev/null
then
echo "go could not be found"
exit
fi
fi

go build -x -work -ldflags '-linkmode external -extldflags "-static"' .

go test -v

go clean -x -i -testcache

popd
4 changes: 2 additions & 2 deletions bindings/golang/libdogecoin/libdogecoin.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package libdogecoin

/*
#cgo CFLAGS: -I${SRCDIR}/../../.. -I${SRCDIR}/../../../include -I${SRCDIR}/../../../include/dogecoin -I${SRCDIR}/../../../include/dogecoin/crypto -I${SRCDIR}/../../../include/dogecoin/net -I${SRCDIR}/../../../src/secp256k1/include -I${SRCDIR}/../../../src/secp256k1/src
#cgo LDFLAGS: -L${SRCDIR}/../../../.libs -L${SRCDIR}/../../../src/secp256k1/.libs -ldogecoin -lsecp256k1 -lsecp256k1_precomputed -lm -Wl,-rpath=./.libs
#cgo CFLAGS: -I${SRCDIR}/../../.. -I${SRCDIR}/../../../include -I${SRCDIR}/../../../include/dogecoin -I${SRCDIR}/../../../include/dogecoin/crypto -I${SRCDIR}/../../../include/dogecoin/net -I${SRCDIR}/../../../src/secp256k1/include -I${SRCDIR}/../../../src/secp256k1/src -I${SRCDIR}/../../../depends/x86_64-pc-linux-gnu/include -fPIC
#cgo LDFLAGS: -L${SRCDIR}/../../../.libs -L${SRCDIR}/../../../src/secp256k1/.libs -L${SRCDIR}/../../../depends/x86_64-pc-linux-gnu/lib -ldogecoin -levent_core -levent -lpthread -lsecp256k1 -lsecp256k1_precomputed -lm -Wl,-rpath=${SRCDIR}/../../../.libs
#include "address.h"
#include "transaction.h"
#include "ecc.h"
Expand Down

0 comments on commit 59648e4

Please sign in to comment.