Commit Graph

160 Commits

Author SHA1 Message Date
Jason Rhinelander 5da3d2f7ef Drone: add static builds for mac/linux/windows
Adds static drone builds for linux (built on bionic), mac, and Windows
(built with mingw32).

The builds get uploaded to https://builds.lokinet.dev

The linux and mac builds use LTO (which takes longer, but significantly
reduces binary size).  The mingw32 build can probably also get there,
but currently fails with LTO when unbound tries linking against openssl
(it probably just needs a small patch to add magic -lwsock2 dep in the
right place in unbound).

The Mac binaries are built using a 10.13 deployment target.  (I'm not
100% sure that this is sufficient -- it's possible we might have to also
push the magic mac deployment flag to the built dependencies).
2020-06-15 12:49:34 -03:00
Jason Rhinelander 70b9fed4fd Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:

    cmake .. -DBUILD_STATIC_DEPS=ON

which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.).  It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.

Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance.  It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.

This works on Linux, Mac, and Windows.

Some random comments on this commit (for preserving history):

- Don't use target_link_libraries on imported targets.  Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.

- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium.  Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.

- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to.  Thanks Google.

- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-15 12:49:33 -03:00
Jason Rhinelander ac29b79cd9 Do not try to feature test static_assert
static_assert is required both by C++11 and C11; if we don't have a
standard compliant compiler then compilation should fail, not be hacked
like this.

The C++ version of this definition is particularly preposterous; the C
version is probably just covering up that the C code forget to include
the `<assert.h>` header where the `static_assert` macro is defined.
2020-06-14 22:18:22 -03:00
Doyle 1391f35ef0 Merge commit 'dc64fcb8a6c046c6e30665a6217b8fb6ec2471bc' into MergeUpstream3 2020-05-22 11:25:15 +10:00
Doyle 7264cae56b Merge commit '0ca1a51033a9767d4fb039c5289ad366610be98e' into MergeUpstream3 2020-05-18 15:11:46 +10:00
Jason Rhinelander db5c053057 Move version into top-level CMakeLists.txt
CMake already provides variables to handle the version major/minor/patch
if we give it the dotted version in the `project()` command.  Using it
significantly reduces the amount of macro stuff we have to do in
version.cpp.in, and it seems a little nicer to have it defined in the
project top level rather than buried in a needs-to-beprocessed .cpp
file.

This moves the release codename there, too, so that it stays being
defined in essentially the same place as the version.

This change here requires some minor tweaking of the version generation
code to do it in two steps (when we have git): the first
(`src/version.cpp.in` -> `build/version.cpp.in`) replaces all the main
version variables during cmake configuration, the second
(`build/version.cpp.in` -> `build/version.cpp`) then replaces the
VERSIONTAG at build time.  (Before this commit, there was only version
tag replacement that only happened at build time).

