Skip to content

Commit

Permalink
Handle new trunk Lazarus version.
Browse files Browse the repository at this point in the history
  • Loading branch information
LongDirtyAnimAlf committed Jun 26, 2023
1 parent 66bf939 commit 2879e56
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 26 deletions.
2 changes: 1 addition & 1 deletion public/gitrevision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[master]v2.2.0r-2724(697dbf2)
[master]v2.2.0r-2726(0a445f7)
12 changes: 8 additions & 4 deletions sources/installercore.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 16 additions & 3 deletions sources/installerfpc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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;
Expand Down
51 changes: 37 additions & 14 deletions sources/installerlazarus.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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 (x<Length(s)) then Delete(S,x,MaxInt);
if Length(s)>0 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 (x<Length(s)) then Delete(S,x,MaxInt);
if Length(s)>0 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 (x<Length(s)) then Delete(S,x,MaxInt);
if Length(s)>0 then result:=s;
CloseFile(TxtFile);
end;
end;

if result='0.0.0' then
Expand Down
3 changes: 1 addition & 2 deletions sources/m_crossinstaller.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions sources/revision.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const
{%H-}DELUXEVERSION='2.2.0sp';
{%H-}RevisionStr='469';
{%H-}versiondate='20230512';
{%H-}RevisionStr='470';
{%H-}versiondate='20230626';
1 change: 1 addition & 0 deletions sources/updatelazconfig.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2879e56

Please sign in to comment.