libsodium.props17-Aug-20181.4 KiB

prepare.py17-Aug-20189.3 KiB

README.md17-Aug-20182.8 KiB


1This directory contains scripts and files to package libsodium for .NET Core.
3*Note:* The NuGet package is intended for the implementation of language
4bindings such as [NSec]( It does not provide a
5.NET API itself.
7In .NET Core, it is customary to provide pre-compiled binaries for all platforms
8as NuGet packages. The purpose of the `` script in this directory is
9to generate a `Makefile` that downloads and builds libsodium binaries for a
10number of platforms and assembles them in a NuGet package that can be uploaded
11to [](
13* For Windows, binaries are obtained from
14  [](
15* For macOS, binaries are extracted from the
16  [Homebrew libsodium bottle](
17* For Linux, libsodium is compiled in Docker containers.
19See `` for the complete list of supported platforms.
21The metadata for the NuGet package is located in `libsodium.props`.
26Version numbers for the packages for .NET Core consist of three components:
28* *libsodium version*  
29  The libsodium version is in the format `X.Y.Z`.
30* *package revision*  
31  It may be necessary to release more than one package for a libsodium version,
32  e.g., when adding support for a new platform or if a release contains a broken
33  binary. In this case, a package revision number is added as a fourth part to
34  the libsodium version, starting at `1`. For example, `1.0.16` is the initial
35  release of the package for libsodium 1.0.16 and `` is the fifth
36  revision (sixth release) of that package.
37* *pre-release label*  
38  If a package is a pre-release, a label is appended to the version number in
39  `-preview-##` format where `##` is the number of the pre-release, starting at
40  `01`. For example, `1.0.16-preview-01` is the first pre-release of the package
41  for libsodium 1.0.16 and `` the second pre-release of the
42  fifth revision of the package for libsodium 1.0.16.
45**Making a release**
471. Update any existing Docker images.
482. Run `python3 <version>` to generate the `Makefile`, where
49   `<version>` is the package version number in the format described above.
503. Take a look at the generated `Makefile`. It uses `sudo` a few times.
514. Run `make` to download and build the binaries and create the NuGet package.
52   You may need to install `docker`, `make`, `curl`, `tar` and `unzip` first.
535. Grab a cup of coffee. Downloading the Docker images and compiling the Linux
54   binaries takes a while. When done, the NuGet package is output as a `.nupkg`
55   file in the `build` directory.
566. Run `make test` to perform a quick test of the NuGet package. Verify that
57   everything else in the `.nupkg` file is in place.
587. Publish the release by uploading the `.nupkg` file to
59   [](