diff --git a/public/gitrevision.txt b/public/gitrevision.txt index 39d48718..e65bd615 100644 --- a/public/gitrevision.txt +++ b/public/gitrevision.txt @@ -1 +1 @@ -[master]crosslibs_all-2786(5ebd61f) +[master]crosslibs_all-2787(3cb7fd8) diff --git a/sources/installercore.pas b/sources/installercore.pas index 79d3ff59..f75cb923 100644 --- a/sources/installercore.pas +++ b/sources/installercore.pas @@ -224,6 +224,9 @@ interface DIFFMAGIC = 'revhash_'; + NEWLIBSTAG = 'crosslibs_all'; + OLDLIBSTAG = 'crosslibs'; + //Sequence contants for statemachine _SEP = ';'; diff --git a/sources/installermanager.pas b/sources/installermanager.pas index dc29099a..7a5394be 100644 --- a/sources/installermanager.pas +++ b/sources/installermanager.pas @@ -1262,6 +1262,20 @@ procedure TFPCupManager.GetCrossToolsFileName(out BinsFileName,LibsFileName:stri {$else} BinsFileName:='CrossBins'+BinsFileName; {$endif MSWINDOWS} + + // Check for the new libs !! + if (CrossOS_Target=TOS.linux) then + begin + s:=''; + if (CrossCPU_Target=TCPU.arm) then s:='LinuxARMHF_Raspbian_09.zip'; + if (CrossCPU_Target=TCPU.x86_64) then s:='LinuxAMD64_Ubuntu_1804.zip'; + if (CrossCPU_Target=TCPU.i386) then s:='Linuxi386_Ubuntu_1804.zip'; + if (Length(s)>0) then + begin + LibsFileName:=s; + end; + end; + end; procedure TFPCupManager.GetCrossToolsPath(out BinPath,LibPath:string); @@ -1450,7 +1464,7 @@ function TFPCupManager.GetCrossLibsURL(out BaseLibsURL:string; var LibsFileName: begin result:=false; - BaseLibsURL:='crosslibs'; + BaseLibsURL:='notfound'; s:=GetURLDataFromCache(FPCUPGITREPOAPIRELEASES+'?per_page=100'); success:=(Length(s)>0); @@ -1475,33 +1489,58 @@ function TFPCupManager.GetCrossLibsURL(out BaseLibsURL:string; var LibsFileName: success:=false; FileURL:=''; - for i:=0 to Pred(Json.Count) do + + // First, look for new libs + + if (NOT success) then begin - Item := TJSONObject(Json.Items[i]); - TagName:=Item{%H-}.Get('tag_name'); - if (Pos(BaseLibsURL,TagName)<>1) then continue; - Assets:=Item.Get('assets',TJSONArray(nil)); - // Search zip - for iassets:=0 to Pred(Assets.Count) do + BaseLibsURL:=NEWLIBSTAG; + for i:=0 to Pred(Json.Count) do begin - Asset := TJSONObject(Assets[iassets]); - FileName:=Asset{%H-}.Get('name'); - if AnsiStartsText(LibsFileName+'.zip',FileName) then + Item := TJSONObject(Json.Items[i]); + TagName:=Item{%H-}.Get('tag_name'); + success:=(BaseLibsURL=TagName); + if success then break; + end; + if success then + begin + success:=false; + Assets:=Item.Get('assets',TJSONArray(nil)); + // Search zip + for iassets:=0 to Pred(Assets.Count) do begin - LibsFileName:=FileName; - FileURL:=Asset{%H-}.Get('browser_download_url'); + Asset := TJSONObject(Assets[iassets]); + FileName:=Asset{%H-}.Get('name'); + if (FileName=LibsFileName) then + begin + FileURL:=Asset{%H-}.Get('browser_download_url'); + end; + success:=(Length(FileURL)>0); + if success then + begin + BaseLibsURL:=FileURL; + result:=true; + break; + end; end; - success:=(Length(FileURL)>0); - if success then break; end; - if (NOT success) then + end; + + if (NOT success) then + begin + BaseLibsURL:=OLDLIBSTAG; + for i:=0 to Pred(Json.Count) do begin - // Search any + Item := TJSONObject(Json.Items[i]); + TagName:=Item{%H-}.Get('tag_name'); + if (Pos(BaseLibsURL,TagName)<>1) then continue; + Assets:=Item.Get('assets',TJSONArray(nil)); + // Search zip for iassets:=0 to Pred(Assets.Count) do begin Asset := TJSONObject(Assets[iassets]); FileName:=Asset{%H-}.Get('name'); - if ((ExtractFileExt(FileName)<>'.zip') AND AnsiStartsText(LibsFileName,FileName)) then + if AnsiStartsText(LibsFileName+'.zip',FileName) then begin LibsFileName:=FileName; FileURL:=Asset{%H-}.Get('browser_download_url'); @@ -1509,13 +1548,29 @@ function TFPCupManager.GetCrossLibsURL(out BaseLibsURL:string; var LibsFileName: success:=(Length(FileURL)>0); if success then break; end; - end; - if success then - begin - BaseLibsURL:=FileURL; - LibsFileName:=FileName; - result:=true; - break; + if (NOT success) then + begin + // Search any + for iassets:=0 to Pred(Assets.Count) do + begin + Asset := TJSONObject(Assets[iassets]); + FileName:=Asset{%H-}.Get('name'); + if ((ExtractFileExt(FileName)<>'.zip') AND AnsiStartsText(LibsFileName,FileName)) then + begin + LibsFileName:=FileName; + FileURL:=Asset{%H-}.Get('browser_download_url'); + end; + success:=(Length(FileURL)>0); + if success then break; + end; + end; + if success then + begin + BaseLibsURL:=FileURL; + LibsFileName:=FileName; + result:=true; + break; + end; end; end; diff --git a/sources/revision.inc b/sources/revision.inc index 83dc41d2..5daa7b5d 100644 --- a/sources/revision.inc +++ b/sources/revision.inc @@ -1,4 +1,4 @@ const - {%H-}DELUXEVERSION='2.2.0t'; - {%H-}RevisionStr='474'; - {%H-}VersionDate='20230710'; + {%H-}DELUXEVERSION='2.4.0a'; + {%H-}RevisionStr='476'; + {%H-}VersionDate='20230714'; diff --git a/sources/updeluxe/fpcupdeluxemainform.pas b/sources/updeluxe/fpcupdeluxemainform.pas index 382c7e4f..28a1c1b1 100644 --- a/sources/updeluxe/fpcupdeluxemainform.pas +++ b/sources/updeluxe/fpcupdeluxemainform.pas @@ -3322,6 +3322,7 @@ function TForm1.ProcessCrossCompiler(Sender: TObject):boolean; FPCupManager.GetCrossToolsFileName(BinsFileName,LibsFileName); FPCupManager.GetCrossToolsPath(BinPath,LibPath); + // bit tricky ... if bins and/or libs are already there exit this retry ... ;-) if (NOT DirectoryIsEmpty(IncludeTrailingPathDelimiter(FPCupManager.BaseDirectory)+BinPath)) then MissingCrossBins:=false; @@ -3500,7 +3501,12 @@ function TForm1.ProcessCrossCompiler(Sender: TObject):boolean; begin ZipFile:=(ExtractFileExt(ToolTargetFile)='.zip'); ToolTargetPath:=IncludeTrailingPathDelimiter(FPCupManager.BaseDirectory); - //ToolTargetPath:=IncludeTrailingPathDelimiter(FPCupManager.BaseDirectory)+LibPath+DirectorySeparator; + // Check if we have the new libs + if (Pos(NEWLIBSTAG,BaseLibsURL)>0) then + begin + ToolTargetPath:=IncludeTrailingPathDelimiter(FPCupManager.BaseDirectory)+LibPath+DirectorySeparator; + end; + ForceDirectoriesSafe(ToolTargetPath); AddMessage('Going to extract archive into '+ToolTargetPath);