fpmake.pp 3.0 KB

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