This directory contains scripts and files to package libsodium for .NET Core.
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 pre-compiled libsodium binaries from a
list of sources and creates a NuGet package that can be uploaded to
nuget.org.
Sources
The list of sources is located in prepare.py and needs to be updated on each
libsodium release. Currently, libsodium binaries are obtained in the following
ways:
- For Windows, the binaries are taken from download.libsodium.org.
- For macOS, the binaries are extracted from the Homebrew libsodium bottle.
- For Linux, libsodium is compiled on and downloaded from the openSUSE Build Service.
Metadata
The metadata for the NuGet package is located in libsodium.nuspec. On each
invocation, the prepare.py script generates a new version number and creates a
.nuspec file that contains the metadata from libsodium.nuspec, the generated
version number and the list of binaries.
Making a release
- Update
_serviceto reflect the current libsodium version. - Download
libsodium.specandlibsodium.changesfrom here. - Upload
_service,libsodium.spec,libsodium.changesand the currentlibsodium-{version}.tar.gzto openSUSE Build Service. - Update the libsodium version, file names and download URLs in
prepare.py. - Run
./prepare.pyto generate theMakefileandlibsodium.{version}.nuspec. - Run
maketo download the binaries and createlibsodium.{version}.nupkg. You may need to installunzip,rpm2cpioanddotnet-devfirst. - Verify that everything in the
.nupkgfile is in place. - Publish the release by uploading the
.nupkgfile to nuget.org. - Commit the updated
prepare.pyandversion.jsonto the libsodium repository.