* 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:
Loesje_ 2010-11-25 21:07:41 +00:00
parent c816b22922
commit 4a8d99b73b
2 changed files with 47 additions and 19 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<CONFIG>
<Package Version="3">
<Name Value="GeckoComponentsFP"/>
<Name Value="GeckoComponents"/>
<AddToProjectUsesSection Value="False"/>
<Author Value="Gecko Components for Delphi; ported to Lazarus by Phil Hess"/>
<CompilerOptions>
@ -81,8 +81,5 @@
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
</PublishOptions>
<Provides Count="1">
<Item1 Value="GeckoComponents"/>
</Provides>
</Package>
</CONFIG>

View File

@ -1,20 +1,60 @@
{$mode objfpc}{$H+}
program fpmake;
uses fpmkunit, sysutils;
uses fpmkunit, sysutils, classes;
Var
P : TPackage;
T : TTarget;
type
{ TLazInstaller }
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;
{ TLazInstaller }
procedure TLazInstaller.DoRegisterLazarusPackages(Sender: TObject);
Var
LazarusDir : string;
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
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
P:=AddPackage('gecko');
p.AfterInstall := @TLazInstaller(Installer).DoRegisterLazarusPackages;
If Defaults.UnixPaths then
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.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/CallbackInterfaces.pas',InstallLazarusPackageDir);
P.Sources.AddDoc('Components/GeckoBrowser.pas',InstallLazarusPackageDir);
@ -178,15 +218,6 @@ begin
P.Sources.AddDoc('Components/GeckoSimpleProfile.pas',InstallLazarusPackageDir);
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.