mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 05:40:28 +02:00
* Combine all utils into one achive, several installers depend on this
git-svn-id: trunk@28887 -
This commit is contained in:
parent
f55e4400b3
commit
8da7914438
@ -710,6 +710,7 @@ Type
|
||||
FFlags: TStrings;
|
||||
FFPDocFormat: TFPDocFormats;
|
||||
FIsFPMakeAddIn: boolean;
|
||||
FSeparateArchive: boolean;
|
||||
FSupportBuildModes: TBuildModes;
|
||||
FUnitPath,
|
||||
FObjectPath,
|
||||
@ -802,6 +803,7 @@ Type
|
||||
Property SupportBuildModes: TBuildModes read FSupportBuildModes write FSupportBuildModes;
|
||||
Property BuildMode: TBuildMode read FBuildMode;
|
||||
Property Flags: TStrings read FFlags;
|
||||
Property SeparateArchive: boolean read FSeparateArchive write FSeparateArchive;
|
||||
// Compiler options.
|
||||
Property OSes : TOSes Read FOSes Write FOSes;
|
||||
Property CPUs : TCPUs Read FCPUs Write FCPUs;
|
||||
@ -3092,6 +3094,7 @@ begin
|
||||
FOSes:=AllOSes;
|
||||
FInstalledChecksum:=$ffffffff;
|
||||
FFlags := TStringList.Create;
|
||||
FSeparateArchive:=true;
|
||||
// Implicit dependency on RTL
|
||||
FDependencies.Add('rtl');
|
||||
FSupportBuildModes:=[bmBuildUnit, bmOneByOne];
|
||||
@ -6971,81 +6974,93 @@ end;
|
||||
|
||||
procedure TBuildEngine.ZipInstall(Packages: TPackages);
|
||||
|
||||
procedure CreateZipFile;
|
||||
{$ifdef unix}
|
||||
{$ifdef HAS_TAR_SUPPORT}
|
||||
{$define CreateTarFile}
|
||||
{$endif HAS_TAR_SUPPORT}
|
||||
{$endif unix}
|
||||
|
||||
{$ifdef CreateTarFile}
|
||||
var
|
||||
I : Integer;
|
||||
P : TPackage;
|
||||
S : TGZFileStream;
|
||||
|
||||
procedure InitArchive(AFileName: string);
|
||||
begin
|
||||
FZipper := TZipper.Create;
|
||||
S := TGZFileStream.create(AFileName +'.tar.gz', gzopenwrite);
|
||||
try
|
||||
For I:=0 to Packages.Count-1 do
|
||||
begin
|
||||
P:=Packages.PackageItems[i];
|
||||
If PackageOK(P) then
|
||||
begin
|
||||
FZipper.FileName := Defaults.ZipPrefix + P.Name + MakeZipSuffix(Defaults.CPU,Defaults.OS) +'.zip';
|
||||
Install(P);
|
||||
FZipper.ZipAllFiles;
|
||||
FZipper.Clear;
|
||||
log(vlWarning, SWarnInstallationPackagecomplete, [P.Name, Defaults.Target]);
|
||||
end
|
||||
else
|
||||
log(vlWarning,SWarnSkipPackageTarget,[P.Name, Defaults.Target]);
|
||||
end;
|
||||
finally
|
||||
FZipper.Free;
|
||||
FTarWriter := TTarWriter.Create(S);
|
||||
FTarWriter.Permissions := [tpReadByOwner, tpWriteByOwner, tpReadByGroup, tpReadByOther];
|
||||
FTarWriter.UserName := 'root';
|
||||
FTarWriter.GroupName := 'root';
|
||||
except
|
||||
S.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
{$ifdef HAS_TAR_SUPPORT}
|
||||
procedure CreateTarFile;
|
||||
var
|
||||
I : Integer;
|
||||
P : TPackage;
|
||||
S : TGZFileStream;
|
||||
begin;
|
||||
For I:=0 to Packages.Count-1 do
|
||||
begin
|
||||
P:=Packages.PackageItems[i];
|
||||
If PackageOK(P) then
|
||||
begin
|
||||
S := TGZFileStream.create(Defaults.ZipPrefix + P.Name + MakeZipSuffix(Defaults.CPU,Defaults.OS) +'.tar.gz', gzopenwrite);
|
||||
try
|
||||
FTarWriter := TTarWriter.Create(S);
|
||||
FTarWriter.Permissions := [tpReadByOwner, tpWriteByOwner, tpReadByGroup, tpReadByOther];
|
||||
FTarWriter.UserName := 'root';
|
||||
FTarWriter.GroupName := 'root';
|
||||
try
|
||||
Install(P);
|
||||
log(vlWarning, SWarnInstallationPackagecomplete, [P.Name, Defaults.Target]);
|
||||
finally
|
||||
FTarWriter.Free;
|
||||
end;
|
||||
finally
|
||||
S.Free;
|
||||
end;
|
||||
end
|
||||
else
|
||||
log(vlWarning,SWarnSkipPackageTarget,[P.Name, Defaults.Target]);
|
||||
end;
|
||||
procedure FinishArchive;
|
||||
begin
|
||||
FreeAndNil(FTarWriter);
|
||||
S.Free;
|
||||
end;
|
||||
{$endif HAS_TAR_SUPPORT}
|
||||
|
||||
{$else}
|
||||
|
||||
procedure InitArchive(AFileName: string);
|
||||
begin
|
||||
FZipper := TZipper.Create;
|
||||
FZipper.FileName := AFileName + '.zip';
|
||||
end;
|
||||
|
||||
procedure FinishArchive;
|
||||
begin
|
||||
try
|
||||
FZipper.ZipAllFiles;
|
||||
FZipper.Clear;
|
||||
finally
|
||||
FreeAndNil(FZipper);
|
||||
end;
|
||||
end;
|
||||
|
||||
{$endif}
|
||||
|
||||
var
|
||||
I : Integer;
|
||||
P : TPackage;
|
||||
IsArchiveInitialized : boolean;
|
||||
|
||||
begin
|
||||
If Assigned(BeforeInstall) then
|
||||
BeforeInstall(Self);
|
||||
|
||||
IsArchiveInitialized:=false;
|
||||
Defaults.IntSetBaseInstallDir('lib/fpc/' + Defaults.FCompilerVersion+ '/');
|
||||
|
||||
{$ifdef unix}
|
||||
{$ifdef HAS_TAR_SUPPORT}
|
||||
CreateTarFile;
|
||||
{$else HAS_TAR_SUPPORT}
|
||||
CreateZipFile;
|
||||
{$endif HAS_TAR_SUPPORT}
|
||||
{$else unix}
|
||||
CreateZipFile;
|
||||
{$endif unix}
|
||||
try
|
||||
For I:=0 to Packages.Count-1 do
|
||||
begin
|
||||
P:=Packages.PackageItems[i];
|
||||
If PackageOK(P) then
|
||||
begin
|
||||
if IsArchiveInitialized and P.SeparateArchive then
|
||||
begin
|
||||
FinishArchive;
|
||||
IsArchiveInitialized:=false;
|
||||
end;
|
||||
if not IsArchiveInitialized then
|
||||
begin
|
||||
InitArchive(Defaults.ZipPrefix + P.Name + MakeZipSuffix(Defaults.CPU,Defaults.OS));
|
||||
IsArchiveInitialized:=true;
|
||||
end;
|
||||
Install(P);
|
||||
log(vlWarning, SWarnInstallationPackagecomplete, [P.Name, Defaults.Target]);
|
||||
end
|
||||
else
|
||||
log(vlWarning,SWarnSkipPackageTarget,[P.Name, Defaults.Target]);
|
||||
end;
|
||||
finally
|
||||
if IsArchiveInitialized then
|
||||
FinishArchive;
|
||||
end;
|
||||
|
||||
If Assigned(AfterInstall) then
|
||||
AfterInstall(Self);
|
||||
|
@ -25,6 +25,7 @@ begin
|
||||
P.NeedLibC:= false;
|
||||
|
||||
P.OSes:=[go32v2];
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
|
@ -221,6 +221,7 @@ begin
|
||||
P.Directory:=ADirectory;
|
||||
{$endif ALLPACKAGES}
|
||||
P.Version:='2.7.1';
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
P.Dependencies.Add('fcl-base');
|
||||
|
||||
|
@ -26,6 +26,7 @@ begin
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
P.Dependencies.Add('fcl-base');
|
||||
P.Dependencies.Add('fpmkunit');
|
||||
|
@ -25,6 +25,7 @@ begin
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
P.OSes:=[win32,win64,wince,haiku,linux,freebsd,openbsd,netbsd,darwin,iphonesim,solaris,os2,emx,aix,aros];
|
||||
|
||||
|
@ -23,6 +23,7 @@ begin
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
P.SeparateArchive:=false;
|
||||
P.Dependencies.Add('fcl-res');
|
||||
|
||||
P.OSes:=[darwin, iphonesim];
|
||||
|
@ -32,7 +32,7 @@ begin
|
||||
P.Dependencies.Add('chm');
|
||||
P.Dependencies.Add('univint',[darwin,iphonesim]);
|
||||
|
||||
|
||||
P.SeparateArchive:=false;
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
|
||||
|
@ -47,8 +47,6 @@ Var
|
||||
T : TTarget;
|
||||
|
||||
begin
|
||||
{$include fpmake_add.inc}
|
||||
|
||||
With Installer do
|
||||
begin
|
||||
P:=AddPackage('utils');
|
||||
@ -87,6 +85,8 @@ begin
|
||||
P.Targets.AddUnit('usubst.pp').install:=false;
|
||||
P.Targets.AddUnit('ptopu.pp').install:=false;
|
||||
end;
|
||||
|
||||
{$include fpmake_add.inc}
|
||||
end;
|
||||
|
||||
{$ifdef NO_PARENT}
|
||||
|
@ -29,6 +29,7 @@ begin
|
||||
P.Version:='2.7.1';
|
||||
|
||||
P.OSes := [win32, win64, os2, emx];
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
gtkOSes:=[linux];
|
||||
// Only compile fpmcgtk on win32 when the gtk-library is found in the path
|
||||
|
@ -28,6 +28,7 @@ begin
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
P.SourcePath.Add('lnet',lnetOSes);
|
||||
P.IncludePath.Add('lnet/sys',lnetOSes);
|
||||
|
@ -24,6 +24,7 @@ begin
|
||||
'scripts numerical constants and replaces these constants to its values '+
|
||||
'in resource script.';
|
||||
P.NeedLibC:= false;
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
|
@ -25,6 +25,7 @@ begin
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
P.Options.Add('-Sg');
|
||||
|
||||
|
@ -28,6 +28,7 @@ begin
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
P.OSes:=[win32,win64];
|
||||
|
||||
|
@ -25,6 +25,7 @@ begin
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
P.Dependencies.Add('fcl-process');
|
||||
P.Options.Add('-S2h');
|
||||
|
@ -22,6 +22,7 @@ begin
|
||||
P.Description := 'Generate fpmake.pp for Pascal source.';
|
||||
P.Email := '';
|
||||
P.NeedLibC:= false;
|
||||
P.SeparateArchive:=false;
|
||||
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
|
@ -23,6 +23,7 @@ begin
|
||||
P.Email := '';
|
||||
P.NeedLibC:= false;
|
||||
|
||||
P.SeparateArchive:=false;
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
P.Dependencies.Add('fcl-base');
|
||||
|
@ -23,6 +23,7 @@ begin
|
||||
P.Email := '';
|
||||
P.NeedLibC:= false;
|
||||
|
||||
P.SeparateArchive:=false;
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
P.Dependencies.Add('fcl-passrc');
|
||||
|
@ -23,6 +23,7 @@ begin
|
||||
P.Description := 'Tool to remove (delete) file(s) with optional retries';
|
||||
P.NeedLibC:= false;
|
||||
|
||||
P.SeparateArchive:=false;
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
|
||||
|
@ -24,6 +24,7 @@ begin
|
||||
P.Description := 'A compiler generator for Turbo Pascal and compatibles.';
|
||||
P.NeedLibC:= false;
|
||||
|
||||
P.SeparateArchive:=false;
|
||||
P.Directory:=ADirectory;
|
||||
P.Version:='2.7.1';
|
||||
|
||||
|
@ -25,6 +25,7 @@ begin
|
||||
P.Directory:=ADirectory;
|
||||
{$endif ALLPACKAGES}
|
||||
P.Version:='2.7.1';
|
||||
P.SeparateArchive:=false;
|
||||
P.Dependencies.Add('rtl');
|
||||
P.Dependencies.Add('fcl-base');
|
||||
P.Dependencies.Add('fcl-xml');
|
||||
|
Loading…
Reference in New Issue
Block a user