diff --git a/.gitattributes b/.gitattributes index c6e1b45355..ae937fa477 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2783,6 +2783,7 @@ packages/fpmkunit/fpmake.pp svneol=native#text/plain packages/fpmkunit/src/fpmkunit.pp svneol=native#text/plain packages/fppkg/Makefile svneol=native#text/plain packages/fppkg/Makefile.fpc svneol=native#text/plain +packages/fppkg/fpmake.pp svneol=native#text/plain packages/fppkg/src/fpmkunitsrc.inc svneol=native#text/plain packages/fppkg/src/fprepos.pp svneol=native#text/plain packages/fppkg/src/fpxmlrep.pp svneol=native#text/plain diff --git a/packages/fpmake_add.inc b/packages/fpmake_add.inc index 739763fbba..997bbf70fd 100644 --- a/packages/fpmake_add.inc +++ b/packages/fpmake_add.inc @@ -29,6 +29,7 @@ add_fftw; add_fpgtk; add_fpmkunit; + add_fppkg; add_fv; add_gdbint; add_gdbm; diff --git a/packages/fpmake_proc.inc b/packages/fpmake_proc.inc index 35b3ea7c35..27233db8d2 100644 --- a/packages/fpmake_proc.inc +++ b/packages/fpmake_proc.inc @@ -180,6 +180,8 @@ begin {$include fpmkunit/fpmake.pp} end; +{$include fppkg/fpmake.pp} + procedure add_fv; begin with Installer do diff --git a/packages/fppkg/fpmake.pp b/packages/fppkg/fpmake.pp new file mode 100644 index 0000000000..3948772a09 --- /dev/null +++ b/packages/fppkg/fpmake.pp @@ -0,0 +1,97 @@ +{$ifndef ALLPACKAGES} +{$mode objfpc}{$H+} +program fpmake; + +uses fpmkunit, sysutils; +{$endif ALLPACKAGES} + +procedure add_fppkg; + +const + TargetsWithWGet = [linux,beos,haiku,freebsd,netbsd,openbsd,darwin,iphonesim,solaris,win32,win64,wince]; + TargetsWithfpWeb = TargetsWithWGet; + +Var + T : TTarget; + P : TPackage; + Data2Inc : string; + HostOS: TOS; +begin + AddCustomFpmakeCommandlineOption('data2inc', 'Use indicated data2inc executable.'); + AddCustomFpmakeCommandlineOption('genfpmkunit', 'Regenerate the fpmkunitsrc.inc file (fppkg).'); + + With Installer do + begin + + P:=AddPackage('fppkg'); +{$ifdef ALLPACKAGES} + P.Directory:='fppkg'; +{$endif ALLPACKAGES} + + P.Version:='2.7.1'; + P.Dependencies.Add('fcl-base'); + P.Dependencies.Add('fcl-xml'); + P.Dependencies.Add('fcl-process'); + P.Dependencies.Add('paszlib'); + P.Dependencies.Add('httpd22'); + + P.Dependencies.Add('univint',[MacOSX,iphonesim]); + P.Dependencies.Add('fcl-net', TargetsWithfpWeb); + P.Dependencies.Add('fcl-web', TargetsWithfpWeb); + + P.Author := 'FreePascal development team'; + P.License := 'LGPL with modification, '; + P.HomepageURL := 'www.freepascal.org'; + P.Email := ''; + P.Description := 'Libraries to create fppkg package managers.'; + P.NeedLibC:= false; + + P.SourcePath.Add('src'); + + T:=P.Targets.AddUnit('fprepos.pp'); + T.ResourceStrings:=true; + + T:=P.Targets.AddUnit('fpxmlrep.pp'); + T.ResourceStrings:=true; + + T:=P.Targets.AddUnit('pkgrepos.pp'); + T.ResourceStrings:=true; + + T:=P.Targets.AddUnit('pkgmessages.pp'); + T.ResourceStrings:=true; + + T:=P.Targets.AddUnit('pkgoptions.pp'); + T:=P.Targets.AddUnit('pkgglobals.pp'); + T:=P.Targets.AddUnit('pkghandler.pp'); + T:=P.Targets.AddUnit('pkgmkconv.pp'); + T:=P.Targets.AddUnit('pkgdownload.pp'); + T:=P.Targets.AddUnit('pkgfpmake.pp'); + T:=P.Targets.AddUnit('pkgcommands.pp'); + + T:=P.Targets.AddUnit('pkgwget.pp', TargetsWithWGet); + T:=P.Targets.AddUnit('pkgfphttp.pp', TargetsWithfpWeb); + + // Do not re-generate fpmkunitsrc.inc by default so it is possible to control + // when we want to update the internal fpmkunitsrc + if GetCustomFpmakeCommandlineOptionValue('genfpmkunit') <> '' then + begin + Data2Inc := GetCustomFpmakeCommandlineOptionValue('data2inc'); + if Data2Inc<>'' then + Data2Inc:= ExpandFileName(Data2Inc); + if Data2Inc='' then + begin + HostOS:=StringToOS({$I %FPCTARGETOS%}); + data2inc := ExeSearch(AddProgramExtension('data2inc', HostOS)); + end; + if Data2Inc <> '' then + P.Commands.AddCommand(Data2Inc,'-b -s $(SOURCE) $(DEST) fpmkunitsrc','src/fpmkunitsrc.inc','../fpmkunit/src/fpmkunit.pp'); + end; + end; +end; + +{$ifndef ALLPACKAGES} +begin + add_fppkg; + Installer.Run; +end. +{$endif ALLPACKAGES}