File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,11 +9,12 @@ public sealed class BuildLinuxTask : FrostingTask<BuildContext>
99
1010 public override void Run ( BuildContext context )
1111 {
12+ Architecture arch = RuntimeInformation . OSArchitecture ;
1213 // Absolute path to the artifact directory is needed for flags since they don't allow relative path
1314 var artifactDir = context . MakeAbsolute ( new DirectoryPath ( context . ArtifactsDir ) ) ;
14- var dependencyDir = context . MakeAbsolute ( new DirectoryPath ( $ "{ context . ArtifactsDir } /../dependencies-linux-x64") ) ;
15+ var dependencyDir = context . MakeAbsolute ( new DirectoryPath ( $ "{ context . ArtifactsDir } /../dependencies-linux-{ ( arch == Architecture . Arm64 ? "arm64" : " x64" ) } ") ) ;
1516 var prefixFlag = $ "--prefix=\" { dependencyDir } \" ";
16- var hostFlag = "--host=\" x86_64-linux-gnu\" " ;
17+ var hostFlag = arch == Architecture . Arm64 ? "--host= \" aarch64-linux-gnu \" " : "--host=\" x86_64-linux-gnu\" " ;
1718 var binDirFlag = $ "--bindir=\" { artifactDir } \" ";
1819
1920 var envVariables = new Dictionary < string , string >
@@ -83,7 +84,8 @@ private static string GetFFMpegConfigureFlags(BuildContext context)
8384 {
8485 var ignoreCommentsAndNewLines = ( string line ) => ! string . IsNullOrWhiteSpace ( line ) && ! line . StartsWith ( '#' ) ;
8586 var configureFlags = context . FileReadLines ( "ffmpeg.config" ) . Where ( ignoreCommentsAndNewLines ) ;
86- var osConfigureFlags = context . FileReadLines ( $ "ffmpeg.linux-x64.config") . Where ( ignoreCommentsAndNewLines ) ;
87+ var osConfigFile = arch == Architecture . Arm64 ? "ffmpeg.linux-arm64.config" : "ffmpeg.linux-x64.config" ;
88+ var osConfigureFlags = context . FileReadLines ( osConfigFile ) . Where ( ignoreCommentsAndNewLines ) ;
8789 return string . Join ( ' ' , configureFlags ) + " " + string . Join ( ' ' , osConfigureFlags ) ;
8890 }
8991}
You can’t perform that action at this time.
0 commit comments