mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-04 19:31:56 +00:00
[Build-System] Windows: Download 7z, icsharpcode/SharpZipLib from GitHub instead of files.freeswitch.org during the build.
This commit is contained in:
@@ -172,6 +172,11 @@ BuildLog.htm
|
|||||||
|
|
||||||
!/libs/win32/
|
!/libs/win32/
|
||||||
!/libs/speex/win32/
|
!/libs/speex/win32/
|
||||||
|
|
||||||
|
# 7-Zip extraction tool bootstrap (downloaded/extracted by w32/downloadpackage.task)
|
||||||
|
/libs/win32/7za/
|
||||||
|
/libs/win32/7z*-extra.7z
|
||||||
|
|
||||||
*.suo
|
*.suo
|
||||||
*.sdf
|
*.sdf
|
||||||
x64/
|
x64/
|
||||||
@@ -245,6 +250,8 @@ libs/libcodec2-*/
|
|||||||
libs/libsilk-*/
|
libs/libsilk-*/
|
||||||
libs/rabbitmq-c-*/
|
libs/rabbitmq-c-*/
|
||||||
libs/rabbitmq-c-*.zip
|
libs/rabbitmq-c-*.zip
|
||||||
|
libs/SharpZipLib.*/
|
||||||
|
libs/SharpZipLib.*.nupkg
|
||||||
libs/ffmpeg-*/
|
libs/ffmpeg-*/
|
||||||
libs/sofia-sip*/
|
libs/sofia-sip*/
|
||||||
libs/sofia-sip*
|
libs/sofia-sip*
|
||||||
|
|||||||
@@ -7,6 +7,12 @@
|
|||||||
<downloadSharpZipLibPropsImported>true</downloadSharpZipLibPropsImported>
|
<downloadSharpZipLibPropsImported>true</downloadSharpZipLibPropsImported>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<SharpZipLibVersion Condition=" '$(SharpZipLibVersion)' == '' ">1.1.0</SharpZipLibVersion>
|
||||||
|
<SharpZipLibDir>$(BaseDir)libs\SharpZipLib.$(SharpZipLibVersion)</SharpZipLibDir>
|
||||||
|
<SharpZipLibCADir>$(BaseDir)w32\Setup\CustomActions\Setup.CA.DownloadOpenH264</SharpZipLibCADir>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Download Target.
|
Download Target.
|
||||||
Name must be unique.
|
Name must be unique.
|
||||||
@@ -32,13 +38,18 @@
|
|||||||
|
|
||||||
<Target Name="SharpZipLibDownloadTarget" BeforeTargets="Build" DependsOnTargets="7za">
|
<Target Name="SharpZipLibDownloadTarget" BeforeTargets="Build" DependsOnTargets="7za">
|
||||||
<DownloadPackageTask
|
<DownloadPackageTask
|
||||||
package="http://files.freeswitch.org/downloads/libs/ICSharpCode.SharpZipLib.dll.bz2"
|
package="https://github.com/icsharpcode/SharpZipLib/releases/download/v$(SharpZipLibVersion)/SharpZipLib.$(SharpZipLibVersion).nupkg"
|
||||||
expectfileordirectory="$(BaseDir)w32\Setup\CustomActions\Setup.CA.DownloadOpenH264\ICSharpCode.SharpZipLib.dll"
|
expectfileordirectory="$(SharpZipLibCADir)\ICSharpCode.SharpZipLib.dll"
|
||||||
outputfolder=""
|
outputfolder="$(BaseDir)libs\"
|
||||||
outputfilename=""
|
outputfilename="SharpZipLib.$(SharpZipLibVersion).nupkg"
|
||||||
extractto="$(BaseDir)w32\Setup\CustomActions\Setup.CA.DownloadOpenH264\"
|
extractto="$(SharpZipLibDir)"
|
||||||
archivecontains="binary"
|
archivecontains="binary"
|
||||||
/>
|
/>
|
||||||
|
<!-- Place the net45 build where the custom action's <HintPath> expects it. -->
|
||||||
|
<Copy Condition="!Exists('$(SharpZipLibCADir)\ICSharpCode.SharpZipLib.dll')"
|
||||||
|
SourceFiles="$(SharpZipLibDir)\lib\net45\ICSharpCode.SharpZipLib.dll"
|
||||||
|
DestinationFiles="$(SharpZipLibCADir)\ICSharpCode.SharpZipLib.dll"
|
||||||
|
/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+38
-13
@@ -15,7 +15,8 @@
|
|||||||
<extractto />
|
<extractto />
|
||||||
<moveafter />
|
<moveafter />
|
||||||
<archivecontains />
|
<archivecontains />
|
||||||
</ParameterGroup>
|
<arctool />
|
||||||
|
</ParameterGroup>
|
||||||
<Task>
|
<Task>
|
||||||
<Reference Include="Microsoft.Build" />
|
<Reference Include="Microsoft.Build" />
|
||||||
<Reference Include="Microsoft.Build.Framework" />
|
<Reference Include="Microsoft.Build.Framework" />
|
||||||
@@ -57,6 +58,7 @@ using System.Diagnostics;
|
|||||||
public string extractto { get; set; }
|
public string extractto { get; set; }
|
||||||
public string moveafter { get; set; }
|
public string moveafter { get; set; }
|
||||||
public string archivecontains { get; set; }
|
public string archivecontains { get; set; }
|
||||||
|
public string arctool { get; set; }
|
||||||
|
|
||||||
internal static bool FileOrDirectoryExists(string name)
|
internal static bool FileOrDirectoryExists(string name)
|
||||||
{
|
{
|
||||||
@@ -193,26 +195,31 @@ using System.Diagnostics;
|
|||||||
|
|
||||||
private void Extract(string filename, string extracttofolder)
|
private void Extract(string filename, string extracttofolder)
|
||||||
{
|
{
|
||||||
string arctool = Path.Combine(new string[] { basedir, "libs", "win32", "7za1701.exe" });
|
// Use the caller-supplied extraction tool when set (the 7za bootstrap
|
||||||
|
// passes 7zr.exe to unpack the full 7za.exe out of the "extra" package);
|
||||||
|
// otherwise fall back to that bootstrapped 7za.exe for every other package.
|
||||||
|
string tool = (arctool != null && arctool.Trim() != "")
|
||||||
|
? arctool
|
||||||
|
: Path.Combine(new string[] { basedir, "libs", "win32", "7za", "7za.exe" });
|
||||||
string args = " x \"" + filename + "\" -y -o\"" + extracttofolder + "\"";
|
string args = " x \"" + filename + "\" -y -o\"" + extracttofolder + "\"";
|
||||||
|
|
||||||
Log.LogMessage(MessageImportance.High,
|
Log.LogMessage(MessageImportance.High,
|
||||||
"arctool : " + arctool);
|
"arctool : " + tool);
|
||||||
Log.LogMessage(MessageImportance.High,
|
Log.LogMessage(MessageImportance.High,
|
||||||
"args : " + args);
|
"args : " + args);
|
||||||
Log.LogMessage(MessageImportance.High,
|
Log.LogMessage(MessageImportance.High,
|
||||||
"WorkingDirectory : " + Path.GetDirectoryName(arctool));
|
"WorkingDirectory : " + Path.GetDirectoryName(tool));
|
||||||
|
|
||||||
var proc = new Process
|
var proc = new Process
|
||||||
{
|
{
|
||||||
StartInfo = new ProcessStartInfo
|
StartInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = arctool,
|
FileName = tool,
|
||||||
Arguments = args,
|
Arguments = args,
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
||||||
CreateNoWindow = true,
|
CreateNoWindow = true,
|
||||||
WorkingDirectory = Path.GetDirectoryName(arctool)
|
WorkingDirectory = Path.GetDirectoryName(tool)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -274,15 +281,33 @@ using System.Diagnostics;
|
|||||||
</Task>
|
</Task>
|
||||||
</UsingTask>
|
</UsingTask>
|
||||||
|
|
||||||
<Target Name="7za" BeforeTargets="Build">
|
<PropertyGroup>
|
||||||
<DownloadPackageTask
|
<SevenZipVersion Condition=" '$(SevenZipVersion)' == '' ">26.02</SevenZipVersion>
|
||||||
package="http://files.freeswitch.org/downloads/win32/7za1701.exe"
|
<SevenZipBaseUrl Condition=" '$(SevenZipBaseUrl)' == '' ">https://github.com/ip7z/7zip/releases/download/$(SevenZipVersion)</SevenZipBaseUrl>
|
||||||
expectfileordirectory="$(BaseDir)libs/win32/7za1701.exe"
|
<SevenZipExtra Condition=" '$(SevenZipExtra)' == '' ">7z$(SevenZipVersion.Replace('.',''))-extra</SevenZipExtra>
|
||||||
outputfolder="$(BaseDir)libs/win32/"
|
</PropertyGroup>
|
||||||
outputfilename="7za1701.exe"
|
|
||||||
|
<Target Name="7za" BeforeTargets="Build">
|
||||||
|
<!-- Step 1: download 7zr.exe. As an .exe it is stored as-is, not extracted. -->
|
||||||
|
<DownloadPackageTask
|
||||||
|
package="$(SevenZipBaseUrl)/7zr.exe"
|
||||||
|
expectfileordirectory="$(BaseDir)libs/win32/7zr.exe"
|
||||||
|
outputfolder="$(BaseDir)libs/win32/"
|
||||||
|
outputfilename="7zr.exe"
|
||||||
extractto=""
|
extractto=""
|
||||||
/>
|
/>
|
||||||
</Target>
|
<!-- Step 2: download the extra package and unpack the full 7za.exe from it
|
||||||
|
with 7zr.exe (the default 7za.exe does not exist yet at this point). -->
|
||||||
|
<DownloadPackageTask
|
||||||
|
package="$(SevenZipBaseUrl)/$(SevenZipExtra).7z"
|
||||||
|
expectfileordirectory="$(BaseDir)libs/win32/7za/7za.exe"
|
||||||
|
outputfolder="$(BaseDir)libs/win32/"
|
||||||
|
outputfilename="$(SevenZipExtra).7z"
|
||||||
|
extractto="$(BaseDir)libs/win32/7za"
|
||||||
|
archivecontains="binary"
|
||||||
|
arctool="$(BaseDir)libs/win32/7zr.exe"
|
||||||
|
/>
|
||||||
|
</Target>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<downloadpackagetask_Imported>true</downloadpackagetask_Imported>
|
<downloadpackagetask_Imported>true</downloadpackagetask_Imported>
|
||||||
|
|||||||
Reference in New Issue
Block a user