fpmake.pp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {$ifndef ALLPACKAGES}
  2. {$mode objfpc}{$H+}
  3. program fpmake;
  4. uses fpmkunit, sysutils;
  5. {$endif ALLPACKAGES}
  6. procedure add_fppkg;
  7. const
  8. TargetsWithWGet = [linux,beos,haiku,freebsd,netbsd,openbsd,darwin,iphonesim,solaris,win32,win64,wince,aix];
  9. TargetsWithfpWeb = TargetsWithWGet;
  10. Var
  11. T : TTarget;
  12. P : TPackage;
  13. Data2Inc : string;
  14. begin
  15. AddCustomFpmakeCommandlineOption('data2inc', 'Use indicated data2inc executable.');
  16. AddCustomFpmakeCommandlineOption('genfpmkunit', 'Regenerate the fpmkunitsrc.inc file (fppkg).');
  17. With Installer do
  18. begin
  19. P:=AddPackage('fppkg');
  20. {$ifdef ALLPACKAGES}
  21. P.Directory:='fppkg';
  22. {$endif ALLPACKAGES}
  23. P.Version:='2.7.1';
  24. P.Dependencies.Add('fcl-base');
  25. P.Dependencies.Add('fcl-xml');
  26. P.Dependencies.Add('fcl-process');
  27. P.Dependencies.Add('paszlib');
  28. P.Dependencies.Add('fpmkunit');
  29. P.Dependencies.Add('univint',[MacOSX,iphonesim]);
  30. P.Dependencies.Add('fcl-net', TargetsWithfpWeb);
  31. P.Dependencies.Add('fcl-web', TargetsWithfpWeb);
  32. P.Dependencies.Add('httpd22', TargetsWithfpWeb);
  33. P.Author := 'FreePascal development team';
  34. P.License := 'LGPL with modification, ';
  35. P.HomepageURL := 'www.freepascal.org';
  36. P.Email := '';
  37. P.Description := 'Libraries to create fppkg package managers.';
  38. P.NeedLibC:= false;
  39. P.OSes := P.OSes - [embedded,nativent];
  40. P.SourcePath.Add('src');
  41. T:=P.Targets.AddUnit('fprepos.pp');
  42. T.ResourceStrings:=true;
  43. T:=P.Targets.AddUnit('fpxmlrep.pp');
  44. T.ResourceStrings:=true;
  45. T:=P.Targets.AddUnit('pkgrepos.pp');
  46. T.ResourceStrings:=true;
  47. T:=P.Targets.AddUnit('pkgmessages.pp');
  48. T.ResourceStrings:=true;
  49. T:=P.Targets.AddUnit('pkgoptions.pp');
  50. T:=P.Targets.AddUnit('pkgglobals.pp');
  51. T:=P.Targets.AddUnit('pkghandler.pp');
  52. T:=P.Targets.AddUnit('pkgmkconv.pp');
  53. T:=P.Targets.AddUnit('pkgdownload.pp');
  54. T:=P.Targets.AddUnit('pkgfpmake.pp');
  55. T:=P.Targets.AddUnit('pkgcommands.pp');
  56. T:=P.Targets.AddUnit('pkgwget.pp', TargetsWithWGet);
  57. T:=P.Targets.AddUnit('pkgfphttp.pp', TargetsWithfpWeb);
  58. // Do not re-generate fpmkunitsrc.inc by default so it is possible to control
  59. // when we want to update the internal fpmkunitsrc
  60. if GetCustomFpmakeCommandlineOptionValue('genfpmkunit') <> '' then
  61. begin
  62. Data2Inc := GetCustomFpmakeCommandlineOptionValue('data2inc');
  63. if Data2Inc<>'' then
  64. Data2Inc:= ExpandFileName(Data2Inc);
  65. if Data2Inc='' then
  66. begin
  67. data2inc := ExeSearch(AddProgramExtension('data2inc', Defaults.BuildOS));
  68. end;
  69. if Data2Inc <> '' then
  70. P.Commands.AddCommand(Data2Inc,'-b -s $(SOURCE) $(DEST) fpmkunitsrc','src/fpmkunitsrc.inc','../fpmkunit/src/fpmkunit.pp');
  71. end;
  72. end;
  73. end;
  74. {$ifndef ALLPACKAGES}
  75. begin
  76. add_fppkg;
  77. Installer.Run;
  78. end.
  79. {$endif ALLPACKAGES}