Integrate building the HaikuPorts bootstrap packages

* Add configure option --bootstrap which allows specifying the
  haikuporter and HaikuPorts repository paths.
* Add rules for supporting a second repository type. The
  PackageRepository rule is now private and RemotePackageRepository is
  used for remote repositories. The new BootstrapPackageRepository rule
  is for defining a bootstrap repository (there will probably be only
  the HaikuPorts cross repository) whose packages can be built as needed
  via haikuporter.
* Rename DownloadPackage to FetchPackage.
* Define repository HaikuPortsCross.
* HaikuCrossDevel package(s): There are now two sets of packages: A
  "stage1" set with the same content as before and a final set
  additionally containing the libraries libbe, libnetwork, libpackage.
  Those are needed for building the libsolv bootstrap package while for
  building them we need other bootstrap packages (ICU, libz).

This is basically all that's required to build a bootstrap Haiku
completely from sources, with a few caveats:
* There's no ICU bootstrap recipe yet (so one has to cheat and use the
  prebuilt package ATM).
* Probably doesn't work on Haiku yet (tested on Linux only).
* A 32 bit environment must be used (otherwise building the gcc 2
  bootstrap package fails).
* Building with multiple jobs doesn't work yet, since haikuporter uses
  common directories for building different packages and there's no
  explicit serialization yet.
* Haven't tested the resulting image save for booting it. So it probably
  needs a bit more work before it can actually build the final
  HaikuPorts packages.
This commit is contained in:
Ingo Weinhold
2013-07-21 04:10:48 +02:00
parent 33f23ea80f
commit e173a1ec1c
9 changed files with 410 additions and 93 deletions
+70 -61
View File
@@ -4,73 +4,82 @@
# The main use of this package is to provide HaikuPorter with a development
# environment for a cross-build Haiku platform.
# first create the actual cross development package
local additionalLibraries_stage1 ;
local additionalLibraries = libbe.so libnetwork.so libpackage.so ;
local haikuCrossDevelSysrootPackage
= haiku_cross_devel_sysroot_$(HAIKU_PACKAGING_ARCH).hpkg ;
HaikuPackage $(haikuCrossDevelSysrootPackage) ;
local stage ;
for stage in _stage1 "" {
# first create the actual cross development package
local developCrossLibDirTokens = develop lib ;
local haikuCrossDevelSysrootPackage
= haiku_cross_devel_sysroot$(stage)_$(HAIKU_PACKAGING_ARCH).hpkg ;
HaikuPackage $(haikuCrossDevelSysrootPackage) ;
# glue code
AddFilesToPackage $(developCrossLibDirTokens) :
<src!system!glue!arch!$(TARGET_ARCH)>crti.o
<src!system!glue!arch!$(TARGET_ARCH)>crtn.o
<src!system!glue>init_term_dyn.o
<src!system!glue>start_dyn.o
<src!system!glue>haiku_version_glue.o
;
local developCrossLibDirTokens = develop lib ;
# kernel
AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ;
# glue code
AddFilesToPackage $(developCrossLibDirTokens) :
<src!system!glue!arch!$(TARGET_ARCH)>crti.o
<src!system!glue!arch!$(TARGET_ARCH)>crtn.o
<src!system!glue>init_term_dyn.o
<src!system!glue>start_dyn.o
<src!system!glue>haiku_version_glue.o
;
# libraries
AddLibrariesToPackage $(developCrossLibDirTokens) :
libbsd.so
<revisioned>libroot.so
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
;
# kernel
AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ;
# static libraries
AddFilesToPackage $(developCrossLibDirTokens) : liblocalestub.a ;
# libraries
AddLibrariesToPackage $(developCrossLibDirTokens) :
libbsd.so
<revisioned>libroot.so
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
$(additionalLibraries$(stage))
;
# the POSIX error code mapper library
AddFilesToPackage $(developCrossLibDirTokens) : libposix_error_mapper.a ;
# static libraries
AddFilesToPackage $(developCrossLibDirTokens) : liblocalestub.a ;
# headers
local developCrossHeadersDirTokens = develop headers ;
local headerDir ;
for headerDir in config glibc os posix {
CopyDirectoryToPackage $(developCrossHeadersDirTokens)
: [ FDirName $(HAIKU_TOP) headers $(headerDir) ] ;
# the POSIX error code mapper library
AddFilesToPackage $(developCrossLibDirTokens) : libposix_error_mapper.a ;
# headers
local developCrossHeadersDirTokens = develop headers ;
local headerDir ;
for headerDir in config glibc os posix {
CopyDirectoryToPackage $(developCrossHeadersDirTokens)
: [ FDirName $(HAIKU_TOP) headers $(headerDir) ] ;
}
# BSD and GNU compatibility headers
for headerDir in bsd gnu {
CopyDirectoryToPackage $(developCrossHeadersDirTokens)
: [ FDirName $(HAIKU_TOP) headers compatibility $(headerDir) ] ;
}
# cpp headers
if $(HAIKU_GCC_VERSION[1]) = 2 {
# GCC 2 only -- for GCC 4 they come with the DevelopmentBase package
CopyDirectoryToPackage $(developCrossHeadersDirTokens) c++
: [ FDirName $(HAIKU_TOP) headers cpp ] : 2.95.3 ;
}
BuildHaikuPackage $(haikuCrossDevelSysrootPackage)
: haiku_cross_devel_sysroot ;
# Now create a wrapper package which just contains the actual cross
# development package. This wrapper package can safely be installed into the
# system hierarchy of the target system, from where haikuporter will fetch
# it when needed.
local haikuCrossDevelPackage
= haiku_cross_devel$(stage)_$(HAIKU_PACKAGING_ARCH).hpkg ;
HaikuPackage $(haikuCrossDevelPackage) ;
# add the wrapped package
local developCrossDirTokens = develop cross ;
AddFilesToPackage $(developCrossDirTokens)
: $(haikuCrossDevelSysrootPackage) ;
BuildHaikuPackage $(haikuCrossDevelPackage) : haiku_cross_devel ;
}
# BSD and GNU compatibility headers
for headerDir in bsd gnu {
CopyDirectoryToPackage $(developCrossHeadersDirTokens)
: [ FDirName $(HAIKU_TOP) headers compatibility $(headerDir) ] ;
}
# cpp headers
if $(HAIKU_GCC_VERSION[1]) = 2 {
# GCC 2 only -- for GCC 4 they come with the DevelopmentBase package
CopyDirectoryToPackage $(developCrossHeadersDirTokens) c++
: [ FDirName $(HAIKU_TOP) headers cpp ] : 2.95.3 ;
}
BuildHaikuPackage $(haikuCrossDevelSysrootPackage) : haiku_cross_devel_sysroot ;
# Now create a wrapper package which just contains the actual cross development
# package. This wrapper package can safely be installed into the system
# hierarchy of the target system, from where haikuporter will fetch it when
# needed.
local haikuCrossDevelPackage
= haiku_cross_devel_$(HAIKU_PACKAGING_ARCH).hpkg ;
HaikuPackage $(haikuCrossDevelPackage) ;
# add the wrapped package
local developCrossDirTokens = develop cross ;
AddFilesToPackage $(developCrossDirTokens) : $(haikuCrossDevelSysrootPackage) ;
BuildHaikuPackage $(haikuCrossDevelPackage) : haiku_cross_devel ;