fpmake.pp 2.8 KB

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