Also bumps up the version here (since I'm moving it anyway) to match
master's 7.1.8.
2020-05-03 22:19:51 -03:00
Jason Rhinelander 3dddd07b9c Remove impossible version export cruft
In Monero 12.0 the version code got rewritten and, as a result, the
variable substitution export attribute no longer applies (since
`version.cmake` got moved and renamed to `Version.cmake`), but this bit
of cruft to rewrite the release tag to "-release" and the attribute are
still there, but cannot ever be invoked.

Remove them.  I specifically don't want to fix it because source exports
can come from anywhere, *not* only tagged versions, so putting
"-release" in the version string could be highly misleading.
2020-05-03 15:59:24 -03:00
Jason Rhinelander 743d4e60ce Various linking and build fixes
- updating to latest loki-mq (1.0.0 + various linking fixes)
- BUILD_SHARED_LIBS was being handled very strangely; make it a full
option instead (defaulting to off) that a cmake invoker can specify, as
per cmake recommendations.
- travis ci tweaks/changes:
  - Add a static bionic build
  - Simplify cmake argument code
  - Add `--version` invocation for lokid and loki-wallet-cli to test
    that the binaries were linked properly.
- always build an embedded sodium statically; if we do it dynamically
and an older system one exists we are going to have trouble.
- don't force epee and blocks to be static; rather they get controlled
by the above BUILD_SHARED_LIBS, just like all the other internal
libraries.
- use some PkgConfig:: imported targets rather than bunch-of-variables.
2020-03-15 14:29:47 -03:00
Doyle 86d77912ae Ability to vendor libsodium 1.0.18 -D DOWNLOAD_SODIUM=[ON|OFF|FORCE]
DownloadLibsodium taken from loki-network and mostly adapted from
libzmq's cmake file in lokimq.
2020-03-06 17:26:02 +11:00
Jason Rhinelander 04f614705e Use pkg-config for unbound and miniupnpc
We unnecessarily vendor this much of the time because the existing
search code is primitive; use pkg-config instead which works much
better, and lets us properly depend on particular versions.

This lets us reenable the system miniupnpc for >=2.1, saving an
unnecessary compilation most of the time.  From the git history it
appears that it is built from source always unconditionally in a fit of
rage.
2019-12-03 00:51:18 -04:00
Jesus Ramirez f9b3f6ef3b Removed Berkeley DB and db switching logic 2019-09-16 16:18:05 +02:00
moneromooo-monero 33e91e1a1e
wallet, rpc: add a release field to get_version
It does not leak much since you can make a fair guess by RPC
version already, and some people want to avoid non release
clients when using third parties' nodes (because they'd never
lie about it)
2019-08-26 19:28:25 +00:00
xiphon 45c28d8a0e build: fix OSX static libusb check and link against static libobjc 2019-07-09 22:13:59 +00:00
Doyle 639d7456f7 Merge commit '1d5e8f4' into LokiMergeUpstream 2019-06-26 13:04:37 +10:00
Howard Chu 1dc4ebfd6c
Use 9 digit build IDs 2019-06-12 16:47:33 +01:00
Doyle 27dc2f88fa Merge commit 'c0bc6d9' into LokiMergeUpstream 2019-05-17 03:54:20 +10:00
Doyle 170e841a12
Merge pull request #590 from Doy-lee/LokiMergeUpstream
Loki Merge Upstream 2019-05-07 2bf855e
2019-05-16 13:15:49 -04:00
Doyle 277586417a Merge commit '96696d1' into LokiMergeUpstream 2019-05-02 11:13:33 +10:00
Jason Rhinelander 6d44629bd5 Add missing depends to version.cpp generator (#583)
When git is installed and you aren't building a release tag, the command
that generates build/version.cpp never gets reinvoked if the generated
version.cpp already exists, so if you build, pull a new update, then
rebuild you get the wrong version everywhere.

(This still isn't perfect--if you change commits within the same version
you end up with the wrong commit tag in the version--but at least the
version itself will be right.)
2019-05-02 11:13:03 +10:00
moneromooo-monero 7d5cc0358b
cmake: fix some case of "backtrace lib not found" breaking
It fixes at least one case of building on ARM with Docker
2019-05-01 10:11:41 +00:00
Doyle 5374632e2f Merge commit '1f809e7' into LokiMergeUpstream 2019-05-01 17:06:47 +10:00
Riccardo Spagni 613588e1a8
Merge pull request #5410
d4a78c74 build: libusb static compilation fix (Dusan Klinec)
2019-04-16 22:35:16 +02:00
Doyle 550e56ac1e Merge commit 'c88e9921043d7c40f023d24c3a3f39f2e96f8738' into LokiMergeUpstream 2019-04-12 14:17:05 +10:00
Martijn Otto 8df827075f
Fix linker issues using easylogging 2019-04-10 11:37:02 +02:00
Dusan Klinec d4a78c74ac
build: libusb static compilation fix 2019-04-07 18:52:25 +02:00
Riccardo Spagni 4c91eb23a0
Merge pull request #5061
1f2930ce Update 2019 copyright (binaryFate)
2019-03-17 17:49:30 +02:00
binaryFate 1f2930ce0b Update 2019 copyright 2019-03-05 22:05:34 +01:00
Dusan Klinec 5ea17909ca
device/trezor: debugging features, trezor tests 2019-03-05 14:02:45 +01:00
doy-lee 9eefb869f8 Merge commit '69e8567' into LokiMergeUpstream 2019-01-17 15:57:30 +11:00
doy-lee f5b17fc86e Merge commit '6bc0c7e' into LokiMergeUpstream 2018-12-19 12:25:48 +11:00
Dusan Klinec e37154a879
build: protobuf dependency fixes, libusb build
- docker protobuf dependencies, cross-compilation
- device/trezor protobuf build fixes, try_compile
- libusb built under all platforms, used by trezor for direct connect
2018-12-18 16:50:19 +01:00
doy-lee a07c5d9cba Merge commit '58ce16d' into LokiMergeUpstream 2018-12-10 14:54:27 +11:00
Dusan Klinec d71f89e2a2
device/trezor: device/trezor: correct device initialization, status check
- checks if the device is in the correct usable state
- implements check for the v2.0.9 firmware which does not support payment IDs
- simple transacttion check, payment id fmt consistency
- minor fixes, refactoring, webusb session counting fix
2018-12-04 20:12:03 +01:00
Dusan Klinec 2ffe53d9e6
device/trezor: webusb transport added, cmake fixes
- webusb transport based on libusb added. Provides direct access to Trezor via USB, no need for Trezor bridge.
- trezor protocol message handler improved, no recursion used. Ready for upcoming integration tests.
- libusb (for docker) bumped from v1.0.9 to v1.0.22, newer version required for webusb transport, for device enumeration.
- cmake improvements and fixes. Cmake Trezor checks are moved to a dedicated CheckTrezor.cmake file. In case of a problem Trezor is excluded from build.
- ifdefs made consistent to Ledger.
- UDP Transport enumeration disabled by default in release mode
2018-11-25 11:57:19 +01:00
doy-lee 8f03bb3fd7 Merge commit '8534f71' into LokiMergeUpstream 2018-11-12 14:55:42 +11:00
moneromooo-monero dff0adfee5
cmake: fix readline detection when the readline library is not found 2018-10-26 11:47:15 +00:00
doy-lee 339f96b0cc Merge commit 'c23b6f8' into LokiMergeUpstreamUntil_20181010_77e1ebf 2018-10-10 15:07:16 +11:00
doy-lee cf32598ec5 Merge commit 'cd8c7f6' into LokiMergeUpstreamUntil_20181010_77e1ebf 2018-10-10 14:38:40 +11:00
doy-lee d3501cfc73 Merge commit '4a1744e' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-10 13:28:43 +11:00
doy-lee 2d3adf003b Merge commit '7addabc' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-10 10:30:31 +11:00
iDunk5400 cbdd6b910b
Linux: Fix building of static binaries with hw device support
This should enable building static binaries on Linux systems where dependencies are already built with -fPIC, such as Ubuntu 18.04.
2018-10-06 16:48:14 +02:00
Riccardo Spagni 8e07e26555
Merge pull request #4425
a69271fa Fixed a typo (Piotr Kąkol)
2018-09-29 22:19:47 +02:00
cslashm bb6e3bbc0f Replace USB-CCID (smartcard) by USB-HID
Remove PCSC dependencies which is a bit hard (not user friendly) to install on linux and Mac

Split Ledger logic and device IO
2018-09-24 21:57:42 +02:00
doy-lee b64d7048a3 Merge commit '94ed562' into LokiMergeUpstream20180821 2018-09-19 14:15:55 +10:00
Riccardo Spagni 9c40bc62fc
Merge pull request #3430
42397359 Fixup 32bit arm build (TheCharlatan)
a06d2581 Fix Windows build (TheCharlatan)
ecaf5b3f Add libsodium to the packages, the arm build was complaining about it. (TheCharlatan)
cbbf4d24 Adapt translations to upstream changes (TheCharlatan)
db571546 Updated pcsc url (TheCharlatan)
f0ba19fd Add lrelease to the depends (TheCharlatan)
cfb30462 Add Miniupnp submodule (TheCharlatan)
5f7da005 Unbound is now a submodule. Adapt depends for this. (TheCharlatan)
d6b9bdd3 Update readmes to reflect the usage of depends (TheCharlatan)
56b6e41e Add support for apple and arm building (TheCharlatan)
29311fd1 Disable stack unwinding for mingw32 depends build. (TheCharlatan)
8db3d573 Modify depends for monero's dependencies (TheCharlatan)
0806a23a Initial depends addition (TheCharlatan)
2018-09-18 16:33:21 +02:00
TheCharlatan cfb3046222 Add Miniupnp submodule
Drop miniupnp and unbound depends builds. Make sure that build variables are propageted properly to unbound and miniupnp.
Rebase to after the v0.12 release
2018-09-10 22:05:37 +02:00
iDunk5400 6929b52426
Windows: don't preset CMAKE_SYSTEM_NAME
Let it be autodiscovered instead to avoid cmake thinking it's crosscompiling builds where host = target. This resolves a cmake configure error in MSYS2 caused by CMAKE_CROSSCOMPILING checks in #4294.
2018-09-06 12:56:21 +02:00
Doyle T 54d91548de Merge branch 'dev' into LokiMergeUpstream 2018-09-05 12:07:29 +10:00
Doyle T 06c80f48a5 Fix readline for linux by adding ncurses and finding libtinfo first 2018-08-22 11:12:38 +10:00
Doyle T fd381013aa Merge commit '9a3bd88' into LokiMergeUpstream 2018-08-21 13:17:22 +10:00
Doyle T 8c936836d2 Merge commit 'b3363e8' into LokiMergeUpstream 2018-08-17 14:49:12 +10:00
jcktm 4f5159c90a Revert "Fix readline not found on windows and linux"
This reverts commit 153b925f6b.
2018-08-15 14:46:13 +10:00
sachaaaaa 153b925f6b Fix readline not found on windows and linux 2018-08-15 13:56:23 +10:00
sachaaaaa dc7323ff34 Fix designated initializers + add CD/CI badge (#100)
* add gitlab config file for CD/CI

* formatting

* Update readme to display CI badge

* Replace designated initializers with aggregate initializers

* CD/CI for mac

* use git fetch for cli instead of clone

* CD/CI for windows
2018-07-20 15:16:12 +10:00
einsteinsfool 7cdd147da5 Changed URLs to HTTPS 2018-06-23 21:15:29 +02:00
luigi1111 61f3916b4a
Merge pull request #3844
bdf5a3a Fix PCSC compilation under windows (cslashm)
f17383a Fix CMAKE config for PCSC in order to avoid msys DLL dependencies (cslashm)
2018-06-19 12:49:30 -05:00
luigi1111 53b5d03b82
Merge pull request #3708
a7ce392 Updating the FindReadline CMake hint to search in homebrew's default directory (gene-telligent)
2018-06-16 13:57:54 -05:00
jcktm f0740b9a5e Merge remote-tracking branch 'monero/master' into dev 2018-06-08 16:40:07 +10:00
cslashm f17383afc2 Fix CMAKE config for PCSC in order to avoid msys DLL dependencies
merge of PR #3886
2018-05-31 15:30:16 +02:00
cslashm bdf5a3ad3f Fix PCSC compilation under windows
PR3843 based on release-v0.12 => rebased on master
2018-05-23 10:22:55 +02:00
moneromooo-monero a5c98609a1
version.cmake: fix configuring version.cpp without git 2018-05-15 18:40:16 +01:00
Gene Peters a7ce392eef Updating the FindReadline CMake hint to search in homebrew's default directory 2018-05-07 14:44:38 -07:00
Doyle T 808c07768c Update cmakelists and misc refs to Loki 2018-04-25 16:13:38 +10:00
Howard Chu 522be96fe4
Fix generating version.cpp
Also removes BYPRODUCT dependency on CMake 3.2
2018-03-21 16:33:52 +00:00
cslashm e745c1e38d Code modifications to integrate Ledger HW device into monero-wallet-cli.
The basic approach it to delegate all sensitive data (master key, secret
ephemeral key, key derivation, ....) and related operations to the device.
As device has low memory, it does not keep itself the values
(except for view/spend keys) but once computed there are encrypted (with AES
are equivalent) and return back to monero-wallet-cli. When they need to be
manipulated by the device, they are decrypted on receive.

Moreover, using the client for storing the value in encrypted form limits
the modification in the client code. Those values are transfered from one
C-structure to another one as previously.

The code modification has been done with the wishes to be open to any
other hardware wallet. To achieve that a C++ class hw::Device has been
introduced. Two initial implementations are provided: the "default", which
remaps all calls to initial Monero code, and  the "Ledger", which delegates
all calls to Ledger device.
2018-03-04 12:54:53 +01:00
xmr-eric 18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00
Jethro Grassie be1826c0fb
Keep readline optional 2018-01-11 13:51:13 -05:00
Riccardo Spagni d08aee7a7e
Merge pull request #2993
776b44f1 Add misc hardening flags to the cmake machinery (moneromooo-monero)
2018-01-10 11:53:26 +01:00
Jethro Grassie 0e93b0986c
Add checks for termcap if needed by readline 2018-01-02 13:26:22 -05:00
moneromooo-monero 776b44f17b
Add misc hardening flags to the cmake machinery
See https://wiki.debian.org/Hardening#User_Space
2017-12-31 14:26:12 +00:00
ston1th 25f4ab81ce fixed linking against libreadline on OpenBSD
To fix the linking error described here https://github.com/monero-project/monero/pull/2841#issuecomment-346129030 we also need to link libcurses.
2017-11-28 19:03:07 +01:00
moneromooo-monero 36f0538a0a
cmake: fix building when readline is not found 2017-11-19 09:27:26 +00:00
redfish 11e0deef31 cmake: add dep of version lib on version.cpp
Also, move cmake source files into cmake/ to keep them together.
2017-10-20 22:07:34 -04:00
Orestis Konstantinidis d0bbc5912a Only check for upnp version if version is determined 2017-09-04 15:56:14 +03:00
moneromooo-monero 49ffb156f0
cmake: do not use GREATER_EQUAL, it's too new 2017-08-07 21:37:13 +01:00
Erik de Castro Lopo 04bd19257d cmake: Update detection of external miniupnpc
The version of miniupnpc in external/ uses API version 16, but the
code also seems to work for API version 10. Also remove detection
of older unsupported versions.
2017-07-30 16:28:30 +10:00
jethro e1f3dfccc8 Add readline support to cli
This PR adds readline support to the daemon and monero-wallet-cli. Only
GNU readline is supported (e.g. not libedit) and there are cmake checks
to ensure this.

There is a cmake variable, Readline_ROOT_DIR that can specify a
directory to find readline, otherwise some default paths are searched.

There is also a cmake option, USE_READLINE, that defaults to ON. If set
to ON, if readline is not found, the build continues but without
readline support.

One negative side effect of using readline is that the color prompt in
the wallet-cli now has no color and just uses terminal default. I know
how to fix this but it's quite a big change so will tackle another time.
2017-06-18 10:08:37 -04:00
Riccardo Spagni c3599fa7b9
update copyright year, fix occasional lack of newline at line end 2017-02-21 19:38:18 +02:00
Riccardo Spagni 2a996f492f
Merge pull request #1510
80abc3bc Build wallet with Android NDK (MoroccanMalinois)
2017-01-08 16:40:02 -08:00
MoroccanMalinois 80abc3bc4a Build wallet with Android NDK 2017-01-05 01:11:05 +00:00
moneromooo-monero 0020ad7d99
cmake: link against liblzma when found, for libunwind
Some versions of libunwind need liblzma. If liblzma is found,
we link against it unconditionally. If the installed libunwind
didn't need it, this is a nop.

Tested and fine tuned by iDunk
2016-12-24 00:00:45 +00:00
redfish 1de812a92a cmake: merge libs via virtual object libraries
CMake issued a warming about policy CMP0026: access of LOCATION
target property at config time was disallowed. Offending code
was the code that merged static libraries to generate
libwallet_merged.a.

This patch does that same merge task in a much simpler way. And,
since it doesn't violate the policy, the warning went away.
2016-08-30 23:01:48 -04:00
redfish a7498adc03 cmake: comply with the new policy CMP0026
Access to LOCATION property at config time was disallowed by this
policy. This patch updates the offending code to comply with the policy
and thereby gets rid of the warning printed by cmake.

The fix is to use generator expressions instead of that property.

NOTE: Had to remove support for multiconfig (only affects MSVC which is
not supported anyway; and mutliconf is an IDE thing in any case),
because could not see how to support it with generator expressions.
2016-08-30 23:01:43 -04:00
Ilya Kitaev beb6d9200d CMake: GPL 'libutils' script removed 2016-06-24 14:49:23 +03:00
Ilya Kitaev ef9a74c67e cmake libutils dependency added 2016-06-23 16:01:33 +03:00
Ilya Kitaev 191cb594de all wallet dependencies merged to single static lib 2016-06-23 16:01:33 +03:00
moneromooo-monero 3c3537e8c6
cmake: add missing FindLibunwind.cmake 2016-06-20 00:34:06 +01:00
moneromooo-monero f7301c3563
Revert "Print stack trace upon exceptions"
Ain't nobody got time for link/cmake skullduggery.

This reverts commit fff238ec94.
2016-03-21 10:12:23 +00:00
moneromooo-monero fff238ec94
Print stack trace upon exceptions
Useful for debugging users' logs
2016-03-19 21:48:36 +00:00
Howard Chu e98a3f26e2 Fix da0bce34
Windows doesn't define a default linker
2016-01-12 21:11:09 +00:00
Riccardo Spagni de03926850
updated copyright year 2015-12-31 08:39:56 +02:00
Riccardo Spagni ce974949e2
fixed static assert test 2015-05-31 15:39:56 +02:00
Riccardo Spagni e01d32e52d
cleaning up, removing redundant files, renaming, fixing incorrect licenses 2015-05-31 13:40:18 +02:00
Thomas Winget a8bc7182ea
Merge BlockchainDB into upstream 2015-04-07 17:56:18 -04:00
rfree2monero 2900b1e76c doxygen files 2015-04-01 19:23:15 +02:00
Thomas Winget 8e3347f310
Pull blockchain changes into berkeleydb branch 2015-03-17 19:52:53 -04:00
Riccardo Spagni a0cbf733b6
removed findlmdb.cmake, no longer required 2015-03-17 18:26:18 -04:00
Thomas Winget 43477b7dac
BerkeleyDB Blockchain building, not working yet
Everything except actually *using* BlockchainBDB is wired up, but the db
itself is not yet working.  Some error about user mem not large enough.
I think I know what this error means, but I can't determine the cause.

Notes: BerkeleyDB does not allow 0-indexing in its recno type databases,
  so block numbers *in the database* will be 1-indexed.  Modifications
  to indexing have been made as needed.
2015-03-16 09:14:51 -04:00
Thomas Winget 34883599bc
Add in-source lmdb to build process
Working on Linux, needs verified for other platforms but should be fine.
2015-01-18 18:30:31 -05:00
moneromooo-monero 0886183568 build: add liblmdb to the cmake autodetection system
update for rebase (warptangent 2015-01-04)
  src/cryptonote_core/CMakeLists.txt (edit)
  - replace LMDB_LIBRARIES with LMDB_LIBRARY set from autodetection
2015-01-04 19:39:40 -08:00