Add libsodium source

This commit is contained in:
Mikhail Thompson
2024-06-27 15:00:43 +03:00
parent 7f4e947cf5
commit 6bd505c313
566 changed files with 77692 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
build
cache
temp
Makefile
!recipes/*

View File

@@ -0,0 +1,59 @@
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](https://github.com/ektrah/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](https://nuget.org/).
* For Windows, binaries are obtained from
[download.libsodium.org](https://download.libsodium.org/libsodium/releases/).
* For macOS, binaries are extracted from the
[Homebrew libsodium bottle](https://bintray.com/homebrew/bottles/libsodium).
* 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 format `X.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 at `1`. For example, `1.0.18` is the initial
release of the package for libsodium 1.0.18 and `1.0.18.5` is 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 at
`01`. For example, `1.0.18-preview-01` is the first pre-release of the package
for libsodium 1.0.18 and `1.0.18.5-preview-02` the second pre-release of the
fifth revision of the package for libsodium 1.0.18.
**Making a release**
1. Update any existing Docker images.
2. Run `python3 prepare.py <version>` to generate the `Makefile`, where
`<version>` is the package version number in the format described above.
3. Take a look at the generated `Makefile`. It uses `sudo` a few times.
4. Run `make` to download and build the binaries and create the NuGet package.
You may need to install `docker`, `make`, `curl`, `tar` and `unzip` first.
5. 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 `.nupkg`
file in the `build` directory.
6. Run `make test` to perform a quick test of the NuGet package. Verify that
everything else in the `.nupkg` file is in place.
7. Publish the release by uploading the `.nupkg` file to
[nuget.org](https://nuget.org/).

View File

@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<Project>
<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<PackageOutputPath>$(MSBuildProjectDirectory)</PackageOutputPath>
<ProjectFileToPack>$(MSBuildProjectFullPath)</ProjectFileToPack>
</PropertyGroup>
<PropertyGroup>
<PackageId>libsodium</PackageId>
<Version><!-- set by prepare.py --></Version>
<Authors>Frank Denis</Authors>
<Description>Internal implementation package not meant for direct consumption. Please do not reference directly.</Description>
<Copyright>&#169; 2013-2019 Frank Denis</Copyright>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseUrl>https://raw.githubusercontent.com/jedisct1/libsodium/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://libsodium.org/</PackageProjectUrl>
<MinClientVersion>4.0</MinClientVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Platforms" Version="1.0.1" />
</ItemGroup>
<ItemGroup>
<Content Include="LICENSE" PackagePath="" />
<Content Include="AUTHORS" PackagePath="" />
<Content Include="ChangeLog" PackagePath="" />
<Content Include="runtimes\**\*.*" PackagePath="runtimes\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,302 @@
#!/usr/bin/env python3
import os.path
import re
import sys
WINDOWS = [
# --------------------- ----------------- #
# Runtime ID Platform #
# --------------------- ----------------- #
("win-x64", "x64"),
("win-x86", "Win32"),
# --------------------- ----------------- #
]
MACOS = [
# --------------------- ----------------- #
# Runtime ID Codename #
# --------------------- ----------------- #
("osx-x64", "mojave"),
# --------------------- ----------------- #
]
LINUX = [
# --------------------- ----------------- #
# Runtime ID Docker Image #
# --------------------- ----------------- #
("linux-x64", "debian:stretch"),
# --------------------- ----------------- #
]
EXTRAS = ["LICENSE", "AUTHORS", "ChangeLog"]
PROPSFILE = "libsodium.props"
MAKEFILE = "Makefile"
BUILDDIR = "build"
CACHEDIR = "cache"
TEMPDIR = "temp"
PACKAGE = "libsodium"
LIBRARY = "libsodium"
DOCKER = "sudo docker"
class Version:
def __init__(self, libsodium_version, package_version):
self.libsodium_version = libsodium_version
self.package_version = package_version
self.builddir = os.path.join(BUILDDIR, libsodium_version)
self.tempdir = os.path.join(TEMPDIR, libsodium_version)
self.projfile = os.path.join(
self.builddir, "{0}.{1}.pkgproj".format(PACKAGE, package_version)
)
self.propsfile = os.path.join(self.builddir, "{0}.props".format(PACKAGE))
self.pkgfile = os.path.join(
BUILDDIR, "{0}.{1}.nupkg".format(PACKAGE, package_version)
)
class WindowsItem:
def __init__(self, version, rid, platform):
self.url = "https://download.libsodium.org/libsodium/releases/libsodium-{0}-stable-msvc.zip".format(
version.libsodium_version
)
self.cachefile = os.path.join(CACHEDIR, re.sub(r"[^A-Za-z0-9.]", "-", self.url))
self.packfile = os.path.join(
version.builddir, "runtimes", rid, "native", LIBRARY + ".dll"
)
self.itemfile = "{0}/Release/v140/dynamic/libsodium.dll".format(platform)
self.tempdir = os.path.join(version.tempdir, rid)
self.tempfile = os.path.join(self.tempdir, os.path.normpath(self.itemfile))
def make(self, f):
f.write("\n")
f.write("{0}: {1}\n".format(self.packfile, self.tempfile))
f.write("\t@mkdir -p $(dir $@)\n")
f.write("\tcp -f $< $@\n")
f.write("\n")
f.write("{0}: {1}\n".format(self.tempfile, self.cachefile))
f.write("\t@mkdir -p $(dir $@)\n")
f.write(
"\tcd {0} && unzip -q -DD -o {1} '{2}'\n".format(
self.tempdir,
os.path.relpath(self.cachefile, self.tempdir),
self.itemfile,
)
)
class MacOSItem:
def __init__(self, version, rid, codename):
self.url = "https://bintray.com/homebrew/bottles/download_file?file_path=libsodium-{0}.{1}.bottle.tar.gz".format(
version.libsodium_version, codename
)
self.cachefile = os.path.join(CACHEDIR, re.sub(r"[^A-Za-z0-9.]", "-", self.url))
self.packfile = os.path.join(
version.builddir, "runtimes", rid, "native", LIBRARY + ".dylib"
)
self.itemfile = "libsodium/{0}/lib/libsodium.dylib".format(
version.libsodium_version
)
self.tempdir = os.path.join(version.tempdir, rid)
self.tempfile = os.path.join(self.tempdir, os.path.normpath(self.itemfile))
def make(self, f):
f.write("\n")
f.write("{0}: {1}\n".format(self.packfile, self.tempfile))
f.write("\t@mkdir -p $(dir $@)\n")
f.write("\tcp -f $< $@\n")
f.write("\n")
f.write("{0}: {1}\n".format(self.tempfile, self.cachefile))
f.write("\t@mkdir -p $(dir $@)\n")
f.write(
"\tcd {0} && tar xzmf {1} '{2}'\n".format(
self.tempdir,
os.path.relpath(self.cachefile, self.tempdir),
os.path.dirname(self.itemfile),
)
)
class LinuxItem:
def __init__(self, version, rid, docker_image):
self.url = "https://download.libsodium.org/libsodium/releases/libsodium-{0}.tar.gz".format(
version.libsodium_version
)
self.cachefile = os.path.join(CACHEDIR, re.sub(r"[^A-Za-z0-9.]", "-", self.url))
self.packfile = os.path.join(
version.builddir, "runtimes", rid, "native", LIBRARY + ".so"
)
self.tempdir = os.path.join(version.tempdir, rid)
self.tempfile = os.path.join(self.tempdir, "libsodium.so")
self.docker_image = docker_image
self.recipe = rid
def make(self, f):
recipe = self.recipe
while not os.path.exists(os.path.join("recipes", recipe)):
m = re.fullmatch(r"([^.-]+)((([.][^.-]+)*)[.][^.-]+)?([-].*)?", recipe)
if m.group(5) is None:
recipe = "build"
break
elif m.group(2) is None:
recipe = m.group(1)
else:
recipe = m.group(1) + m.group(3) + m.group(5)
f.write("\n")
f.write("{0}: {1}\n".format(self.packfile, self.tempfile))
f.write("\t@mkdir -p $(dir $@)\n")
f.write("\tcp -f $< $@\n")
f.write("\n")
f.write("{0}: {1}\n".format(self.tempfile, self.cachefile))
f.write("\t@mkdir -p $(dir $@)\n")
f.write(
"\t{0} run --rm ".format(DOCKER)
+ "-v $(abspath recipes):/io/recipes "
+ "-v $(abspath $<):/io/libsodium.tar.gz "
+ "-v $(abspath $(dir $@)):/io/output "
+ "{0} sh -x -e /io/recipes/{1}\n".format(self.docker_image, recipe)
)
class ExtraItem:
def __init__(self, version, filename):
self.url = "https://download.libsodium.org/libsodium/releases/libsodium-{0}.tar.gz".format(
version.libsodium_version
)
self.cachefile = os.path.join(CACHEDIR, re.sub(r"[^A-Za-z0-9.]", "-", self.url))
self.packfile = os.path.join(version.builddir, filename)
self.itemfile = "libsodium-{0}/{1}".format(version.libsodium_version, filename)
self.tempdir = os.path.join(version.tempdir, "extras")
self.tempfile = os.path.join(self.tempdir, os.path.normpath(self.itemfile))
def make(self, f):
f.write("\n")
f.write("{0}: {1}\n".format(self.packfile, self.tempfile))
f.write("\t@mkdir -p $(dir $@)\n")
f.write("\tcp -f $< $@\n")
f.write("\n")
f.write("{0}: {1}\n".format(self.tempfile, self.cachefile))
f.write("\t@mkdir -p $(dir $@)\n")
f.write(
"\tcd {0} && tar xzmf {1} '{2}'\n".format(
self.tempdir,
os.path.relpath(self.cachefile, self.tempdir),
self.itemfile,
)
)
def main(args):
m = (
re.fullmatch(r"((\d+\.\d+\.\d+)(\.\d+)?)(?:-(\w+(?:[_.-]\w+)*))?", args[1])
if len(args) == 2
else None
)
if m is None:
print("Usage:")
print(" python3 prepare.py <version>")
print()
print("Examples:")
print(" python3 prepare.py 1.0.18-preview-01")
print(" python3 prepare.py 1.0.18-preview-02")
print(" python3 prepare.py 1.0.18-preview-03")
print(" python3 prepare.py 1.0.18")
print(" python3 prepare.py 1.0.18.1-preview-01")
print(" python3 prepare.py 1.0.18.1")
print(" python3 prepare.py 1.0.18.2")
return 1
version = Version(m.group(2), m.group(0))
items = (
[WindowsItem(version, rid, platform) for (rid, platform) in WINDOWS]
+ [MacOSItem(version, rid, codename) for (rid, codename) in MACOS]
+ [LinuxItem(version, rid, docker_image) for (rid, docker_image) in LINUX]
+ [ExtraItem(version, filename) for filename in EXTRAS]
)
downloads = {item.cachefile: item.url for item in items}
with open(MAKEFILE, "w") as f:
f.write("all: {0}\n".format(version.pkgfile))
for download in sorted(downloads):
f.write("\n")
f.write("{0}:\n".format(download))
f.write("\t@mkdir -p $(dir $@)\n")
f.write("\tcurl -f#Lo $@ '{0}'\n".format(downloads[download]))
for item in items:
item.make(f)
f.write("\n")
f.write("{0}: {1}\n".format(version.propsfile, PROPSFILE))
f.write("\t@mkdir -p $(dir $@)\n")
f.write("\tcp -f $< $@\n")
f.write("\n")
f.write("{0}: {1}\n".format(version.projfile, version.propsfile))
f.write("\t@mkdir -p $(dir $@)\n")
f.write(
"\techo '"
+ '<Project Sdk="Microsoft.NET.Sdk">'
+ '<Import Project="{0}" />'.format(
os.path.relpath(version.propsfile, os.path.dirname(version.projfile))
)
+ "<PropertyGroup>"
+ "<Version>{0}</Version>".format(version.package_version)
+ "</PropertyGroup>"
+ "</Project>' > $@\n"
)
f.write("\n")
f.write("{0}:".format(version.pkgfile))
f.write(" \\\n\t\t{0}".format(version.projfile))
f.write(" \\\n\t\t{0}".format(version.propsfile))
for item in items:
f.write(" \\\n\t\t{0}".format(item.packfile))
f.write("\n")
f.write("\t@mkdir -p $(dir $@)\n")
f.write(
"\t{0} run --rm ".format(DOCKER)
+ "-v $(abspath recipes):/io/recipes "
+ "-v $(abspath $(dir $<)):/io/input "
+ "-v $(abspath $(dir $@)):/io/output "
+ "{0} sh -x -e /io/recipes/{1} {2}\n".format(
"microsoft/dotnet:2.0-sdk",
"pack",
os.path.relpath(version.projfile, version.builddir),
)
)
f.write("\n")
f.write("test: {0}\n".format(version.pkgfile))
f.write(
"\t{0} run --rm ".format(DOCKER)
+ "-v $(abspath recipes):/io/recipes "
+ "-v $(abspath $(dir $<)):/io/packages "
+ '{0} sh -x -e /io/recipes/{1} "{2}"\n'.format(
"microsoft/dotnet:2.0-sdk", "test", version.package_version
)
)
print(
"prepared",
MAKEFILE,
"to make",
version.pkgfile,
"for libsodium",
version.libsodium_version,
)
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv))

View File

@@ -0,0 +1,3 @@
apk add --update alpine-sdk
. $(dirname $0)/build

View File

@@ -0,0 +1,9 @@
cd ~
tar xzf /io/libsodium.tar.gz
cd libsodium-*
./configure
make
make check
make install
strip --strip-all /usr/local/lib/libsodium.so
cp /usr/local/lib/libsodium.so /io/output

View File

@@ -0,0 +1,3 @@
yum install -y binutils gcc make tar
. $(dirname $0)/build

View File

@@ -0,0 +1,4 @@
apt-get update
apt-get install -y --no-install-recommends build-essential
. $(dirname $0)/build

View File

@@ -0,0 +1,3 @@
dnf install -y binutils gcc make tar
. $(dirname $0)/build

View File

@@ -0,0 +1,4 @@
apt-get update
apt-get install -y --no-install-recommends build-essential
. $(dirname $0)/build

View File

@@ -0,0 +1,3 @@
zypper install -y --no-recommends -n binutils gcc make tar
. $(dirname $0)/build

View File

@@ -0,0 +1,5 @@
cp -r /io/input ~/build
cd ~/build
dotnet restore $1
dotnet pack $1
cp *.nupkg /io/output

View File

@@ -0,0 +1,27 @@
TEST_PROGRAM='using System;
using System.Runtime.InteropServices;
static class Program
{
[DllImport("libsodium")]
static extern int sodium_init();
static int Main()
{
int error = sodium_init();
Console.WriteLine(error == 0
? "ok"
: "error: sodium_init() returned {0}", error);
return error == 0 ? 0 : 1;
}
}
'
dotnet --info
cd ~
dotnet new console --name Test
cd Test
echo "$TEST_PROGRAM" > Program.cs
dotnet add package libsodium --version $1 --source /io/packages
dotnet restore
dotnet run

View File

@@ -0,0 +1,4 @@
apt-get update
apt-get install -y --no-install-recommends build-essential
. $(dirname $0)/build

View File

@@ -0,0 +1,4 @@
*.nupkg
package.nuspec
package.targets
package.xml

View File

@@ -0,0 +1,13 @@
@ECHO OFF
ECHO Started nuget packaging build.
ECHO.
REM https://www.nuget.org/packages/gsl
gsl -q -script:package.gsl package.config
ECHO.
REM https://nuget.codeplex.com/releases
nuget pack package.nuspec -verbosity detailed
ECHO.
ECHO NOTE: Ignore warnings not applicable to native code: "Issue: Assembly outside lib folder."
ECHO.
ECHO Completed nuget packaging build. The package is in the following folder:
CD

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- These values are populated into the package.gsl templates by package.bat. -->
<!-- The target attribute controls path and file name only, id controls package naming. -->
<package id="libsodium_vc120" target="libsodium" version = "1.0.18.0" pathversion="1_0_18_0" platformtoolset="v120" />

View File

@@ -0,0 +1,260 @@
.# Generate NuGet nuspec file (for subsequent packing).
.#
.# This is a code generator built using the iMatix GSL code generation
.# language. See https://github.com/imatix/gsl for details. This script
.# is licensed under MIT/X11.
.#
.echo "Generating package.nuspec from template."
.output "package.nuspec"
<?xml version="1.0" encoding="utf-8"?>
<!--
#################################################################
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY #
#################################################################
-->
<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>$(package.id)</id>
<version>$(package.version)</version>
<title>$(package.id)</title>
<authors>libsodium contributors</authors>
<owners>Eric Voskuil</owners>
<licenseUrl>https://raw.github.com/jedisct1/libsodium/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/jedisct1/libsodium</projectUrl>
<iconUrl>http://upload.wikimedia.org/wikipedia/commons/thumb/7/78/Salt_shaker_on_white_background.jpg/220px-Salt_shaker_on_white_background.jpg</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<developmentDependency>false</developmentDependency>
<description>Sodium is a portable, cross-compilable, installable, packageable fork of NaCl, with a compatible API.</description>
<summary>Portable fork of NaCl, packaged for Visual Studio 2013 (v120) and CTP_Nov2013 compilers.</summary>
<releaseNotes>https://raw.github.com/jedisct1/libsodium/master/ChangeLog</releaseNotes>
<copyright>(c) 2013-2019, Frank Denis (attribution required)</copyright>
<tags>native, NaCl, salt, sodium, libsodium, C++</tags>
<dependencies>
.for dependency
<dependency id="$(id)" version="$(version)" />
.endfor
</dependencies>
<!-- Salt shaker icon by Dubravko Soric :
http://upload.wikimedia.org/wikipedia/commons/thumb/7/78/Salt_shaker_on_white_background.jpg/220px-Salt_shaker_on_white_background.jpg -->
</metadata>
<files>
<!-- include -->
<file src="..\\..\\src\\libsodium\\include\\sodium.h" target="build\\native\\include" />
<file src="..\\..\\src\\libsodium\\include\\sodium\\*.*" target="build\\native\\include\\sodium" />
<!-- targets -->
<file src="package.targets" target="build\\native\\$(package.id).targets" />
<file src="package.xml" target="build\\native\\package.xml" />
<!-- libraries -->
<!-- x86 Dynamic libraries (.dll) -->
<file src="..\\..\\bin\\Win32\\Release\\$(package.platformtoolset)\\dynamic\\$(package.target).dll" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-$(package.pathversion).dll" />
<file src="..\\..\\bin\\Win32\\Debug\\$(package.platformtoolset)\\dynamic\\$(package.target).dll" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-gd-$(package.pathversion).dll" />
<!-- x86 Debugging symbols (.pdb) -->
<!--<file src="..\\..\\bin\\Win32\\Release\\$(package.platformtoolset)\\dynamic\\$(package.target).pdb" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-$(package.pathversion).pdb" />-->
<file src="..\\..\\bin\\Win32\\Debug\\$(package.platformtoolset)\\dynamic\\$(package.target).pdb" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-gd-$(package.pathversion).pdb" />
<!-- x86 Import libraries (.imp.lib) -->
<file src="..\\..\\bin\\Win32\\Release\\$(package.platformtoolset)\\dynamic\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-$(package.pathversion).imp.lib" />
<file src="..\\..\\bin\\Win32\\Debug\\$(package.platformtoolset)\\dynamic\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-gd-$(package.pathversion).imp.lib" />
<!-- x86 Export libraries (.exp) -->
<file src="..\\..\\bin\\Win32\\Release\\$(package.platformtoolset)\\dynamic\\$(package.target).exp" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-$(package.pathversion).exp" />
<file src="..\\..\\bin\\Win32\\Debug\\$(package.platformtoolset)\\dynamic\\$(package.target).exp" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-gd-$(package.pathversion).exp" />
<!-- x86 Static libraries (.lib) -->
<file src="..\\..\\bin\\Win32\\Release\\$(package.platformtoolset)\\static\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-s-$(package.pathversion).lib" />
<file src="..\\..\\bin\\Win32\\Debug\\$(package.platformtoolset)\\static\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-sgd-$(package.pathversion).lib" />
<!-- x86 Static link time code generation libraries (.ltcg.lib) -->
<file src="..\\..\\bin\\Win32\\Release\\$(package.platformtoolset)\\ltcg\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-s-$(package.pathversion).ltcg.lib" />
<file src="..\\..\\bin\\Win32\\Debug\\$(package.platformtoolset)\\ltcg\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x86-$(package.platformtoolset)-mt-sgd-$(package.pathversion).ltcg.lib" />
<!-- x64 Dynamic libraries (.dll) -->
<file src="..\\..\\bin\\x64\\Release\\$(package.platformtoolset)\\dynamic\\$(package.target).dll" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-$(package.pathversion).dll" />
<file src="..\\..\\bin\\x64\\Debug\\$(package.platformtoolset)\\dynamic\\$(package.target).dll" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-gd-$(package.pathversion).dll" />
<!-- x64 Debugging symbols (.pdb) -->
<!--<file src="..\\..\\bin\\x64\\Release\\$(package.platformtoolset)\\dynamic\\$(package.target).pdb" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-$(package.pathversion).pdb" />-->
<file src="..\\..\\bin\\x64\\Debug\\$(package.platformtoolset)\\dynamic\\$(package.target).pdb" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-gd-$(package.pathversion).pdb" />
<!-- x64 Import libraries (.imp.lib) -->
<file src="..\\..\\bin\\x64\\Release\\$(package.platformtoolset)\\dynamic\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-$(package.pathversion).imp.lib" />
<file src="..\\..\\bin\\x64\\Debug\\$(package.platformtoolset)\\dynamic\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-gd-$(package.pathversion).imp.lib" />
<!-- x64 Export libraries (.exp) -->
<file src="..\\..\\bin\\x64\\Release\\$(package.platformtoolset)\\dynamic\\$(package.target).exp" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-$(package.pathversion).exp" />
<file src="..\\..\\bin\\x64\\Debug\\$(package.platformtoolset)\\dynamic\\$(package.target).exp" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-gd-$(package.pathversion).exp" />
<!-- x64 Static libraries (.lib) -->
<file src="..\\..\\bin\\x64\\Release\\$(package.platformtoolset)\\static\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-s-$(package.pathversion).lib" />
<file src="..\\..\\bin\\x64\\Debug\\$(package.platformtoolset)\\static\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-sgd-$(package.pathversion).lib" />
<!-- x64 Static link time code generation libraries (.ltcg.lib) -->
<file src="..\\..\\bin\\x64\\Release\\$(package.platformtoolset)\\ltcg\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-s-$(package.pathversion).ltcg.lib" />
<file src="..\\..\\bin\\x64\\Debug\\$(package.platformtoolset)\\ltcg\\$(package.target).lib" target="build\\native\\bin\\$(package.target)-x64-$(package.platformtoolset)-mt-sgd-$(package.pathversion).ltcg.lib" />
</files>
<!--
#################################################################
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY #
#################################################################
-->
</package>
.echo "Generating package.targets from template."
.output "package.targets"
<?xml version="1.0" encoding="utf-8"?>
<!--
#################################################################
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY #
#################################################################
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- user interface -->
<ItemGroup>
<PropertyPageSchema Include="$\(MSBuildThisFileDirectory)package.xml" />
</ItemGroup>
<!-- general -->
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$\(MSBuildThisFileDirectory)include\\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$\(MSBuildThisFileDirectory)bin\\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$\(Linkage-$(package.target))' == 'static' Or '$\(Linkage-$(package.target))' == 'ltcg'">
<ClCompile>
<PreprocessorDefinitions>SODIUM_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<!-- static libraries -->
<ItemDefinitionGroup Condition="'$\(Platform)' == 'Win32' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'static' And $\(Configuration.IndexOf('Release')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x86-$(package.platformtoolset)-mt-s-$(package.pathversion).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$\(Platform)' == 'Win32' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'static' And $\(Configuration.IndexOf('Debug')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x86-$(package.platformtoolset)-mt-sgd-$(package.pathversion).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$\(Platform)' == 'x64' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'static' And $\(Configuration.IndexOf('Release')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x64-$(package.platformtoolset)-mt-s-$(package.pathversion).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$\(Platform)' == 'x64' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'static' And $\(Configuration.IndexOf('Debug')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x64-$(package.platformtoolset)-mt-sgd-$(package.pathversion).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<!-- static ltcg libraries -->
<ItemDefinitionGroup Condition="'$\(Platform)' == 'Win32' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'ltcg' And $\(Configuration.IndexOf('Release')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x86-$(package.platformtoolset)-mt-s-$(package.pathversion).ltcg.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$\(Platform)' == 'Win32' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'ltcg' And $\(Configuration.IndexOf('Debug')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x86-$(package.platformtoolset)-mt-sgd-$(package.pathversion).ltcg.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$\(Platform)' == 'x64' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'ltcg' And $\(Configuration.IndexOf('Release')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x64-$(package.platformtoolset)-mt-s-$(package.pathversion).ltcg.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$\(Platform)' == 'x64' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'ltcg' And $\(Configuration.IndexOf('Debug')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x64-$(package.platformtoolset)-mt-sgd-$(package.pathversion).ltcg.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<!-- dynamic import libraries -->
<ItemDefinitionGroup Condition="'$\(Platform)' == 'Win32' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'dynamic' And $\(Configuration.IndexOf('Release')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x86-$(package.platformtoolset)-mt-$(package.pathversion).imp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$\(Platform)' == 'Win32' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'dynamic' And $\(Configuration.IndexOf('Debug')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x86-$(package.platformtoolset)-mt-gd-$(package.pathversion).imp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$\(Platform)' == 'x64' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'dynamic' And $\(Configuration.IndexOf('Release')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x64-$(package.platformtoolset)-mt-$(package.pathversion).imp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$\(Platform)' == 'x64' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'dynamic' And $\(Configuration.IndexOf('Debug')) != -1">
<Link>
<AdditionalDependencies>$(package.target)-x64-$(package.platformtoolset)-mt-gd-$(package.pathversion).imp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<!-- dynamic libraries with debug symbols -->
<Target Name="$(package.target)_AfterBuild" AfterTargets="AfterBuild" />
<Target Name="$(package.target)_AfterBuild_Win32_$(package.platformtoolset)_Dynamic_Release"
Condition="'$\(Platform)' == 'Win32' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'dynamic' And $\(Configuration.IndexOf('Release')) != -1"
AfterTargets="$(package.target)_AfterBuild">
<Copy SourceFiles="$\(MSBuildThisFileDirectory)bin\\$(package.target)-x86-$(package.platformtoolset)-mt-$(package.pathversion).dll" DestinationFiles="$\(TargetDir)$(package.target).dll" SkipUnchangedFiles="true" />
<!--<Copy SourceFiles="$\(MSBuildThisFileDirectory)bin\\$(package.target)-x86-$(package.platformtoolset)-mt-$(package.pathversion).pdb" DestinationFiles="$\(TargetDir)$(package.target).pdb" SkipUnchangedFiles="true" />-->
</Target>
<Target Name="$(package.target)_AfterBuild_Win32_$(package.platformtoolset)_Dynamic_Debug"
Condition="'$\(Platform)' == 'Win32' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'dynamic' And $\(Configuration.IndexOf('Debug')) != -1"
AfterTargets="$(package.target)_AfterBuild">
<Copy SourceFiles="$\(MSBuildThisFileDirectory)bin\\$(package.target)-x86-$(package.platformtoolset)-mt-gd-$(package.pathversion).dll" DestinationFiles="$\(TargetDir)$(package.target).dll" SkipUnchangedFiles="true" />
<Copy SourceFiles="$\(MSBuildThisFileDirectory)bin\\$(package.target)-x86-$(package.platformtoolset)-mt-gd-$(package.pathversion).pdb" DestinationFiles="$\(TargetDir)$(package.target).pdb" SkipUnchangedFiles="true" />
</Target>
<Target Name="$(package.target)_AfterBuild_x64_$(package.platformtoolset)_Dynamic_Release"
Condition="'$\(Platform)' == 'x64' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'dynamic' And $\(Configuration.IndexOf('Release')) != -1"
AfterTargets="$(package.target)_AfterBuild">
<Copy SourceFiles="$\(MSBuildThisFileDirectory)bin\\$(package.target)-x64-$(package.platformtoolset)-mt-$(package.pathversion).dll" DestinationFiles="$\(TargetDir)$(package.target).dll" SkipUnchangedFiles="true" />
<!--<Copy SourceFiles="$\(MSBuildThisFileDirectory)bin\\$(package.target)-x64-$(package.platformtoolset)-mt-$(package.pathversion).pdb" DestinationFiles="$\(TargetDir)$(package.target).pdb" SkipUnchangedFiles="true" />-->
</Target>
<Target Name="$(package.target)_AfterBuild_x64_$(package.platformtoolset)_Dynamic_Debug"
Condition="'$\(Platform)' == 'x64' And ('$\(PlatformToolset)' == '$(package.platformtoolset)' Or '$\(PlatformToolset)' == 'CTP_Nov2013') And '$\(Linkage-$(package.target))' == 'dynamic' And $\(Configuration.IndexOf('Debug')) != -1"
AfterTargets="$(package.target)_AfterBuild">
<Copy SourceFiles="$\(MSBuildThisFileDirectory)bin\\$(package.target)-x64-$(package.platformtoolset)-mt-gd-$(package.pathversion).dll" DestinationFiles="$\(TargetDir)$(package.target).dll" SkipUnchangedFiles="true" />
<Copy SourceFiles="$\(MSBuildThisFileDirectory)bin\\$(package.target)-x64-$(package.platformtoolset)-mt-gd-$(package.pathversion).pdb" DestinationFiles="$\(TargetDir)$(package.target).pdb" SkipUnchangedFiles="true" />
</Target>
<!--
#################################################################
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY #
#################################################################
-->
</Project>
.echo "Generating package.xml (ui extension) from template."
.output "package.xml"
<?xml version="1.0" encoding="utf-8"?>
<!--
#################################################################
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY #
#################################################################
-->
<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework">
<Rule Name="Linkage-$(package.target)-uiextension" PageTemplate="tool" DisplayName="NuGet Dependencies" SwitchPrefix="/" Order="1">
<Rule.Categories>
<Category Name="$(package.target)" DisplayName="$(package.target)" />
</Rule.Categories>
<Rule.DataSource>
<DataSource Persistence="ProjectFile" ItemType="" />
</Rule.DataSource>
<EnumProperty Name="Linkage-$(package.target)" DisplayName="Linkage" Description="How NuGet $(package.target) will be linked into the output of this project" Category="$(package.target)">
<EnumValue Name="" DisplayName="Not linked" />
<EnumValue Name="dynamic" DisplayName="Dynamic (DLL)" />
<EnumValue Name="static" DisplayName="Static (LIB)" />
<EnumValue Name="ltcg" DisplayName="Static using link time compile generation (LTCG)" />
</EnumProperty>
</Rule>
</ProjectSchemaDefinitions>