source/buildLibraries.sh
automates the building of libressl, libgpg-error, libgcrypt, and libotr for the Textual IRC Client.
By default, the build is done in /tmp/static-library-build-results
.
Other libraries and frameworks are obtained prebuilt or built manually.
Prebuilt:
Built manually:
- asn1c 0.9.28 (used by Apple Receipt Loader, built using
Libraries/Source/Apple Receipt ASN1c/asn1c.xcodeproj
) - GRMustache af9d138f6fc1d985a2c4089ad19b791a02827908 (templating engine, built using
Libraries/Source/GRMustache/GRMustache.xcodeproj
)
This repository contains prebuilt binaries; however, if you need to rebuild them, instructions follow. This assumes the arches being built are the default (x86_64 and arm64).
The ARCHES can be changed in the buildLibraries.sh
script, in case other architectures are needed in the future.
cd source
./buildLibraries.sh
- Ensure that
/tmp/static-library-build-results/lib-static/universal
contains the following files:- libcrypto.a
- libgcrypt.a
- libgpg-error.a
- libotr.a
- libssl.a
- libtls.a
- Copy the above
.a
files into theLibraries
directory in this repository, overwriting any existing libraries.
Modify source/buildLibraries.sh
to have the desired library version numbers. Note that this might break build and might require additional patches.
After building the libraries, the following additional steps must be taken:
-
Verify that there are no critical differences between the headers for the different arches:
diff -Nruw /tmp/static-library-build-results/includes/x86_64 /tmp/static-library-build-results/includes/arm64
A slight difference in the comment header in
gpgrt.h
is expected. -
Delete the
Headers/libotr
and theHeaders/openssl
directories in this repository. -
Copy everything inside
/tmp/static-library-build-results/includes/arm64/
intoHeaders
in this repository. -
When completed,
Headers
should contain the following files:- gcrypt.h
- gpg-error.h
- gpgrt.h
- tls.h
And the following directories:
- libasn1c
- libmustache
- libotr
- openssl
-
Delete the following directories within
Documentation
in this repository:- libgcrypt
- libgpg-error
- libotr
- libssl
-
Copy everything inside
/tmp/static-library-build-results/licenses/arm64/
toDocumentation
. -
Build the Encryption Kit Xcode project and make corrections for any API changes in the libraries.
For the prebuilt libraries, just download the latest releases and copy the frameworks into Libraries
.
For the libraries built manually, instructions follow.
- Build
Source/Apple Receipt ASN1c/asn1c.xcodeproj
. - Copy the
libasn1c.a
build product intoLibraries
.
Updating this library is somewhat complicated -- files need to be copied from the source package and the Xcode project needs to be modified appropriately.
- Check out the source code from GitHub.
- Open
src/GRMustache.xcodeproj
, set the project to "GRMustache7-MacOS", and set build to "Any Mac". - Go to Project Info and set the Deployment Target to macOS 10.12.
- Close the Xcode project.
- Open Terminal, cd to the directory for GRMustache, and run
make lib/libGRMustache7-MacOS.a
. - Copy
lib/libGRMustache7-MacOS.a
toSource/GRMustache/Libraries/libmustache.a
in this repo. - If you are building a different version of GRMustache, you will need to copy over the headers to
Source/GRMustache/Headers
and ensure that there have been no substantial changes. - Open
Sources/GRMustache/GRMustache.xcodeproj
in this repo. - Build the GRMustache wrapper.
- Copy the
GRMustache.framework
build product to theLibraries
directory in this repo.
See the Documentation
directory.