From 2879e56072a531191753d26dde44eac2113e8eb7 Mon Sep 17 00:00:00 2001 From: Don Date: Mon, 26 Jun 2023 12:13:45 +0100 Subject: [PATCH] Handle new trunk Lazarus version. --- public/gitrevision.txt | 2 +- sources/installercore.pas | 12 ++++++--- sources/installerfpc.pas | 19 +++++++++++--- sources/installerlazarus.pas | 51 ++++++++++++++++++++++++++---------- sources/m_crossinstaller.pas | 3 +-- sources/revision.inc | 4 +-- sources/updatelazconfig.pas | 1 + 7 files changed, 66 insertions(+), 26 deletions(-) diff --git a/public/gitrevision.txt b/public/gitrevision.txt index e4ca30bd..04e57361 100644 --- a/public/gitrevision.txt +++ b/public/gitrevision.txt @@ -1 +1 @@ -[master]v2.2.0r-2724(697dbf2) +[master]v2.2.0r-2726(0a445f7) diff --git a/sources/installercore.pas b/sources/installercore.pas index ab23fd5c..dfef1a92 100644 --- a/sources/installercore.pas +++ b/sources/installercore.pas @@ -4109,16 +4109,20 @@ function TInstaller.GetFile(aURL,aFile:string; forceoverwrite:boolean=false; for function TInstaller.GetFullVersionString:string; begin - if ((Self.FMajorVersion=-1) OR (Self.FMinorVersion=-1) OR (Self.FReleaseVersion=-1)) then + if ((Self.FMajorVersion=-1) OR (Self.FMinorVersion=-1){ OR (Self.FReleaseVersion=-1)}) then raise Exception.Create('Fatal: wrong version number(s) !!'); - result:=InttoStr(Self.FMajorVersion)+'.'+InttoStr(Self.FMinorVersion)+'.'+InttoStr(Self.FReleaseVersion); + result:=InttoStr(Self.FMajorVersion)+'.'+InttoStr(Self.FMinorVersion); + if (Self.FReleaseVersion<>-1) then result:=result+'.'+InttoStr(Self.FReleaseVersion) end; function TInstaller.GetFullVersion:dword; begin - if ((Self.FMajorVersion=-1) OR (Self.FMinorVersion=-1) OR (Self.FReleaseVersion=-1)) then + if ((Self.FMajorVersion=-1) OR (Self.FMinorVersion=-1){ OR (Self.FReleaseVersion=-1)}) then raise Exception.Create('Fatal: wrong version number(s) !!'); - result:=CalculateFullVersion(Self.FMajorVersion,Self.FMinorVersion,Self.FReleaseVersion); + if (Self.FReleaseVersion<>-1) then + result:=CalculateFullVersion(Self.FMajorVersion,Self.FMinorVersion,Self.FReleaseVersion) + else + result:=CalculateFullVersion(Self.FMajorVersion,Self.FMinorVersion,0); end; function TInstaller.GetSanityCheck:boolean; diff --git a/sources/installerfpc.pas b/sources/installerfpc.pas index 75fe56e9..308f8981 100644 --- a/sources/installerfpc.pas +++ b/sources/installerfpc.pas @@ -3103,9 +3103,19 @@ function TFPCInstaller.InitModule(aBootstrapVersion:string):boolean; WritelnLog(localinfotext+'FPC URL: ' + URL, false); WritelnLog(localinfotext+'FPC options: ' + FCompilerOptions, false); + if (aBootstrapVersion<>'') then + begin + // Check if we have an override compiler !! + if FileExists(FCompiler) then + begin + FBootstrapCompiler:=FCompiler; + FCompiler:=''; + end; + end; + // set standard bootstrap compilername - FBootstrapCompiler := IncludeTrailingPathDelimiter(FBootstrapCompilerDirectory)+GetSourceCPUOS+'-'+GetCompilerName(GetSourceCPU); - if NOT FileExists(FBootstrapCompiler) then FBootstrapCompiler := IncludeTrailingPathDelimiter(FBootstrapCompilerDirectory)+GetCompilerName(GetSourceCPU); + if (NOT FileExists(FBootstrapCompiler)) then FBootstrapCompiler := IncludeTrailingPathDelimiter(FBootstrapCompilerDirectory)+GetSourceCPUOS+'-'+GetCompilerName(GetSourceCPU); + if (NOT FileExists(FBootstrapCompiler)) then FBootstrapCompiler := IncludeTrailingPathDelimiter(FBootstrapCompilerDirectory)+GetCompilerName(GetSourceCPU); {$IFDEF Darwin} {$IFDEF CPU32} @@ -4917,7 +4927,10 @@ function TFPCInstaller.CleanModule(ModuleName: string): boolean; end; // Final cleansing of source directory - CleanExtra; + if CrossCompiling then + CleanExtra(CrossInstaller.TargetCPU,CrossInstaller.TargetOS) + else + CleanExtra; end; end; diff --git a/sources/installerlazarus.pas b/sources/installerlazarus.pas index ca413bc4..18be9e5f 100644 --- a/sources/installerlazarus.pas +++ b/sources/installerlazarus.pas @@ -1193,21 +1193,44 @@ function TLazarusInstaller.GetVersionFromSource:string; begin result:='0.0.0'; - aFileName:=IncludeTrailingPathDelimiter(SourceDirectory) + 'ide' + DirectorySeparator + 'version.inc'; - if FileExists(aFileName) then + if result='0.0.0' then begin - AssignFile(TxtFile,aFileName); - Reset(TxtFile); - Readln(TxtFile,s); - // remove quotes from string - //VersionSnippet:=DelChars(s, ''''); - s:=TrimSet(s, [#39]); - s:=Trim(s); - //x:=Length(s); - //while (x>0) AND (NOT (s[x] in ['0'..'9','.'])) do Dec(x); - //if (x0 then result:=s; - CloseFile(TxtFile); + aFileName:=ConcatPaths([SourceDirectory,'ide'])+DirectorySeparator+'version.inc'; + if FileExists(aFileName) then + begin + AssignFile(TxtFile,aFileName); + Reset(TxtFile); + Readln(TxtFile,s); + // remove quotes from string + //VersionSnippet:=DelChars(s, ''''); + s:=TrimSet(s, [#39]); + s:=Trim(s); + //x:=Length(s); + //while (x>0) AND (NOT (s[x] in ['0'..'9','.'])) do Dec(x); + //if (x0 then result:=s; + CloseFile(TxtFile); + end; + end; + + if result='0.0.0' then + begin + aFileName:=ConcatPaths([SourceDirectory,'ide','packages','ideconfig'])+DirectorySeparator+'version.inc'; + if FileExists(aFileName) then + begin + AssignFile(TxtFile,aFileName); + Reset(TxtFile); + Readln(TxtFile,s); + // remove quotes from string + //VersionSnippet:=DelChars(s, ''''); + s:=TrimSet(s, [#39]); + s:=Trim(s); + //x:=Length(s); + //while (x>0) AND (NOT (s[x] in ['0'..'9','.'])) do Dec(x); + //if (x0 then result:=s; + CloseFile(TxtFile); + end; end; if result='0.0.0' then diff --git a/sources/m_crossinstaller.pas b/sources/m_crossinstaller.pas index 0d5bcf9b..6ae8fb12 100644 --- a/sources/m_crossinstaller.pas +++ b/sources/m_crossinstaller.pas @@ -980,10 +980,9 @@ constructor TCrossInstaller.Create; FTargetOS:=TOS.osNone; FBinUtilsPrefix:='Error: cross compiler extension must set FBinUtilsPrefix: can be empty, if a prefix is used to separate binutils for different archs in the same directory, use it'; - FCrossModuleNamePrefix:='TAny'; - FBinUtilsDirectoryID:='none'; + FRegisterName:='unknown'; end; destructor TCrossInstaller.Destroy; diff --git a/sources/revision.inc b/sources/revision.inc index a090821c..414f555e 100644 --- a/sources/revision.inc +++ b/sources/revision.inc @@ -1,4 +1,4 @@ const {%H-}DELUXEVERSION='2.2.0sp'; - {%H-}RevisionStr='469'; - {%H-}versiondate='20230512'; + {%H-}RevisionStr='470'; + {%H-}versiondate='20230626'; diff --git a/sources/updatelazconfig.pas b/sources/updatelazconfig.pas index fa99c5d7..daf70dd1 100644 --- a/sources/updatelazconfig.pas +++ b/sources/updatelazconfig.pas @@ -350,6 +350,7 @@ function TUpdateLazConfig.GetConfig(const ConfigFile: string): TConfig; else if (FLazarusMajorVer=1) then begin + // See EnvOptsVersion in \lazarus\ide\packages\ideconfig\environmentopts.pp case FLazarusMinor of 0 : Version := '107'; //for version 1.0 1 : Version := '107'; //for version 1.0,1.1