Skip to content

Commit b179d56

Browse files
committed
Merge commit '4bacb676dc6cd297c65c55bd50f806dac6ec75bf'
* commit '4bacb676dc6cd297c65c55bd50f806dac6ec75bf': windows: add instructions build on windows add signed CLA fix linux build
2 parents b447f1b + 4bacb67 commit b179d56

File tree

14 files changed

+200
-25
lines changed

14 files changed

+200
-25
lines changed

CLA-signed/CLA.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Contributor License Agreement
2+
3+
Version 1.0
4+
5+
Name: Gorazd Kovacic
6+
7+
8+
9+
Legal Jurisdiction: Wyoming, United States of America
10+
11+
Project: https://github.com/BlockchainCommons/bc-seedtool-cli
12+
13+
Date: 09-03-2020
14+
15+
## Purpose
16+
17+
This agreement gives Blockchain Commons, LLC the permission it needs in order to accept my contributions into its open software project and to manage the intellectual property in that project over time.
18+
19+
## License
20+
21+
I hereby license Blockchain Commons, LLC to:
22+
23+
1. do anything with my contributions that would otherwise infringe my copyright in them
24+
25+
2. do anything with my contributions that would otherwise infringe patents that I can or become able to license
26+
27+
3. sublicense these rights to others on any terms they like
28+
29+
## Reliability
30+
31+
I understand that Blockchain Commons will rely on this license. I may not revoke this license.
32+
33+
## Awareness
34+
35+
I promise that I am familiar with legal rules, like ["work made for hire" rules](http://worksmadeforhire.com), that can give employers and clients ownership of intellectual property in work that I do. I am also aware that legal agreements I might sign, like confidential information and invention assignment agreements, will usually give ownership of intellectual property in my work to employers, clients, and companies that I found. If someone else owns intellectual property in my work, I need their permission to license it.
36+
37+
## Copyright Guarantee
38+
39+
I promise not to offer contributions to the project that contain copyrighted work that I do not have legally binding permission to contribute under these terms. When I offer a contribution with permission, I promise to document in the contribution who owns copyright in what work, and how they gave permission to contribute it. If I later become aware that one of my contributions may have copyrighted work of others that I did not have permission to contribute, I will notify Blockchain Commons, in confidence, immediately.
40+
41+
## Patent Guarantee
42+
43+
I promise not to offer contributions to the project that I know infringe patents of others that I do not have permission to contribute under these terms.
44+
45+
## Open Source Guarantee
46+
47+
I promise not to offer contributions that contain or depend on the work of others, unless that work is available under a license that [Blue Oak Council rates bronze or better](https://blueoakconcil.org/list), such as the MIT License, two- or three-clause BSD License, the Apache License Version 2.0, or the Blue Oak Model License 1.0.0. When I offer a contribution containing or depending on others' work, I promise to document in the contribution who licenses that work, along with copies of their license terms.
48+
49+
## Disclaimers
50+
51+
***As far as the law allows, my contributions come as is, without any warranty or condition. Other than under [Copyright Guarantee](#copyright-guarantee), [Patent Guarantee](#patent-guarantee), or [Open Source Guarantee](#open-source-guarantee), I will not be liable to anyone for any damages related to my contributions or this contributor license agreement, under any kind of legal claim.***
52+
53+
---
54+
55+
To sign this Contributor License Agreement, fill in `$name`, `$email`, and `$date` above. Then sign using GPG using the following command `gpg --armor --clearsign --output CLA.YOURGITHUBNAME.YOURGPGFINGERPRINT.asc CLA.md`, then either submit your signed Contributor License Agreement to this repo as a GPG signed Pull Request or email it to [[email protected]](mailto:[email protected]).
56+

Makefile.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
# Licensed under the "BSD-2-Clause Plus Patent License"
88
#
99

10+
UNAME := $(shell uname)
11+
ifeq ($(UNAME), Linux)
12+
SHELL := /bin/bash
13+
else ifeq ($(findstring MINGW64, $(UNAME)), MINGW64)
14+
# on windows building with msys2/mingw64
15+
SHELL := /bin/bash
16+
endif
17+
1018
# Package-specific substitution variables
1119
package = @PACKAGE_NAME@
1220
version = @PACKAGE_VERSION@

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,39 @@ See [`MANUAL.md`](MANUAL.md) for details, many more examples, and version histor
135135

136136
These dependencies are automatically installed as submodules when you run the build script. This is the recommended way to install.
137137

138+
### MacOS
139+
138140
```bash
139141
$ ./build.sh
140142
$ sudo make install
141143
```
142144

145+
### Linux
146+
147+
Make sure you have llvm/clang, libc++ and libc++abi installed. All of them with
148+
a minimum recommended version 10.
149+
150+
#### Ubuntu and Debian
151+
152+
```bash
153+
$ sudo apt-get install make
154+
155+
$ wget https://apt.llvm.org/llvm.sh
156+
$ chmod +x llvm.sh
157+
$ sudo ./llvm.sh 10 # version 10
158+
159+
$ sudo apt-get install libc++-10-dev libc++abi-10-dev
160+
```
161+
162+
```bash
163+
$ export CC="clang-10" && export CXX="clang++-10" && ./build.sh
164+
$ sudo make install
165+
```
166+
167+
### Windows
168+
169+
See [instructions here](Windows.md).
170+
143171
## Alternative Installation
144172

145173
This sequence does *not* install the dependencies from submodules; instead they must be installed in the usual places on the build system, otherwise the `./configure` step below will fail.
@@ -149,6 +177,7 @@ $ ./configure
149177
$ make
150178
$ sudo make install
151179
```
180+
*Note:* On Linux the first step is `./configure CC=clang-10 CXX=clang++-10`
152181

153182
## Incremental Builds
154183

Windows.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
## Seedtool on Windows
2+
3+
### Abstract
4+
5+
This document describes building `seedtool` with `MSYS2` and its usage on `Windows 10` 64-bit.
6+
7+
### Installing MSYS2 and Packages
8+
9+
* First, install `MSYS2` by downloading the installer and following the installation guide in [www.msys2.org](www.msys2.org).
10+
11+
* Run `MSYS2` and make sure the package database is updated:
12+
13+
```bash
14+
# pacman -Syu
15+
# pacman -Su
16+
```
17+
18+
* Next, install the compiler and the required packages:
19+
20+
```bash
21+
# pacman -S mingw-w64-x86_64-clang
22+
# pacman -S patch
23+
# pacman -S git
24+
# pacman -S make
25+
# pacman -S mingw-w64-x86_64-libc++
26+
# pacman -S autoconf
27+
# pacman -S automake1.8
28+
```
29+
30+
### Compiling
31+
32+
First, clone `bc-seedtool-cli`, e.g. into `C:\msys64\home`, open `MSYS2 MinGW 64-bit` application and `cd` into `C:\msys64\home\bc-seedtool-cli`
33+
34+
* Now, run the build script with:
35+
36+
```bash
37+
# export CC="clang" && export CXX="clang++" && ./build.sh
38+
```
39+
40+
* and install:
41+
42+
```bash
43+
# make install
44+
```
45+
46+
You can now freely use `seedtool` inside `MSYS2 MinGW 64-bit` console.
47+
48+
49+
### Running Seedtool as a Native Windows App
50+
51+
To be able to use `seedtool` as a native app on Windows outside `msys2/mingw64`, you have to expose 3 files to the system: `seedtool.exe`, `libc++.dll` and `libunwind.dll` which all reside in `C:\msys64\mingw64\bin`. So go ahead and add that folder to the `Windows PATH` by the following command in `Windows Cmd`:
52+
53+
```bash
54+
set PATH=%PATH%;C:\msys64\mingw64\bin
55+
```
56+
57+
That's it. Now you can use `seedtool` as a native Windows app in the Windows command line tool.
58+
59+
60+
*Note:* If you want to pipe seedtool ouput into a QR code generator, you could use:
61+
62+
```bash
63+
seedtool --ur | python -c "import sys; print(sys.stdin.readlines()[0].upper())" | qr > seedqrcode.png
64+
```
65+
66+
For this you'll need `Python` and the following package:
67+
68+
```bash
69+
pip install qrcode[pil]
70+
```
71+

configure

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3617,13 +3617,13 @@ else
36173617

36183618
fi
36193619

3620-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for slip39_word_for_string in -lbc-slip39" >&5
3621-
$as_echo_n "checking for slip39_word_for_string in -lbc-slip39... " >&6; }
3622-
if ${ac_cv_lib_bc_slip39_slip39_word_for_string+:} false; then :
3620+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sskr_generate in -lbc-sskr" >&5
3621+
$as_echo_n "checking for sskr_generate in -lbc-sskr... " >&6; }
3622+
if ${ac_cv_lib_bc_sskr_sskr_generate+:} false; then :
36233623
$as_echo_n "(cached) " >&6
36243624
else
36253625
ac_check_lib_save_LIBS=$LIBS
3626-
LIBS="-lbc-slip39 $LIBS"
3626+
LIBS="-lbc-sskr $LIBS"
36273627
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36283628
/* end confdefs.h. */
36293629
@@ -3633,36 +3633,36 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36333633
#ifdef __cplusplus
36343634
extern "C"
36353635
#endif
3636-
char slip39_word_for_string ();
3636+
char sskr_generate ();
36373637
int
36383638
main ()
36393639
{
3640-
return slip39_word_for_string ();
3640+
return sskr_generate ();
36413641
;
36423642
return 0;
36433643
}
36443644
_ACEOF
36453645
if ac_fn_c_try_link "$LINENO"; then :
3646-
ac_cv_lib_bc_slip39_slip39_word_for_string=yes
3646+
ac_cv_lib_bc_sskr_sskr_generate=yes
36473647
else
3648-
ac_cv_lib_bc_slip39_slip39_word_for_string=no
3648+
ac_cv_lib_bc_sskr_sskr_generate=no
36493649
fi
36503650
rm -f core conftest.err conftest.$ac_objext \
36513651
conftest$ac_exeext conftest.$ac_ext
36523652
LIBS=$ac_check_lib_save_LIBS
36533653
fi
3654-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bc_slip39_slip39_word_for_string" >&5
3655-
$as_echo "$ac_cv_lib_bc_slip39_slip39_word_for_string" >&6; }
3656-
if test "x$ac_cv_lib_bc_slip39_slip39_word_for_string" = xyes; then :
3654+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bc_sskr_sskr_generate" >&5
3655+
$as_echo "$ac_cv_lib_bc_sskr_sskr_generate" >&6; }
3656+
if test "x$ac_cv_lib_bc_sskr_sskr_generate" = xyes; then :
36573657
cat >>confdefs.h <<_ACEOF
3658-
#define HAVE_LIBBC_SLIP39 1
3658+
#define HAVE_LIBBC_SSKR 1
36593659
_ACEOF
36603660

3661-
LIBS="-lbc-slip39 $LIBS"
3661+
LIBS="-lbc-sskr $LIBS"
36623662

36633663
else
36643664

3665-
echo "### Error! libbc-slip39 must be installed first."
3665+
echo "### Error! libbc-sskr must be installed first."
36663666
exit -1
36673667

36683668
fi

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ AC_CHECK_LIB([bc-shamir], [split_secret], [], [
2121
echo "### Error! libbc-shamir must be installed first."
2222
exit -1
2323
])
24-
AC_CHECK_LIB([bc-slip39], [slip39_word_for_string], [], [
25-
echo "### Error! libbc-slip39 must be installed first."
24+
AC_CHECK_LIB([bc-sskr], [sskr_generate], [], [
25+
echo "### Error! libbc-sskr must be installed first."
2626
exit -1
2727
])
2828
AC_CHECK_LIB([bc-bip39], [bip39_mnemonic_from_word], [], [

0 commit comments

Comments
 (0)