This documents building the I2P Easy-Install for Mac end-to-end, including the set up, configuration, and maintenance of a build environment.
In order to carry out a signed build which can be submitted to Apple for notarization and re-distribution, set the following environment variables:
export I2P_SIGNER=(The sha256 fingerprint of the developer signing cert)
export I2P_CODE_SIGNER=(The sha256 fingerprint of the developer signing cert)
export I2P_SIGNER_USERPHRASE=(The sha256 fingerprint of the developer signing cert)
Unlike many popular Linux distributions, Mac OSX does not have a built-in way
of switching between Java versions. There are several third-party tools for
doing this, including sdkman and asdf. After evaluation, I found
sdkman to be the most complete and easy to use. Installation instructions are
available here:
Since it uses a curlpipe to install, please be sure to pay attention to the content of the install script.
After you follow the install instructions, you will be able to fetch java SDKs
and automatically configure your JAVA_HOME.
Currently, bundles are built with OpenJDK 19.
sdk install java 19.0.1-open
sdk use java 19.0.1-openWill automatically set up your OpenJDK 19.
If you do not wish to use an SDK manager, or you with to use a different SDK manager, this Stack Overflow link shows every option in detail.
There are also a number of build dependencies for I2P which you will need to
keep up to date. This is aided by the use of the brew package manager. Obtain
brew by installing it according to the instructions here:
Once Brew is finished installing, install the I2P build dependencies.
brew install ant gettext gradleRemember to run brew update and brew upgrade ant gettext gradle before
rebuilding I2P.
Once you have all that installed you're ready to build the core I2P router
libraries and package the application. This can all be automated with the use
of build.sh. In order to do this successfully, you need to be able to sign
OSX packages, using a certificate which you obtain from Apple itself. Obtaining
that certificate is outside the scope of this document primarily because I do
not have the ability to obtain such a certificate without sharing my identity
with Apple.
- https://developer.apple.com/support/certificates/
- https://developer.apple.com/documentation/appstoreconnectapi/certificates
In order to configure your release environment, you must set the following environment variables:
I2P_SIGNERshould be the Apple Developer ID of the signerI2P_CODE_SIGNERshould be the Apple Developer ID for Code Signing of the signer(Usually find this withsecurity find-identity -v -p codesigning)I2P_VERSIONshould be the version of the I2P router that you want to useI2P_BUILD_NUMBERshould be an integer greater than0.
Ensure you have a copy of i2p.i2p checked out adjacent to the
i2p-jpackage-mac directory, in the same parent. If this is your first time
building the jpackage, run the following command:
git clone https://i2pgit.org/i2p-hackers/i2p.i2p "i2p.i2p-jpackage-mac"Change to the i2p.i2p-jpackage-mac directory and check out the release branch you want to
build a package for, e.g. i2p-1.9.0
cd ../i2p.i2p
git pull --tags
git checkout i2p-1.9.0Now that you have the right branch, clean and rebuild the core library:
ant clean preppkg-osx-onlyThen, change back to the i2p-jpackage-mac directory:
cd ../i2p-jpackage-macFinally, run the build.sh script to generate the .dmg file.
./build.sh