You've already forked lazarus-ccr
* Adapted fpmake so that the Lazarus-package link is only installed after an install
* Us a package template with the same name as the original package, to avoid problems with dependencies git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1383 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<Package Version="3">
|
<Package Version="3">
|
||||||
<Name Value="GeckoComponentsFP"/>
|
<Name Value="GeckoComponents"/>
|
||||||
<AddToProjectUsesSection Value="False"/>
|
<AddToProjectUsesSection Value="False"/>
|
||||||
<Author Value="Gecko Components for Delphi; ported to Lazarus by Phil Hess"/>
|
<Author Value="Gecko Components for Delphi; ported to Lazarus by Phil Hess"/>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
@@ -81,8 +81,5 @@
|
|||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IgnoreBinaries Value="False"/>
|
<IgnoreBinaries Value="False"/>
|
||||||
</PublishOptions>
|
</PublishOptions>
|
||||||
<Provides Count="1">
|
|
||||||
<Item1 Value="GeckoComponents"/>
|
|
||||||
</Provides>
|
|
||||||
</Package>
|
</Package>
|
||||||
</CONFIG>
|
</CONFIG>
|
||||||
@@ -1,20 +1,60 @@
|
|||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
program fpmake;
|
program fpmake;
|
||||||
|
|
||||||
uses fpmkunit, sysutils;
|
uses fpmkunit, sysutils, classes;
|
||||||
|
|
||||||
Var
|
type
|
||||||
P : TPackage;
|
{ TLazInstaller }
|
||||||
T : TTarget;
|
|
||||||
|
TLazInstaller = class(TCustomInstaller)
|
||||||
|
public
|
||||||
|
procedure DoRegisterLazarusPackages(Sender: TObject);
|
||||||
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
resourcestring
|
||||||
|
SErrAlreadyInitialized = 'Installer can only be initialized once';
|
||||||
|
|
||||||
|
var
|
||||||
InstallLazarusPackageDir : string;
|
InstallLazarusPackageDir : string;
|
||||||
|
|
||||||
|
{ TLazInstaller }
|
||||||
|
|
||||||
|
procedure TLazInstaller.DoRegisterLazarusPackages(Sender: TObject);
|
||||||
|
Var
|
||||||
LazarusDir : string;
|
LazarusDir : string;
|
||||||
LazPackagerFile : Text;
|
LazPackagerFile : Text;
|
||||||
|
|
||||||
|
begin
|
||||||
|
LazarusDir := GetCustomFpmakeCommandlineOptionValue('lazarusdir');
|
||||||
|
if LazarusDir <> '' then
|
||||||
|
begin
|
||||||
|
BuildEngine.CmdRenameFile(InstallLazarusPackageDir+PathDelim+'GeckoComponents.lpk.fppkg',InstallLazarusPackageDir+PathDelim+'GeckoComponents.lpk');
|
||||||
|
System.assign(LazPackagerFile,IncludeTrailingPathDelimiter(LazarusDir)+'packager'+PathDelim+'globallinks'+PathDelim+'GeckoComponents-0.lpl');
|
||||||
|
System.Rewrite(LazPackagerFile);
|
||||||
|
System.WriteLn(LazPackagerFile,InstallLazarusPackageDir+PathDelim+'GeckoComponents.lpk');
|
||||||
|
System.close(LazPackagerFile);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TLazInstaller.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
AddCustomFpmakeCommandlineOption('lazarusdir','Location of a Lazarus installation.');
|
AddCustomFpmakeCommandlineOption('lazarusdir','Location of a Lazarus installation.');
|
||||||
With Installer do
|
if assigned(Defaults) then
|
||||||
|
Error(SErrAlreadyInitialized);
|
||||||
|
Defaults:=TFPCDefaults.Create;
|
||||||
|
inherited Create(AOwner);
|
||||||
|
end;
|
||||||
|
|
||||||
|
Var
|
||||||
|
P : TPackage;
|
||||||
|
T : TTarget;
|
||||||
|
|
||||||
|
begin
|
||||||
|
With Installer(TLazInstaller) do
|
||||||
begin
|
begin
|
||||||
P:=AddPackage('gecko');
|
P:=AddPackage('gecko');
|
||||||
|
p.AfterInstall := @TLazInstaller(Installer).DoRegisterLazarusPackages;
|
||||||
|
|
||||||
If Defaults.UnixPaths then
|
If Defaults.UnixPaths then
|
||||||
InstallLazarusPackageDir:=Defaults.Prefix+'share'+PathDelim+'fpc-'+p.Name
|
InstallLazarusPackageDir:=Defaults.Prefix+'share'+PathDelim+'fpc-'+p.Name
|
||||||
@@ -164,7 +204,7 @@ begin
|
|||||||
P.Sources.AddExample('SampleApps/GBrowser.lpi','examples');
|
P.Sources.AddExample('SampleApps/GBrowser.lpi','examples');
|
||||||
P.Sources.AddExample('SampleApps/GBrowser.dpr','examples');
|
P.Sources.AddExample('SampleApps/GBrowser.dpr','examples');
|
||||||
|
|
||||||
P.Sources.AddDoc('Components/GeckoComponentsFP.lpk',InstallLazarusPackageDir);
|
P.Sources.AddDoc('Components/GeckoComponents.lpk.fppkg',InstallLazarusPackageDir);
|
||||||
P.Sources.AddDoc('Components/BrowserSupports.pas',InstallLazarusPackageDir);
|
P.Sources.AddDoc('Components/BrowserSupports.pas',InstallLazarusPackageDir);
|
||||||
P.Sources.AddDoc('Components/CallbackInterfaces.pas',InstallLazarusPackageDir);
|
P.Sources.AddDoc('Components/CallbackInterfaces.pas',InstallLazarusPackageDir);
|
||||||
P.Sources.AddDoc('Components/GeckoBrowser.pas',InstallLazarusPackageDir);
|
P.Sources.AddDoc('Components/GeckoBrowser.pas',InstallLazarusPackageDir);
|
||||||
@@ -178,15 +218,6 @@ begin
|
|||||||
P.Sources.AddDoc('Components/GeckoSimpleProfile.pas',InstallLazarusPackageDir);
|
P.Sources.AddDoc('Components/GeckoSimpleProfile.pas',InstallLazarusPackageDir);
|
||||||
|
|
||||||
Run;
|
Run;
|
||||||
|
|
||||||
LazarusDir := GetCustomFpmakeCommandlineOptionValue('lazarusdir');
|
|
||||||
if LazarusDir <> '' then
|
|
||||||
begin
|
|
||||||
System.assign(LazPackagerFile,IncludeTrailingPathDelimiter(LazarusDir)+'packager'+PathDelim+'globallinks'+PathDelim+'GeckoComponentsFP-0.lpl');
|
|
||||||
System.Rewrite(LazPackagerFile);
|
|
||||||
System.WriteLn(LazPackagerFile,InstallLazarusPackageDir+PathDelim+'GeckoComponentsFP.lpk');
|
|
||||||
System.close(LazPackagerFile);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user