Commit Graph

302 Commits (dev)

Author SHA1 Message Date
Jason Rhinelander bc62e9dd2d Revert "Build mac uninstaller as subproject instead of externalproject (#1485)"
This reverts commit e62f04c601.
4 years ago
Jason Rhinelander e62f04c601
Build mac uninstaller as subproject instead of externalproject (#1485)
This makes it easier to build/rebuild via a target, and is a bit
cleaner.
4 years ago
Jason Rhinelander a753e96d8d
Version bump (#1483)
* Bump version to 0.8.2

* Let cmake set PROJECT_NAME

`project(x ...)` already sets PROJECT_NAME (and CMAKE_PROKECT_NAME if
this is the top-level build) to `x`; the logic here seemed sort of
backwards.

* Get rid of uninstaller entitlement

We don't seem to need it anymore with Qt 5.15.1.

* Bump windows lokinet-gui build
4 years ago
Jason Rhinelander deae302571 macos: pass our pre-built static libs into the gui sub-build
Avoids the mac build needing to build lokimq & libzmq twice (once in
lokinet, then again in the gui)
4 years ago
Jason Rhinelander 1c0e4dc4e7 Move all patches into contrib/patches 4 years ago
Jason Rhinelander f9144a7bb3 Patch to avoid IP_DONTFRAG bug in latest xcode with broken Big Sur SDK 4 years ago
Jason Rhinelander 8c01201a2f Upgrade libunbound to latest stable 4 years ago
Jeff Becker bacb95962f try installing to lokinet subdirectory 4 years ago
Jeff Becker ca5df6436a add initial uninstaller code that is horrible 4 years ago
Jeff Becker 41311c020a preflight -> preinstall 4 years ago
Jeff Becker 0afe9f0138 update packaging for macos add preinstall script that nukes any existing lokinet make uninstaller revert dns to "empty" make cpack use preinstall script in pkg file 4 years ago
Jason Rhinelander bcdb521974 Update win32 gui download with smaller svg icon 4 years ago
Jeff f18f18372a
stop lokinet before uninstalling service (#1469)
* stop lokinet before uninstalling service

* kill gui in uninstaller

* add helper script for building windows installers because i forgot how to most of the time.
4 years ago
Jason Rhinelander b5bbe17479
Update gui win32 package url (#1466) (#1468)
Co-authored-by: Jeff <jeff@i2p.rocks>
4 years ago
Jeff 8a6ad2b7ee remove dpi flag for windows 4 years ago
Jeff ede6de708d
run without highdpi scaling on windows (#1456) 4 years ago
Jeff Becker 681de5fdaf bump lokinet wi32 gui build 4 years ago
Jeff Becker 9d8b724cae fix path in uninstall command 4 years ago
Jeff d1181d0ebb
Bump win32 gui version (#1446)
* bump gui build and hashpin

* run gui in no-tray mode by default

* bump gui version and hashpin
4 years ago
Jeff f3ef81b28c
use same directory for windows installer, remove version. (#1435) 4 years ago
Jason Rhinelander e47b70a82f
CMake fixes: libuv static build, base_libs, shared lib install dir (#1431)
* Update how we build libuv

- Update submoduled libuv to latest stable (1.40.0)
- Don't look for a system libuv if we're under BUILD_STATIC_DEPS
- Add a libuv interface library rather than using globals
- Make the windows build fall back to the submodule if not explicitly
  given a LIBUV_ROOT

* Replace ${LIBS} global with `base_libs` interface

This simplifies linking and include handling a bit.

* Remove unneeded header

* Add missing csignal header

(This was previously being pulled in incredibly indirectly via some
stuff that eventually includes some other stuff that eventually included
uv.h)

* Use GNUInstallDirs to get lib dir instead of hard-coding lib

Fixes #1429
4 years ago
Jeff 32f4287df6
handle libuv case when we don't have it (#1403)
* add case for cmake when libuv is not found

* update error case in cmake
4 years ago
Jeff 4354a270c0
bump win32 gui build\ * add hashpin for gui * add installer icon (#1424) 4 years ago
Jeff c5c73568a5
redo cpack for win32 (#1420)
* bundle gui
* bundle bootstrap.signed
* add shortcut
* install/remove service
4 years ago
Jason Rhinelander a888b7bbc2
Reduce macOS target to 10.12, and fix target for deps (#1414)
This is relatively painless for lokinet as it already had workarounds
during 0.8 dev work for the things macos hated in 10.13.

Dependencies, however, were not being built with the proper macos target
junk, so this fixes that.
4 years ago
Jason Rhinelander 62a90f4c82 macos package fixes for 0.3.0
- bumps deployment target to 10.15 because earlier versions don't
  support C++17.
- remove double-include of installer.cmake
- use new static dep lokinet build system
- replace lokinetctl with lokinet-vpn
4 years ago
Jeff fe30193a97
revive android build system (#1339)
* it lives?

* clean up

* add readme and add x86_64 to abi filters

* disable route poking on android

* make it compile on android

* it compiles!!111

* typofix

* re-enable ccache for android
4 years ago
Jeff 686b13b2f3 fix up cmake lokimq target 4 years ago
Jason Rhinelander f5e5066bd5
Update deps (#1348)
* Update submodules/static deps to latest versions

* Add mingw zmq build patch

* Drop support for Windows 2000
4 years ago
Jeff dfd8df5e7f
add uninstall target (#1340)
* add uninstall target

* * redo cmake uninstall
* remove lokinet-vpn python script
* don't install lokinet-vpn twice
4 years ago
Jeff Becker d70e11feba
change what patches are applied 4 years ago
Jeff Becker ab568b27d0
bump windows version for CI until patches are updated 4 years ago
Jeff Becker fc75da174e
disable second path for now until it works 4 years ago
Rick V 5c34665fce
move win32 lokimq patch 4 years ago
Jeff Becker 4bb214eba0
attempt fix for libunbound on win32
* run unbound stuff in another thread because LOL windows
* because unbound runs in another thread callbacks for libunbound need to be wrapped in a deferred call so they are done in the logic thread
* bump sqlite3 dep because it's gone, repin hash.
4 years ago
Jason Rhinelander 2b2c41fdf6
Fix sqlite3 external target name 4 years ago
Stephen Shelton eb9a862f51
Sqlite3 deps for Windows / static targets 4 years ago
Stephen Shelton 6e1a23cdc7
Use pkg_check_modules instead of find_package for sqlite3 4 years ago
Stephen Shelton 4aa6f8e2df
Use find_package() for sqlite3 4 years ago
Jeff Becker 8772c05a13
revert download libsodium target name change 4 years ago
Jeff Becker 2737cd6f98
remove FindSodium.cmake and use the cmake incantations from loki-core for setting sodium target up 4 years ago
Jeff Becker c6bd0afe96
move sodium cmake target about so that it is detected earlier 4 years ago
Jeff Becker 9f7ac7a9a3
apply patch 4 years ago
Jeff Becker c2f9c46686
zmq requires win xp or higher. 4 years ago
Jeff Becker fc08f92425
move lokimq cmake code 4 years ago
Jeff Becker e13e886df9
fix up event loop crap so that unit tests pass 4 years ago
Jeff Becker 970cdf212b
fix up cmake cruft 4 years ago
Jeff Becker 7003eda305
add FindLokiMQ.cmake for finding lokimq package 4 years ago
Jeff Becker 31304dbd9f
fix up cmake cruft 4 years ago
Jeff Becker 520e472bcd
add FindLokiMQ.cmake for finding lokimq package 4 years ago
Jeff Becker ad882d0d70
initial working code 4 years ago
Jeff Becker 0006751d80
initial wack at lokimq 4 years ago
Jeff Becker a9de1ad277
fix typo 4 years ago
Jeff Becker c66e925fb2
add more cmake incantations for windows cross compile 4 years ago
Jeff Becker fdfdd2a1d2
turn off lto, add patches 4 years ago
Jeff Becker db3d43a513
fix typo 4 years ago
Jeff Becker 26a2f54b0b
set ar and ranlib on openssl cross compile to appease the cmake god 4 years ago
Jason Rhinelander cdd57ac09b fix unbound ssl linking 4 years ago
Thomas Winget 0ecdf60777 static build fixes in cmake stuff
I hate cmake so much.
4 years ago
Linux User e6bcbf47b4
patch libsodium for windows the cmake way 4 years ago
Rick V adf253e800
picflags differ slightly on native vs wow64 builds 4 years ago
Rick V 45890133bc
LIBUV_ROOT override for win32
emit PIC code (.reloc) on win32 for aslr
4 years ago
Jason Rhinelander 83fc7de237 Get processor count properly 4 years ago
Jeff Becker fbb7c0d6f9
add forgotten file 4 years ago
Jeff Becker 6af498092b
exit traffic via loki addresses 4 years ago
Jason Rhinelander a484ccffc2 static curl build fixes
- fix ldap disabling flag
- disable a ton of protocols (include ldap, properly)
- remove INSTALL_COMMAND (the default seems to work fine)
- disable --quiet so we can see the configuration summary
4 years ago
Jason Rhinelander 7d5a99d820
Merge pull request #1284 from majestrate/toggle-lto-2020-05-20
add WITH_LTO option to disble lto on compile time
4 years ago
Jeff Becker a6d17dcd16
add WITH_LTO option to disble lto on compile time 4 years ago
Jason Rhinelander ebd2142114 Don't use std::optional::value() because f u macos
This replaces all use of std::optional's `opt.value()` with `*opt`
because macOS is great and the ghost of Steve Jobs says that actually
supporting std::optional's value() method is not for chumps before macOS
10.14.  So don't use it because Apple is great.

Pretty much all of our use of it actually is done better with operator*
anyway (since operator* doesn't do a check that the optional has a
value).

Also replaced *most* of the `has_value()` calls with direct bool
context, except for one in the config section which looked really
confusing at a glance without a has_value().
4 years ago
Jason Rhinelander be9ddf2ae1 Bring back ghc::filesystem for broke AF macos
macOS doesn't provide `<filesystem>` support when targetting anything
earlier than 10.15.
4 years ago
Jason Rhinelander b4fce0e3ee curl: use ccache; disabled lots of other crap
brotli and libpsl both got autodetected on my system, so explicitly
disable them (and a bunch of other crap from --configure).

Build with ccache.
4 years ago
Jason Rhinelander fa794e64cd Build libsodium with ccache and fPIC
fPIC is needed in case we are building a shared liblokinet (within which
we want the static libsodium).
4 years ago
Jason Rhinelander c5faa86926 cmake refactor
Refactors many things in cmake to improve and simplify:

- don't use variable indirection for target names; target names are
*already* a variable of sorts.  (e.g. ${UTIL_LIB} is now just
lokinet-util).  cmake/basic_definitions.cmake is now gone.

- fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather
than shoving a bunch of flag hacks through link_libraries and
add_compile_options.  This also now enables LTO when building a shared
library (because previously the -flto hacks were only turned on in the
static code for some reason).

- build liblokinet as *either* shared library or static library, but not
both.  Building both makes things more complicated because they had
different names (lokinet-shared or lokinet-static) and seems pointless:
you generally want one or the other.  Now there is just the liblokinet
target, which will be shared or static depending on the value of
BUILD_SHARED_LIBS.

- Simplify lokinet-cryptography AVX2 code: just build *one* library, and
add in the additional AVX2 files when possible, rather than building two
and needing to merge them.

- Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK.
It makes no sense to use one of these (_RUNTIME) on Windows and the
other on non-Windows when they appear to try to do the same thing.

- remove a bunch of annotations from `endif(FOO)` -> `endif()`.

- move all the tuntap compilation code (including OS-specific source
file selection) into vendor/CMakeLists.txt and build tuntap as an
intermediate OBJECT library rather than keeping a global variable in 5
different files.

- move release motto define to root cmake; it made no sense being
duplicated in both unix.cmake and win32.cmake

- fix add_log_tag to not stomp on any existing source compile flags with
its definition.  Also use proper compile definition property instead of
cramming it into compile flags.

- make optimization/linker flags less hacky.  There's no reason for us
to force particular optimization flags because the cmake build type
already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3).  Not doing
that also silences a bunch of cmake warnings because it thinks "-O0 -g3"
etc.  are link libraries (which is reasonable: that's what the code was
telling cmake they are).

- sets the default build type to RelWithDebInfo which gives us `-O2 -g`
if you don't specify a build type.

- Move PIC up (so that the things loaded in unix.cmake, notably libuv,
have it set).

- Add a custom `curl` interface library that carries the correct link
target and include paths for curl (system or bundled).
4 years ago
Jeff Becker 64157d5d44 track libcurl and libuv with cmake, add libuv submodule 4 years ago
Jeff Becker abc1f67430
check for std::optional as macos can be broke af sometimes 4 years ago
Jeff Becker 5a24d2deef
add check for std::filesystem 4 years ago
cathugger 0bb43d98c7
fix GenVersion.cmake
* rev-parse --short without any argument defaults to 8 chars
* truncation is absolutely moot here
* rev-list --abbrev-commit also uses 8 chars by default

because of length mismatch (COMMIT - 9 chars, TAGGEDCOMMIT - 8 chars) it always was mismatching them even when it should've been detecting that it's at release tag.
cut out explicit lengths and leave everything to use defaults, because they work (they both rely on the same core.abbrev setting so no length mismatch should happen).
4 years ago
Jason Rhinelander 1697bf90fe C++17
Compiles with C++17, replaces ghc::filesystem with std::filesystem,
nonstd::optional with std::optional, and llarp::string_view with
std::string_view.
4 years ago
Jeff Becker 783e72da73
fix ci for win32 4 years ago
Stephen Shelton 67f023cf8a
Use install(PROGRAMS... instead of isntall(FILES... 4 years ago
Jason Rhinelander 3048ccf3f8 Set -mmacosx-version-min the cmake way 4 years ago
Jeff edc0d1a3ed
Merge pull request #1225 from majestrate/macos-cpack-setup-and-bootstrap-2020-04-10
macos cpack installer infra
4 years ago
Stephen Shelton 0b1c57f650 Include macos uninstall script 4 years ago
Jason Rhinelander 9f208d2b6c Pass CMAKE_PREFIX_PATH through to lokinet-gui
Needed to build against the right Qt
4 years ago
Rick V 96fc3cdd55
fix pybind 4 years ago
Jason Rhinelander 216b807cb3 Notarize has an "a" in it 4 years ago
Jason Rhinelander 8d74407d11 codesigning and notarization
Codesigns and notarizes the package.  Requires a bunch of stuff to
actually get this working.  (see contrib/macos-signing.txt).

I'm currently also building with

    -DLOKINET_GUI_REPO=https://github.com/jagerman/loki-network-control-panel.git -DLOKINET_GUI_CHECKOUT=cmake

because it needs the camke-ification PR for the control panel to
properly sign everything there.
4 years ago
Jason Rhinelander 0032f1fdde Add simple installer readme 4 years ago
Jason Rhinelander daf0174e53 Change mac install prefix to /opt/lokinet
/usr/local is probably going to get stomped on by homebrew.
4 years ago
Jason Rhinelander 93311fbc99 Build lokinet-gui with ExternalProject
Also installs it without the extra hack by specifying ../../Applications
for the destination.  (This definitely feels kind of nasty, but it works).
4 years ago
Jason Rhinelander 3dd3d48fbb Consolidate cmake vars & definitions
CMake will set version variables itself if you give the version in the
project(), which is cleaner.  Also removes some (nearly) duplicate
definitions and settings added in basic_definitions.cmake for unknown
reasons.

Removes some redundant settings (name, description, version) from the
cpack settings which already default to the values from the project()
call.
4 years ago
Stephen Shelton c20d5b186d Bundle gui in mac installer 4 years ago
Stephen Shelton dd3121d8ac MacOS installer / runtime nonsense 4 years ago
Jeff Becker 31f74b5ffb macos post install script that bootstraps, generates configs and registers plist 4 years ago
Jeff Becker c36b6a409c
move version to cmake so docs can access it 4 years ago
Jeff Becker 3e7acb72e1
more docs, make doxygen work 4 years ago
Jeff Becker 7455a1956d
make apple builds build for older versions and embrace the bitrot 4 years ago
Jeff Becker 9428689939
fix up cpack for macos 4 years ago
Jeff Becker aae260fbea
more macos installer bits 4 years ago
Jeff Becker 3b26b8b24d
make gitlab pump out 32 bit installers, no lto for builds as that is cursed for now. 4 years ago
Jeff Becker 9e696e131e
make installer pull in tuntap driver 4 years ago
Jeff Becker f335aaa847
set license 4 years ago
Jeff Becker 2190da8c81
cpack win32 4 years ago
Jason Rhinelander 3b0927ce13
Merge pull request #1140 from despair86/cmake-cleanup
some light cmake cleanup for win32
4 years ago
Rick V 3ca50b3619
missing branch on option 4 years ago
Rick V d22af469a4
some win32 cmake cleanup
also removes MSVC rules (we don't support MSVC)
4 years ago
Rick V dbc559d4ff
finally fix cross-LTO on windows builds 4 years ago
Rick V 4cd7a22ca3
fix libsodium cross compile 4 years ago
Jeff Becker 0a6c91b26c
operator presidence 4 years ago
Jeff Becker d44a96769a
allow building from source tarballs 4 years ago
despair 8a27e3972d
we need XPG7 on netbsd 4 years ago
Jason Rhinelander 7ab6220a41 Older cmake workaround 4 years ago
Jason Rhinelander 5a4700d868 Use ExternalProject to build downloaded libsodium 4 years ago
Jason Rhinelander 73239f4c39 Use glob to find sodium source files
Manually changing the list every time we want to change the libsodium
version is painful.

I tested this glob against libsodium 1.0.17 and verified it produces the
same set of files (aside from the generated version.h), and that in
1.0.18 it produces the same set modulo upstream files removed/added.
4 years ago
Jason Rhinelander b72a4296b7 Fix libsodium 1.0.18 URL 4 years ago
Jason Rhinelander 2b93ccb393 Bump libsodium required version to 1.0.18
We use crypto_core_ed25519_scalar_mul which is only exported by
libsodium >= 1.0.18.
4 years ago
Jeff Becker da5eb913e9
use proper cmake call 4 years ago
Jeff Becker fde0ca374f
i hate curl 4 years ago
Jeff Becker 336a748695
make it build in normal mode too 4 years ago
Jeff Becker 80cbddde7b
fixups for review 4 years ago
Jeff Becker 2ce592e4af
static link with docs 4 years ago
Ryan Tharp 20ce679c3a macos release needs the include path 4 years ago
Ryan Tharp b21b0b49d0 support LIBCURL_ROOT, disable LIBUV includes 4 years ago
Ryan Tharp 6001215a23 bring in all updates from STATIC_RUNTIME 4 years ago
Rick V a62a75d640
nit 4 years ago
Rick V 9fa9209114
don't be aggressive
remove libcurl packaging rules. We still build it, but ship only the curl.exe
4 years ago
Rick V d1b9b89812
add note
add libuv build

add its dependent libraries to the final link line
4 years ago
Rick V 6d49ffd60b
include all platform dependencies transitively 4 years ago
Jeff Becker ab183665ab
freebsd fix 4 years ago
Stephen Shelton 332f33b049 Remove FS_LIB conditionals 4 years ago
Stephen Shelton 5ce260fce1 Use vendored fs::filesystem on all platforms 4 years ago
Jason Rhinelander 638fb25b47 Put version info into a compiled file
This rewrites the version info using lokid's approach of compiling it
into a .cpp file that gets generated as part of the build (*not* during
the configure stage).

Among other things, this means that changing the version no longer
invalidates ccache or cmake dependencies, and because it depends on
`.git/index` git commits will cause the version to be regenerated,
making the commit tag more reliable (currently if you rebuild without
running cmake your git commit tag doesn't update).
4 years ago
Jeff Becker abf9544ddc
make libuv on win32 work 4 years ago
Jason Rhinelander 8d2c22fc72 Replace cppbackport with ghc-filesystem
From https://github.com/gulrak/filesystem which is more up-to-date and
looks better maintained than cppbackport.
5 years ago
Jeff Becker 8bac293dc7
fix patching command 5 years ago
Jeff Becker 01dbd329bd
add forgotten file 5 years ago
Jeff Becker 25c820f166
add compile time override for libsodium tarball url using -DSODIUM_TARBALL_URL=https://whatever/tarball.tar.gz 5 years ago
Rick V c63d0b5be2
add cmake rule to patch libsodium on windows
# Conflicts:
#	crypto/CMakeLists.txt
5 years ago
Jason Rhinelander ac3cd441ac Fix download hash verification & version string
Fix hash verification in downloaded libsodium package.

Fix @VERSION@ expansion in sodium/version.h (but don't set it globally
because VERSION is far too generic a variable to be leaving set).
5 years ago
Jason Rhinelander 57ccb1fd5c Move sodium download into separate cmake include 5 years ago
Rick V 9b9ea6e6d0
make that a universal rule 5 years ago
Rick V b473f17231
lto not supported for cross compile targets 5 years ago
Rick V c00b083be7
grab everything and the kitchen sink at build time instead
will finish testing this once the new release is stable
5 years ago
Rick V b2c23f2c71
a. GCC LTO requires specifiying CXXFLAGS in LDFLAGS
b. not my fault your machine doesn't link pthread properly
5 years ago
Jason Rhinelander 0774213e87 Fix cmake sodium version check 5 years ago
Jeff Becker e0a9059d8c
use PACKAGE_FIND_VERFSION 5 years ago
Jeff Becker 7fbb8e25bb
set version in FindLibsodium.cmake 5 years ago
Jeff Becker f38240f945
devendor libsodium by default except for android 5 years ago
Stephen Shelton 961c8dbddf Prevent in-source-builds with cmake macro 5 years ago
Michael 77b4efd78b
fixup ios 5 years ago