This project is focused on the compilation, packaging, distribution and installation of tor
resources for Kotlin Multiplatform, primarily to be consumed as a dependency for kmp-tor.
2 variants of tor
are compiled; 1 with the flag --enable-gpl
, and 1 without it.
Publications with the -gpl
suffix are indicitive of the presence of the --enable-gpl
compile
time flag.
Both variants are positionally identical with the same package names, classes, resource
names/locations, etc. The only difference between them are the compilations of tor
being provided.
Only 1 variant can be had for a project, as a conflict will occur if both are present.
e.g. (build.gradle.kts
)
// BAD
dependencies {
implementation("io.matthewnelson.kmp-tor:resource-exec-tor:$vKmpTorResource")
implementation("io.matthewnelson.kmp-tor:resource-exec-tor-gpl:$vKmpTorResource")
}
// BAD
dependencies {
implementation("io.matthewnelson.kmp-tor:resource-exec-tor:$vKmpTorResource")
implementation("io.matthewnelson.kmp-tor:resource-noexec-tor-gpl:$vKmpTorResource")
}
// GOOD! (non-gpl)
dependencies {
implementation("io.matthewnelson.kmp-tor:resource-exec-tor:$vKmpTorResource")
implementation("io.matthewnelson.kmp-tor:resource-noexec-tor:$vKmpTorResource")
}
// GOOD! (gpl)
dependencies {
implementation("io.matthewnelson.kmp-tor:resource-exec-tor-gpl:$vKmpTorResource")
implementation("io.matthewnelson.kmp-tor:resource-noexec-tor-gpl:$vKmpTorResource")
}
This is to respect the GPL
licensed code tor
is utilizing such that projects who
have a GPL
license are able to take advantage of the new functionality, and projects who do
not have a GPL
license can still utilize tor
without infringing on the license.
See BUILD.md
NOTE: macOS
and Windows
compilations are code signed, so they work out of the box.
x86 | x86_64 | armv7 | aarch64 | ppc64 | |
---|---|---|---|---|---|
Windows | ✔ | ✔ | |||
macOS | ✔ | ✔ | |||
Linux (android) | ✔ | ✔ | ✔ | ✔ | |
Linux (libc) | ✔ | ✔ | ✔ | ✔ | ✔ |
Linux (musl) | |||||
FreeBSD |
Tor and its dependencies are compiled from source using the following versions
git tag | |
---|---|
libevent | release-2.1.12-stable |
openssl | openssl-3.2.2 |
tor | tor-0.4.8.12 |
xz | v5.6.2 |
zlib | v1.3.1 |
tor
is compiled via the external/task.sh
script using Docker
in order to maintain
reproducability.
Detached code signatures are generated for Apple/Windows builds which are checked into
git
; this is so others wishing to verify reproducability of the tor
binaries they
are running (or providing to their users) can do so.
You can view the help
output of task.sh
by running ./external/task.sh
from the project's
root directory.
$ git clone https://github.com/05nelsonm/kmp-tor-resource.git
$ cd kmp-tor-resource
$ ./external/task.sh
The compiled output from task.sh
's build
tasks are "packaged" for the given platforms and
moved to their designated package module's resource directories
(e.g. external/build/package/resource-lib-tor/src/jvmMain/resources
).
Running ./external/task.sh package:all
after a build
task will do the following.
Android/Jvm/Node.js:
- Android compilations are moved to the
src/androidMain/jniLibs/{ABI}
directory. geoip
&geoip6
files aregzipped
and moved to thesrc/jvmMain/resources
directory.- Detached code signatures for
macOS
andWindows
are applied to the compilations (if needed). - All compilations are
gzipped
and moved to thesrc/jvmMain/resources
directory for their respective hosts and architectures.
Native:
- The same process occurs as above, but after being
gzipped
each resource is transformed into aNativeResource
(e.g.resource_tor_gz.kt
).
After "packaging" all resources, an additional step for Node.js is performed.
geoip
,geoip6
, and all compilations are published toNpmjs
via the:library:npmjs
module.
New releases will be published to Maven Central and can be consumed as a Kotlin Multiplatform dependency.
Currently, there is only a SNAPSHOT
publication in order to work on kmp-tor 2.0.0
.
Once that work is complete a Release will be made for kmp-tor-resource
.