*
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
[submodule "Dependencies/Actions.Library"]
|
[submodule "Dependencies/Actions.Library"]
|
||||||
path = Dependencies/Actions.Library
|
path = Dependencies/Actions.Library
|
||||||
url = https://github.com/L-proger/Actions.Library.git
|
url = https://github.com/L-proger/Actions.Library.git
|
||||||
|
[submodule "Dependencies/subversion"]
|
||||||
|
path = Dependencies/subversion
|
||||||
|
url = https://github.com/apache/subversion.git
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace Build {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<string> GetSubversion(string projectRootDir) {
|
public static async Task<string> GetSubversion(string projectRootDir) {
|
||||||
return Path.GetFullPath(Path.Combine(projectRootDir, "..", "subversion"));
|
return Path.GetFullPath(Path.Combine(projectRootDir, "Dependencies", "subversion"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+32
-8
@@ -56,7 +56,7 @@ class Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void BuildApr(string source, string installDir) {
|
static string BuildApr(string source, string installDir) {
|
||||||
var tmpDir = TempDirectory.New();
|
var tmpDir = TempDirectory.New();
|
||||||
|
|
||||||
var cmake = Find.Executable("cmake");
|
var cmake = Find.Executable("cmake");
|
||||||
@@ -66,6 +66,7 @@ class Application {
|
|||||||
var configResult = cmake.Run($"-DCMAKE_INSTALL_PREFIX={installPrefix} -G \"Ninja\" -DAPR_INSTALL_PRIVATE_H=ON -DCMAKE_BUILD_TYPE=RELEASE -DAPR_BUILD_STATIC=ON {source}", tmpDir);
|
var configResult = cmake.Run($"-DCMAKE_INSTALL_PREFIX={installPrefix} -G \"Ninja\" -DAPR_INSTALL_PRIVATE_H=ON -DCMAKE_BUILD_TYPE=RELEASE -DAPR_BUILD_STATIC=ON {source}", tmpDir);
|
||||||
var buildResult = ninja.Run("", tmpDir);
|
var buildResult = ninja.Run("", tmpDir);
|
||||||
var installResult = ninja.Run("install", tmpDir);
|
var installResult = ninja.Run("install", tmpDir);
|
||||||
|
return installPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void BuildAprUtil(string source, string expatLibDir, string installDir) {
|
static void BuildAprUtil(string source, string expatLibDir, string installDir) {
|
||||||
@@ -123,14 +124,26 @@ class Application {
|
|||||||
File.WriteAllText(sconstructPath, text);
|
File.WriteAllText(sconstructPath, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void BuildSubversion(string svnSource, string sqlSource, string installDir) {
|
static void CopyLibraries(string srcBinlDir, string svnInstallDir) {
|
||||||
|
string svnBinDir = Path.Combine(svnInstallDir, "bin");
|
||||||
|
|
||||||
|
string[] srcFiles = Directory.GetFiles(srcBinlDir).Where(x=>x.EndsWith(".dll")).ToArray();
|
||||||
|
foreach(var file in srcFiles) {
|
||||||
|
var fileName = Path.GetFileName(file);
|
||||||
|
var dstPath = Path.Combine(svnBinDir, fileName);
|
||||||
|
File.Copy(file, dstPath, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static string BuildSubversion(string svnSource, string sqlSource, string installDir, string expatDir) {
|
||||||
var aprPath = Path.Combine(installDir, "apr").Replace("\\", "/");
|
var aprPath = Path.Combine(installDir, "apr").Replace("\\", "/");
|
||||||
var serfPath = Path.Combine(installDir, "serf").Replace("\\", "/");
|
var serfPath = Path.Combine(installDir, "serf").Replace("\\", "/");
|
||||||
var zlibPath = Path.Combine(installDir, "zlib").Replace("\\", "/");
|
var zlibPath = Path.Combine(installDir, "zlib").Replace("\\", "/");
|
||||||
var opensslPath = Path.Combine(installDir, "openssl").Replace("\\", "/");
|
var opensslPath = Path.Combine(installDir, "openssl").Replace("\\", "/");
|
||||||
string libPaths = $"{aprPath};{serfPath};{zlibPath}";
|
string libPaths = $"{aprPath};{serfPath};{zlibPath}";
|
||||||
string expatBinDir = "e:/SvnDeps/expat/Bin";
|
string expatBinDir = Path.Combine(expatDir,"Bin");
|
||||||
string expatIncDir = "e:/SvnDeps/expat/Source/lib";
|
string expatIncDir = Path.Combine(expatDir, "Source/lib");
|
||||||
string installPrefix = Path.Combine(installDir, "subversion");
|
string installPrefix = Path.Combine(installDir, "subversion");
|
||||||
|
|
||||||
List<string> args = new List<string>();
|
List<string> args = new List<string>();
|
||||||
@@ -160,15 +173,20 @@ class Application {
|
|||||||
|
|
||||||
var buildResult = ninja.Run("", tmpDir);
|
var buildResult = ninja.Run("", tmpDir);
|
||||||
var installResult = ninja.Run("install", tmpDir);
|
var installResult = ninja.Run("install", tmpDir);
|
||||||
|
|
||||||
|
return installPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<int> Main() {
|
public static async Task<int> Main() {
|
||||||
VisualStudio.SetupEnvironment(CpuArchitecture.x64);
|
VisualStudio.SetupEnvironment(CpuArchitecture.x64);
|
||||||
|
|
||||||
var projectRootDir = GetProjectRootDir();
|
var projectRootDir = GetProjectRootDir();
|
||||||
var depsSourceDirectory = Path.Combine(projectRootDir, "DependenciesSource");
|
|
||||||
|
|
||||||
|
var depsSourceDirectory = Path.Combine(projectRootDir, "Downloads");
|
||||||
Directory.CreateDirectory(depsSourceDirectory);
|
Directory.CreateDirectory(depsSourceDirectory);
|
||||||
var depsBuildDirectory = Path.Combine(projectRootDir, "DependenciesBuild");
|
var tempDir = TempDirectory.New();
|
||||||
|
var depsBuildDirectory = Path.Combine(tempDir, "DependenciesBuild");
|
||||||
Directory.CreateDirectory(depsBuildDirectory);
|
Directory.CreateDirectory(depsBuildDirectory);
|
||||||
|
|
||||||
var svn = await Dependencies.GetSubversion(projectRootDir);
|
var svn = await Dependencies.GetSubversion(projectRootDir);
|
||||||
@@ -182,12 +200,18 @@ class Application {
|
|||||||
|
|
||||||
BuildOpenssl(openssl, depsBuildDirectory);
|
BuildOpenssl(openssl, depsBuildDirectory);
|
||||||
BuildZLib(zLib, depsBuildDirectory);
|
BuildZLib(zLib, depsBuildDirectory);
|
||||||
BuildApr(apr, depsBuildDirectory);
|
var aprInstallDir = BuildApr(apr, depsBuildDirectory);
|
||||||
BuildAprUtil(aprUtil, expat, depsBuildDirectory);
|
BuildAprUtil(aprUtil, expat, depsBuildDirectory);
|
||||||
FixAprForSerf(depsBuildDirectory);
|
FixAprForSerf(depsBuildDirectory);
|
||||||
PatchSerf(serf);
|
PatchSerf(serf);
|
||||||
BuildSerf(serf, depsBuildDirectory);
|
BuildSerf(serf, depsBuildDirectory);
|
||||||
BuildSubversion(svn, sqLite, depsBuildDirectory);
|
var svnInstallDir = BuildSubversion(svn, sqLite, tempDir, expat);
|
||||||
|
|
||||||
|
CopyLibraries(Path.Combine(aprInstallDir, "bin"), svnInstallDir);
|
||||||
|
CopyLibraries(Path.Combine(expat, "Bin"), svnInstallDir);
|
||||||
|
CopyLibraries(Path.Combine(openssl, "bin"), svnInstallDir);
|
||||||
|
|
||||||
|
Console.WriteLine($"SVN install directory: {svnInstallDir}");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
Submodule Dependencies/subversion added at 37969e10a5
@@ -1,155 +0,0 @@
|
|||||||
|
|
||||||
$APR_VERSION="1.7.5"
|
|
||||||
$APU_VERSION="1.6.3"
|
|
||||||
$PY3C_VERSION="1.1"
|
|
||||||
$SERF_VERSION="1.3.10"
|
|
||||||
$ZLIB_VERSION="1.2.8"
|
|
||||||
$SQLITE_VERSION="3.39.4"
|
|
||||||
|
|
||||||
# Used to construct the SQLite download URL.
|
|
||||||
$SQLITE_VERSION_REL_YEAR=2022
|
|
||||||
$HTTPD_VERSION="2.4.10"
|
|
||||||
$APR_ICONV_VERSION="1.2.1"
|
|
||||||
|
|
||||||
$APR="apr-$APR_VERSION"
|
|
||||||
$APR_UTIL="apr-util-$APU_VERSION"
|
|
||||||
$PY3C="py3c-$PY3C_VERSION"
|
|
||||||
$SERF="serf-$SERF_VERSION"
|
|
||||||
$ZLIB="zlib-$ZLIB_VERSION"
|
|
||||||
|
|
||||||
|
|
||||||
$SQLITE_VERSION_LIST= $SQLITE_VERSION.Split(".")
|
|
||||||
$SQLITE=[string]::Format("sqlite-amalgamation-{0}{1}{2}00", $SQLITE_VERSION_LIST[0], $SQLITE_VERSION_LIST[1].PadLeft(2, '0'), $SQLITE_VERSION_LIST[2].PadLeft(2, '0'))
|
|
||||||
|
|
||||||
|
|
||||||
$BASEDIR=$PSScriptRoot
|
|
||||||
$TEMPDIR="$BASEDIR/temp"
|
|
||||||
$APACHE_MIRROR="https://archive.apache.org/dist"
|
|
||||||
|
|
||||||
New-Item -ItemType Directory -Force -Path "$TEMPDIR"
|
|
||||||
|
|
||||||
function DownloadFile {
|
|
||||||
param ( $Src, $Dst )
|
|
||||||
if(-Not (Test-Path "$Dst" -PathType Leaf)){
|
|
||||||
Invoke-WebRequest "$Src" -OutFile "$Dst"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function extractTarBz2{
|
|
||||||
param ( $Src )
|
|
||||||
7z x -y "$Src"
|
|
||||||
|
|
||||||
$srcFile = Get-ChildItem "$Src"
|
|
||||||
$tarFile = $srcFile.BaseName
|
|
||||||
Write-Host "TAR file name: $tarFile"
|
|
||||||
7z x -y "$tarFile"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function extractTarGzip{
|
|
||||||
param ( $Src )
|
|
||||||
7z x -tgzip -y "$Src"
|
|
||||||
|
|
||||||
$srcFile = Get-ChildItem "$Src"
|
|
||||||
$tarFile = $srcFile.BaseName
|
|
||||||
Write-Host "TAR file name: $tarFile"
|
|
||||||
7z x -y "$tarFile"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function moveDir{
|
|
||||||
param ( $Src, $Dst )
|
|
||||||
if (Test-Path -LiteralPath $Dst) {
|
|
||||||
Remove-Item -LiteralPath $Dst -Recurse
|
|
||||||
}
|
|
||||||
Move-Item -Path $Src -Destination "$Dst" -force
|
|
||||||
}
|
|
||||||
|
|
||||||
function getApr {
|
|
||||||
Set-Location $TEMPDIR
|
|
||||||
|
|
||||||
DownloadFile -Src "$APACHE_MIRROR/apr/$APR.tar.bz2" -Dst "$APR.tar.bz2"
|
|
||||||
extractTarBz2 -Src "$APR.tar.bz2"
|
|
||||||
moveDir -Src $APR -Dst "$BASEDIR/apr"
|
|
||||||
|
|
||||||
DownloadFile -Src "$APACHE_MIRROR/apr/$APR_UTIL.tar.bz2" -Dst "$APR_UTIL.tar.bz2"
|
|
||||||
extractTarBz2 -Src "$APR_UTIL.tar.bz2"
|
|
||||||
moveDir -Src $APR_UTIL -Dst "$BASEDIR/apr-util"
|
|
||||||
|
|
||||||
Set-Location $BASEDIR
|
|
||||||
}
|
|
||||||
|
|
||||||
function getZlib() {
|
|
||||||
Set-Location $TEMPDIR
|
|
||||||
DownloadFile -Src "https://github.com/madler/zlib/archive/refs/tags/v$ZLIB_VERSION.tar.gz" -Dst "$ZLIB.tar.gz"
|
|
||||||
extractTarGzip -Src "$ZLIB.tar.gz"
|
|
||||||
|
|
||||||
moveDir -Src $ZLIB -Dst "$BASEDIR/zlib"
|
|
||||||
Set-Location $BASEDIR
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSqlite() {
|
|
||||||
Set-Location $TEMPDIR
|
|
||||||
Write-Host "!!!! https://www.sqlite.org/$SQLITE_VERSION_REL_YEAR/$SQLITE.zip"
|
|
||||||
DownloadFile -Src "https://www.sqlite.org/$SQLITE_VERSION_REL_YEAR/$SQLITE.zip" -Dst "$SQLITE.zip"
|
|
||||||
Expand-Archive "$SQLITE.zip" -Force -DestinationPath "./"
|
|
||||||
moveDir -Src $SQLITE -Dst "$BASEDIR/sqlite-amalgamation"
|
|
||||||
Set-Location $BASEDIR
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSerf() {
|
|
||||||
Set-Location $TEMPDIR
|
|
||||||
DownloadFile -Src "https://archive.apache.org/dist/serf/$SERF.tar.bz2" -Dst "$SERF.tar.bz2"
|
|
||||||
extractTarBz2 -Src "$SERF.tar.bz2"
|
|
||||||
moveDir -Src $SERF -Dst "$BASEDIR/serf"
|
|
||||||
Set-Location $BASEDIR
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function getExpat() {
|
|
||||||
Set-Location $TEMPDIR
|
|
||||||
DownloadFile -Src "https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.bz2" -Dst "expat-2.2.9.tar.bz2"
|
|
||||||
extractTarBz2 -Src "expat-2.2.9.tar.bz2"
|
|
||||||
moveDir -Src "expat-2.2.9" -Dst "$BASEDIR/expat"
|
|
||||||
Set-Location $BASEDIR
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function getOpenssl() {
|
|
||||||
Set-Location $TEMPDIR
|
|
||||||
DownloadFile -Src "https://github.com/openssl/openssl/releases/download/openssl-3.2.3/openssl-3.2.3.tar.gz" -Dst "openssl-3.2.3.tar.gz"
|
|
||||||
extractTarGzip -Src "openssl-3.2.3.tar.gz"
|
|
||||||
moveDir -Src "openssl-3.2.3" -Dst "$BASEDIR/openssl"
|
|
||||||
Set-Location $BASEDIR
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# function getPy3C
|
|
||||||
# {
|
|
||||||
# $py3cdist="v${PY3C_VERSION}.tar.gz"
|
|
||||||
# Set-Location $TEMPDIR
|
|
||||||
# DownloadFile -Src "https://github.com/encukou/py3c/archive/$py3cdist" -Dst "$py3cdist"
|
|
||||||
|
|
||||||
# extractTarBz2 -Src "$py3cdist"
|
|
||||||
# moveDir -Src $PY3C -Dst "$BASEDIR/py3c"
|
|
||||||
|
|
||||||
# Set-Location $BASEDIR
|
|
||||||
# }
|
|
||||||
|
|
||||||
#getOpenssl
|
|
||||||
#getExpat
|
|
||||||
#getSqlite
|
|
||||||
#getZlib
|
|
||||||
getApr
|
|
||||||
getSerf
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#getPy3C
|
|
||||||
|
|
||||||
|
|
||||||
Remove-Item -LiteralPath $TEMPDIR -Recurse
|
|
||||||
Write-Host "Done!"
|
|
||||||
@@ -10,6 +10,13 @@ sudo make install
|
|||||||
```
|
```
|
||||||
# Windows build
|
# Windows build
|
||||||
|
|
||||||
|
## Install programs
|
||||||
|
1. Install Python3: https://www.python.org/downloads/
|
||||||
|
2. Install scons: `pip install scons`
|
||||||
|
3. Install (for OpenSSL): https://strawberryperl.com/
|
||||||
|
4. Install (for OpenSSL): https://www.nasm.us/ https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/win64/nasm-2.16.03-installer-x64.exe
|
||||||
|
|
||||||
|
|
||||||
## Download expat
|
## Download expat
|
||||||
```
|
```
|
||||||
https://sourceforge.net/projects/expat/files/expat_win64/2.6.4/expat-win64bin-2.6.4.exe/download
|
https://sourceforge.net/projects/expat/files/expat_win64/2.6.4/expat-win64bin-2.6.4.exe/download
|
||||||
@@ -37,8 +44,6 @@ cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX=e:/SvnDeps/zlib -DCMAKE_BUILD_TYPE=RELEA
|
|||||||
|
|
||||||
## Build Openssl
|
## Build Openssl
|
||||||
```
|
```
|
||||||
Install https://strawberryperl.com/
|
|
||||||
Install https://www.nasm.us/ https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/win64/nasm-2.16.03-installer-x64.exe
|
|
||||||
perl Configure VC-WIN64A --prefix=e:/SvnDeps/openssl --openssldir=e:/SvnDeps/openssl
|
perl Configure VC-WIN64A --prefix=e:/SvnDeps/openssl --openssldir=e:/SvnDeps/openssl
|
||||||
nmake
|
nmake
|
||||||
nmake install
|
nmake install
|
||||||
|
|||||||
Reference in New Issue
Block a user