Fork of the great Pulsar daemon and Quasar daemon
There is an easy way to prepare local environment for running/compiling Elementum.
- Clone
libtorrent-go
repository:
git clone git@github.com:ElementumOrg/libtorrent-go.git
- Run
make local-env
that will createlocal-env
directory will all required components.
make local-env
- Modify
LOCAL-ENV
variable intest_build.sh
to uselocal-env
directory:
export LOCAL_ENV=$GOPATH/src/github.com/ElementumOrg/libtorrent-go/local-env/
Or you can apply environment variables and compile in any other way:
export LOCAL_ENV=$GOPATH/src/github.com/ElementumOrg/libtorrent-go/local-env/
export PATH=$PATH:$LOCAL_ENV/bin/
export PKG_CONFIG_PATH=$LOCAL_ENV/lib/pkgconfig
export SWIG_LIB=$LOCAL_ENV/share/swig/4.1.1/
-
Build the cross-compiler images, or alternatively, pull the cross-compiler images from Docker Hub:
make pull-all
Or for a specific platform:
make pull PLATFORM=android-x64
-
Set GOPATH
export GOPATH="~/go"
-
go get
go get -d github.com/elgatito/elementum
For Windows support, but required for all builds, you also need:
go get github.com/mattn/go-isatty
-
Build libtorrent-go libraries:
make libs
-
Make specific platforms, or all of them:
Linux-x64
make linux-x64
Darwin-x64
make darwin-x64
Windows
make windows-x86
All platforms
make
Find memory leaks
To find memory leaks, we can use Valgrind or use Sanitizers.
/bin/bash test_build.sh sanitize
This will build the binary with enabled sanitizer, so just run it and wait for errors in the console.
valgrind --leak-check=full ./elementum -disableBackup
This will run the binary with Valgrind. When you cose the process, Valgrind will show statistics. It is better to use usual binary, without sanitizer, and add backup disable options, as well as disable Kodi library integration. Or it will take a lot of time/CPU at the startup (unless you do need it).
Release of a binary part of Elementum means compiling binaries for all platforms and putting them into https://github.com/elgatito/elementum-binaries repository (if we run on the git tag).
Release is done with release.sh
script.