fpmake.pp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. HostOS: TOS;
  15. begin
  16. AddCustomFpmakeCommandlineOption('data2inc', 'Use indicated data2inc executable.');
  17. AddCustomFpmakeCommandlineOption('genfpmkunit', 'Regenerate the fpmkunitsrc.inc file (fppkg).');
  18. With Installer do
  19. begin
  20. P:=AddPackage('fppkg');
  21. {$ifdef ALLPACKAGES}
  22. P.Directory:='fppkg';
  23. {$endif ALLPACKAGES}
  24. P.Version:='2.7.1';
  25. P.Dependencies.Add('fcl-base');
  26. P.Dependencies.Add('fcl-xml');
  27. P.Dependencies.Add('fcl-process');
  28. P.Dependencies.Add('paszlib');
  29. P.Dependencies.Add('fpmkunit');
  30. P.Dependencies.Add('univint',[MacOSX,iphonesim]);
  31. P.Dependencies.Add('fcl-net', TargetsWithfpWeb);
  32. P.Dependencies.Add('fcl-web', TargetsWithfpWeb);
  33. P.Dependencies.Add('httpd22', TargetsWithfpWeb);
  34. P.Author := 'FreePascal development team';
  35. P.License := 'LGPL with modification, ';
  36. P.HomepageURL := 'www.freepascal.org';
  37. P.Email := '';
  38. P.Description := 'Libraries to create fppkg package managers.';
  39. P.NeedLibC:= false;
  40. P.OSes := P.OSes - [nativent];
  41. P.SourcePath.Add('src');
  42. T:=P.Targets.AddUnit('fprepos.pp');
  43. T.ResourceStrings:=true;
  44. T:=P.Targets.AddUnit('fpxmlrep.pp');
  45. T.ResourceStrings:=true;
  46. T:=P.Targets.AddUnit('pkgrepos.pp');
  47. T.ResourceStrings:=true;
  48. T:=P.Targets.AddUnit('pkgmessages.pp');
  49. T.ResourceStrings:=true;
  50. T:=P.Targets.AddUnit('pkgoptions.pp');
  51. T:=P.Targets.AddUnit('pkgglobals.pp');
  52. T:=P.Targets.AddUnit('pkghandler.pp');
  53. T:=P.Targets.AddUnit('pkgmkconv.pp');
  54. T:=P.Targets.AddUnit('pkgdownload.pp');
  55. T:=P.Targets.AddUnit('pkgfpmake.pp');
  56. T:=P.Targets.AddUnit('pkgcommands.pp');
  57. T:=P.Targets.AddUnit('pkgwget.pp', TargetsWithWGet);
  58. T:=P.Targets.AddUnit('pkgfphttp.pp', TargetsWithfpWeb);
  59. // Do not re-generate fpmkunitsrc.inc by default so it is possible to control
  60. // when we want to update the internal fpmkunitsrc
  61. if GetCustomFpmakeCommandlineOptionValue('genfpmkunit') <> '' then
  62. begin
  63. Data2Inc := GetCustomFpmakeCommandlineOptionValue('data2inc');
  64. if Data2Inc<>'' then
  65. Data2Inc:= ExpandFileName(Data2Inc);
  66. if Data2Inc='' then
  67. begin
  68. HostOS:=StringToOS({$I %FPCTARGETOS%});
  69. data2inc := ExeSearch(AddProgramExtension('data2inc', HostOS));
  70. end;
  71. if Data2Inc <> '' then
  72. P.Commands.AddCommand(Data2Inc,'-b -s $(SOURCE) $(DEST) fpmkunitsrc','src/fpmkunitsrc.inc','../fpmkunit/src/fpmkunit.pp');
  73. end;
  74. end;
  75. end;
  76. {$ifndef ALLPACKAGES}
  77. begin
  78. add_fppkg;
  79. Installer.Run;
  80. end.
  81. {$endif ALLPACKAGES}