Bring in https://github.com/jedisct1/libsodium at 461ac93b260b91db8ad957f5a576860e3e9c88a1 (August 7, 2018), unmodified. libsodium is derived from Daniel J. Bernstein et al.'s 2011 NaCl ("Networking and Cryptography Library," pronounced "salt") software library. At the risk of oversimplifying, libsodium primarily exists to make it easier to use NaCl. NaCl and libsodium provide high quality implementations of a number of useful cryptographic concepts (as well as the underlying primitics) seeing some adoption in newer network protocols. I considered but dismissed cleaning up the directory hierarchy and discarding artifacts of other build systems in favor of remaining close to upstream (and easing future updates). Nothing is integrated into the build system yet, so in that sense, no functional change.
2.8 KiB
This directory contains scripts and files to package libsodium for .NET Core.
Note: The NuGet package is intended for the implementation of language bindings such as NSec. It does not provide a .NET API itself.
In .NET Core, it is customary to provide pre-compiled binaries for all platforms
as NuGet packages. The purpose of the prepare.py script in this directory is
to generate a Makefile that downloads and builds libsodium binaries for a
number of platforms and assembles them in a NuGet package that can be uploaded
to nuget.org.
- For Windows, binaries are obtained from download.libsodium.org.
- For macOS, binaries are extracted from the Homebrew libsodium bottle.
- For Linux, libsodium is compiled in Docker containers.
See prepare.py for the complete list of supported platforms.
The metadata for the NuGet package is located in libsodium.props.
Versioning
Version numbers for the packages for .NET Core consist of three components:
- libsodium version
The libsodium version is in the formatX.Y.Z. - package revision
It may be necessary to release more than one package for a libsodium version, e.g., when adding support for a new platform or if a release contains a broken binary. In this case, a package revision number is added as a fourth part to the libsodium version, starting at1. For example,1.0.16is the initial release of the package for libsodium 1.0.16 and1.0.16.5is the fifth revision (sixth release) of that package. - pre-release label
If a package is a pre-release, a label is appended to the version number in-preview-##format where##is the number of the pre-release, starting at01. For example,1.0.16-preview-01is the first pre-release of the package for libsodium 1.0.16 and1.0.16.5-preview-02the second pre-release of the fifth revision of the package for libsodium 1.0.16.
Making a release
- Update any existing Docker images.
- Run
python3 prepare.py <version>to generate theMakefile, where<version>is the package version number in the format described above. - Take a look at the generated
Makefile. It usessudoa few times. - Run
maketo download and build the binaries and create the NuGet package. You may need to installdocker,make,curl,tarandunzipfirst. - Grab a cup of coffee. Downloading the Docker images and compiling the Linux
binaries takes a while. When done, the NuGet package is output as a
.nupkgfile in thebuilddirectory. - Run
make testto perform a quick test of the NuGet package. Verify that everything else in the.nupkgfile is in place. - Publish the release by uploading the
.nupkgfile to nuget.org.