.. | ||
_service | ||
.gitignore | ||
libsodium.nuspec | ||
prepare.py | ||
README.md | ||
version.json |
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
_service
to reflect the current libsodium version. - Download
libsodium.spec
andlibsodium.changes
from here. - Upload
_service
,libsodium.spec
,libsodium.changes
and the currentlibsodium-{version}.tar.gz
to openSUSE Build Service. - Update the libsodium version, file names and download URLs in
prepare.py
. - Run
./prepare.py
to generate theMakefile
andlibsodium.{version}.nuspec
. - Run
make
to download the binaries and createlibsodium.{version}.nupkg
. You may need to installunzip
,rpm2cpio
anddotnet-dev
first. - Verify that everything in the
.nupkg
file is in place. - Publish the release by uploading the
.nupkg
file to nuget.org. - Commit the updated
prepare.py
andversion.json
to the libsodium repository.