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:
@@ -59,8 +59,13 @@ include [ FDirName $(HAIKU_BUILD_RULES_DIR) DefaultBuildProfiles ] ;
|
|||||||
# Include the repositories for this architecture.
|
# Include the repositories for this architecture.
|
||||||
local repositoriesDirectory
|
local repositoriesDirectory
|
||||||
= [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories ] ;
|
= [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories ] ;
|
||||||
|
local repositories = HaikuPorts ;
|
||||||
|
if $(HAIKU_BOOTSTRAP_BUILD) {
|
||||||
|
repositories = HaikuPortsCross ;
|
||||||
|
}
|
||||||
|
|
||||||
local repository ;
|
local repository ;
|
||||||
for repository in HaikuPorts {
|
for repository in $(repositories) {
|
||||||
local repositoryDirectory
|
local repositoryDirectory
|
||||||
= [ FDirName $(repositoriesDirectory) $(repository) ] ;
|
= [ FDirName $(repositoriesDirectory) $(repository) ] ;
|
||||||
local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ;
|
local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ;
|
||||||
|
|||||||
@@ -1021,7 +1021,7 @@ rule AddHaikuImagePackages packages : installationLocation
|
|||||||
HAIKU_ADDED_PACKAGES += $(package) ;
|
HAIKU_ADDED_PACKAGES += $(package) ;
|
||||||
|
|
||||||
# download the package file and add it to the image
|
# download the package file and add it to the image
|
||||||
local file = [ DownloadPackage $(package) ] ;
|
local file = [ FetchPackage $(package) ] ;
|
||||||
|
|
||||||
if $(HAIKU_UPDATE_ALL_PACKAGES) {
|
if $(HAIKU_UPDATE_ALL_PACKAGES) {
|
||||||
HAIKU_INCLUDE_IN_IMAGE on $(file) = 1 ;
|
HAIKU_INCLUDE_IN_IMAGE on $(file) = 1 ;
|
||||||
|
|||||||
+1
-1
@@ -790,7 +790,7 @@ rule ExtractBuildFeatureArchives feature : list
|
|||||||
}
|
}
|
||||||
|
|
||||||
local package = $(list[2]) ;
|
local package = $(list[2]) ;
|
||||||
local file = [ DownloadPackage $(list[3]) ] ;
|
local file = [ FetchPackage $(list[3]) ] ;
|
||||||
local fileName = $(file:BS) ;
|
local fileName = $(file:BS) ;
|
||||||
list = $(list[4-]) ;
|
list = $(list[4-]) ;
|
||||||
|
|
||||||
|
|||||||
+232
-26
@@ -1,9 +1,32 @@
|
|||||||
|
#pragma mark - Private
|
||||||
|
|
||||||
|
|
||||||
rule PackageFamily packageBaseName
|
rule PackageFamily packageBaseName
|
||||||
{
|
{
|
||||||
return $(packageBaseName:G=package-family) ;
|
return $(packageBaseName:G=package-family) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rule SetRepositoryMethod repository : methodName : method
|
||||||
|
{
|
||||||
|
HAIKU_REPOSITORY_METHOD_$(methodName) on $(repository) = $(method) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
rule InvokeRepositoryMethod repository : methodName : arg1 : arg2 : arg3 : arg4
|
||||||
|
: arg5 : arg6 : arg7
|
||||||
|
{
|
||||||
|
local method
|
||||||
|
= [ on $(repository) return $(HAIKU_REPOSITORY_METHOD_$(methodName)) ] ;
|
||||||
|
if ! $(method) {
|
||||||
|
Exit "Method" $(methodName) " not defined for repository"
|
||||||
|
$(repository) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [ $(method) $(repository) : $(arg1) : $(arg2) : $(arg3) : $(arg4)
|
||||||
|
: $(arg5) : $(arg6) : $(arg7) ] ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rule AddRepositoryPackage repository : architecture : baseName : version
|
rule AddRepositoryPackage repository : architecture : baseName : version
|
||||||
{
|
{
|
||||||
local package = $(baseName)-$(version) ;
|
local package = $(baseName)-$(version) ;
|
||||||
@@ -12,56 +35,104 @@ rule AddRepositoryPackage repository : architecture : baseName : version
|
|||||||
HAIKU_PACKAGE_ARCHITECTURE on $(package) = $(architecture) ;
|
HAIKU_PACKAGE_ARCHITECTURE on $(package) = $(architecture) ;
|
||||||
HAIKU_PACKAGE_FILE_NAME on $(package) = $(package:G=)-$(architecture).hpkg ;
|
HAIKU_PACKAGE_FILE_NAME on $(package) = $(package:G=)-$(architecture).hpkg ;
|
||||||
|
|
||||||
|
local packageFamily = [ InvokeRepositoryMethod $(repository) : PackageFamily
|
||||||
|
: $(baseName) ] ;
|
||||||
|
baseName = $(packageFamily:G=) ;
|
||||||
|
|
||||||
if ! $(baseName) in $(HAIKU_AVAILABLE_PACKAGES) {
|
if ! $(baseName) in $(HAIKU_AVAILABLE_PACKAGES) {
|
||||||
HAIKU_AVAILABLE_PACKAGES += $(baseName) ;
|
HAIKU_AVAILABLE_PACKAGES += $(baseName) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
local packageFamily = [ PackageFamily $(baseName) ] ;
|
|
||||||
HAIKU_PACKAGE_VERSIONS on $(packageFamily) += $(package) ;
|
HAIKU_PACKAGE_VERSIONS on $(packageFamily) += $(package) ;
|
||||||
HAIKU_REPOSITORY_PACKAGES on $(repository) += $(package) ;
|
HAIKU_REPOSITORY_PACKAGES on $(repository) += $(package) ;
|
||||||
|
|
||||||
|
return $(package) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rule AddRepositoryPackages repository : architecture : packages : sourcePackages
|
rule AddRepositoryPackages repository : architecture : packages : sourcePackages
|
||||||
: debugInfoPackages
|
: debugInfoPackages
|
||||||
{
|
{
|
||||||
|
local packageTargets ;
|
||||||
local package ;
|
local package ;
|
||||||
for package in $(packages) {
|
for package in $(packages) {
|
||||||
local splitName = [ Match "([^-]*)-(.*)" : $(package) ] ;
|
local splitName = [ Match "([^-]*)-(.*)" : $(package) ] ;
|
||||||
local baseName = $(splitName[1]:E=$(package)) ;
|
local baseName = $(splitName[1]:E=$(package)) ;
|
||||||
local version = $(splitName[2]) ;
|
local version = $(splitName[2]) ;
|
||||||
AddRepositoryPackage $(repository) : $(architecture) : $(baseName)
|
packageTargets += [ AddRepositoryPackage $(repository) : $(architecture)
|
||||||
: $(version) ;
|
: $(baseName) : $(version) ] ;
|
||||||
if $(baseName) in $(sourcePackages) {
|
if $(baseName) in $(sourcePackages) {
|
||||||
AddRepositoryPackage $(repository) : source : $(baseName)_source
|
AddRepositoryPackage $(repository) : source : $(baseName)_source
|
||||||
: $(version) ;
|
: $(version) ;
|
||||||
}
|
}
|
||||||
if $(baseName) in $(debugInfoPackages) {
|
if $(baseName) in $(debugInfoPackages) {
|
||||||
AddRepositoryPackage $(repository) : $(architecture)
|
packageTargets += [ AddRepositoryPackage $(repository)
|
||||||
: $(baseName)_debuginfo : $(version) ;
|
: $(architecture) : $(baseName)_debuginfo : $(version) ] ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $(packageTargets) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rule PackageRepository repository : architecture : repositoryUrl : anyPackages
|
rule PackageRepository repository : architecture : anyPackages : packages
|
||||||
: packages : sourcePackages : debugInfoPackages
|
: sourcePackages : debugInfoPackages
|
||||||
{
|
{
|
||||||
repository = $(repository:G=repository) ;
|
|
||||||
|
|
||||||
if $(architecture) != $(HAIKU_PACKAGING_ARCH) {
|
if $(architecture) != $(HAIKU_PACKAGING_ARCH) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
HAIKU_REPOSITORIES += $(repository) ;
|
HAIKU_REPOSITORIES += $(repository) ;
|
||||||
HAIKU_REPOSITORY_URL on $(repository) = $(repositoryUrl) ;
|
|
||||||
HAIKU_REPOSITORY_DEFINITION_FILE on $(repository)
|
HAIKU_REPOSITORY_DEFINITION_FILE on $(repository)
|
||||||
= $(HAIKU_REPOSITORY_JAMFILE) ;
|
= $(HAIKU_REPOSITORY_JAMFILE) ;
|
||||||
|
|
||||||
AddRepositoryPackages $(repository) : any : $(anyPackages)
|
return [ AddRepositoryPackages $(repository) : any : $(anyPackages)
|
||||||
: $(sourcePackages) : $(debugInfoPackages) ;
|
: $(sourcePackages) : $(debugInfoPackages) ]
|
||||||
AddRepositoryPackages $(repository) : $(architecture) : $(packages)
|
[ AddRepositoryPackages $(repository) : $(architecture) : $(packages)
|
||||||
: $(sourcePackages) : $(debugInfoPackages) ;
|
: $(sourcePackages) : $(debugInfoPackages) ] ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark - Remote Repository
|
||||||
|
|
||||||
|
|
||||||
|
rule RemoteRepositoryPackageFamily repository : packageBaseName
|
||||||
|
{
|
||||||
|
return [ PackageFamily $(packageBaseName) ] ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rule RemoteRepositoryFetchPackage repository : package : fileName
|
||||||
|
{
|
||||||
|
local baseUrl = [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
|
||||||
|
local packagesChecksumFile
|
||||||
|
= [ on $(repository)
|
||||||
|
return $(HAIKU_REPOSITORY_PACKAGES_CHECKSUM_FILE) ] ;
|
||||||
|
|
||||||
|
local downloadedFile = [ DownloadFile $(fileName)
|
||||||
|
: "$(baseUrl)/`cat $source`/packages/$(fileName)"
|
||||||
|
: $(packagesChecksumFile) ] ;
|
||||||
|
NoUpdate $(downloadedFile) ;
|
||||||
|
# Don't download the file again when something in the repository
|
||||||
|
# changes. It is (supposed to be) still the same file.
|
||||||
|
return $(downloadedFile) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rule RemotePackageRepository repository : architecture : repositoryUrl
|
||||||
|
: anyPackages : packages : sourcePackages : debugInfoPackages
|
||||||
|
{
|
||||||
|
repository = $(repository:G=repository) ;
|
||||||
|
|
||||||
|
SetRepositoryMethod $(repository) : PackageFamily
|
||||||
|
: RemoteRepositoryPackageFamily ;
|
||||||
|
SetRepositoryMethod $(repository) : FetchPackage
|
||||||
|
: RemoteRepositoryFetchPackage ;
|
||||||
|
|
||||||
|
HAIKU_REPOSITORY_URL on $(repository) = $(repositoryUrl) ;
|
||||||
|
|
||||||
|
PackageRepository $(repository) : $(architecture) : $(anyPackages)
|
||||||
|
: $(packages) : $(sourcePackages) : $(debugInfoPackages) ;
|
||||||
|
|
||||||
# build package list file
|
# build package list file
|
||||||
local packageListFile = $(repository:G=repository-package-list)-packages ;
|
local packageListFile = $(repository:G=repository-package-list)-packages ;
|
||||||
@@ -152,6 +223,150 @@ actions RepositoryConfig1
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark - Bootstrap Repository
|
||||||
|
|
||||||
|
|
||||||
|
rule BootstrapRepositoryPackageFamily repository : packageBaseName
|
||||||
|
{
|
||||||
|
local splitBaseName = [ Match "(.*)_bootstrap(.*)" : $(packageBaseName) ] ;
|
||||||
|
if $(splitBaseName) {
|
||||||
|
packageBaseName = $(splitBaseName[1])$(splitBaseName[2]) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [ PackageFamily $(packageBaseName) ] ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rule BootstrapRepositoryFetchPackage repository : package : fileName
|
||||||
|
{
|
||||||
|
local outputDir
|
||||||
|
= [ on $(repository) return $(HAIKU_REPOSITORY_BUILD_DIRECTORY) ] ;
|
||||||
|
local configFile
|
||||||
|
= [ on $(repository) return $(HAIKU_REPOSITORY_BUILD_CONFIG_FILE) ] ;
|
||||||
|
local haikuCrossDevelPackage = [ on $(package)
|
||||||
|
return $(HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGE) ] ;
|
||||||
|
|
||||||
|
local packageFile = <cross-built>$(fileName) ;
|
||||||
|
MakeLocate $(packageFile) : [ FDirName $(outputDir) packages ] ;
|
||||||
|
NoUpdate $(packageFile) ;
|
||||||
|
# Don't rebuild the file. Since the haiku cross devel package is
|
||||||
|
# a dependency and is updated always, this package would otherwise be
|
||||||
|
# rebuilt always as well.
|
||||||
|
|
||||||
|
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(packageFile) = $(outputDir) ;
|
||||||
|
|
||||||
|
Depends $(packageFile) : $(haikuCrossDevelPackage) $(configFile) ;
|
||||||
|
BootstrapRepositoryFetchPackage1 $(packageFile)
|
||||||
|
: $(haikuCrossDevelPackage) ;
|
||||||
|
|
||||||
|
return $(packageFile) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
actions BootstrapRepositoryFetchPackage1
|
||||||
|
{
|
||||||
|
# don't rebuild existing package
|
||||||
|
package="$(1)"
|
||||||
|
if [ -e "$package" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# make Haiku cross devel package path absolute
|
||||||
|
haikuCrossDevelPackage="$(2)"
|
||||||
|
if [[ "$haikuCrossDevelPackage" != /* ]]; then
|
||||||
|
haikuCrossDevelPackage="`pwd`/$haikuCrossDevelPackage"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# determine the portName
|
||||||
|
portName=`basename "$package" | sed 's@-.*@@'`
|
||||||
|
case $portName in
|
||||||
|
*_devel|*_doc|*_source|*_debuginfo)
|
||||||
|
portName=`echo $portName | sed 's@_[^_]*$@@'`
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cd $(HAIKU_REPOSITORY_BUILD_DIRECTORY)
|
||||||
|
|
||||||
|
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
||||||
|
$(HOST_HAIKU_PORTER) --cross-devel-package "$haikuCrossDevelPackage" \
|
||||||
|
$portName
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
actions BuildBootstrapRepositoryConfig
|
||||||
|
{
|
||||||
|
cat > $(1) << EOF
|
||||||
|
PACKAGER="The Haiku build system <[email protected]>"
|
||||||
|
TREE_PATH="$(HAIKU_PORTS_CROSS)"
|
||||||
|
TARGET_ARCHITECTURE="$(HAIKU_PACKAGING_ARCH)"
|
||||||
|
|
||||||
|
DOWNLOAD_IN_PORT_DIRECTORY="yes"
|
||||||
|
PACKAGE_COMMAND="$(2[1])"
|
||||||
|
MIMESET_COMMAND="$(2[2])"
|
||||||
|
SYSTEM_MIME_DB="$(2[3])"
|
||||||
|
LICENSES_DIRECTORY="$(HAIKU_TOP)/data/system/data/licenses"
|
||||||
|
OUTPUT_DIRECTORY="$(HAIKU_REPOSITORY_BUILD_DIRECTORY)"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# If we have cross tools, add the cross tools directory.
|
||||||
|
gcc=$(HAIKU_CC)
|
||||||
|
if [[ "$gcc" = /* ]]; then
|
||||||
|
if [ `basename $gcc` = $(HAIKU_GCC_MACHINE)-gcc ]; then
|
||||||
|
dir=`dirname $gcc`
|
||||||
|
dir=`dirname $dir`
|
||||||
|
echo CROSS_TOOLS="$dir" >> $(1)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rule BootstrapPackageRepository repository : architecture
|
||||||
|
: anyPackages : packagesStage1 : packagesStage2 : sourcePackages
|
||||||
|
: debugInfoPackages
|
||||||
|
{
|
||||||
|
repository = $(repository:G=repository) ;
|
||||||
|
|
||||||
|
SetRepositoryMethod $(repository) : PackageFamily
|
||||||
|
: BootstrapRepositoryPackageFamily ;
|
||||||
|
SetRepositoryMethod $(repository) : FetchPackage
|
||||||
|
: BootstrapRepositoryFetchPackage ;
|
||||||
|
|
||||||
|
# register repository with stage 1 packages
|
||||||
|
local packageTargets = [ PackageRepository $(repository) : $(architecture)
|
||||||
|
: $(anyPackages) : $(packagesStage1) : $(sourcePackages)
|
||||||
|
: $(debugInfoPackages) ] ;
|
||||||
|
if ! $(packageTargets) {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGE on $(packageTargets)
|
||||||
|
= haiku_cross_devel_sysroot_stage1_$(HAIKU_PACKAGING_ARCH).hpkg ;
|
||||||
|
|
||||||
|
# add stage 2 packages
|
||||||
|
packageTargets = [ AddRepositoryPackages $(repository) : $(architecture)
|
||||||
|
: $(packagesStage2) : $(sourcePackages) : $(debugInfoPackages) ] ;
|
||||||
|
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGE on $(packageTargets)
|
||||||
|
= haiku_cross_devel_sysroot_$(HAIKU_PACKAGING_ARCH).hpkg ;
|
||||||
|
|
||||||
|
# prepare the config file for the HaikuPorts cross build
|
||||||
|
local outputDir = [ FDirName $(HAIKU_PACKAGE_REPOSITORIES_DIR)
|
||||||
|
$(repository:G=)-build ] ;
|
||||||
|
local configFile = haikuports.conf ;
|
||||||
|
configFile = $(configFile:G=repository-config-$(repository:G=)) ;
|
||||||
|
MakeLocate $(configFile) : $(outputDir) ;
|
||||||
|
NoUpdate $(configFile) ;
|
||||||
|
Depends $(configFile) : <build>package <build>mimeset <mimedb>mime_db ;
|
||||||
|
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(configFile) = $(outputDir) ;
|
||||||
|
BuildBootstrapRepositoryConfig $(configFile)
|
||||||
|
: <build>package <build>mimeset <mimedb>mime_db ;
|
||||||
|
|
||||||
|
HAIKU_REPOSITORY_BUILD_CONFIG_FILE on $(repository) = $(configFile) ;
|
||||||
|
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(repository) = $(outputDir) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark - Public
|
||||||
|
|
||||||
|
|
||||||
rule IsPackageAvailable package
|
rule IsPackageAvailable package
|
||||||
{
|
{
|
||||||
if $(package) in $(HAIKU_AVAILABLE_PACKAGES) {
|
if $(package) in $(HAIKU_AVAILABLE_PACKAGES) {
|
||||||
@@ -162,7 +377,7 @@ rule IsPackageAvailable package
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rule DownloadPackage packageName
|
rule FetchPackage packageName
|
||||||
{
|
{
|
||||||
if ! [ IsPackageAvailable $(packageName) ] {
|
if ! [ IsPackageAvailable $(packageName) ] {
|
||||||
Exit "DownloadPackage: package" $(packageName) "not available!" ;
|
Exit "DownloadPackage: package" $(packageName) "not available!" ;
|
||||||
@@ -177,16 +392,7 @@ rule DownloadPackage packageName
|
|||||||
= [ on $(packageFamily) return $(HAIKU_PACKAGE_VERSIONS[1]) ] ;
|
= [ on $(packageFamily) return $(HAIKU_PACKAGE_VERSIONS[1]) ] ;
|
||||||
local fileName = [ on $(package) return $(HAIKU_PACKAGE_FILE_NAME) ] ;
|
local fileName = [ on $(package) return $(HAIKU_PACKAGE_FILE_NAME) ] ;
|
||||||
local repository = [ on $(package) return $(HAIKU_PACKAGE_REPOSITORY) ] ;
|
local repository = [ on $(package) return $(HAIKU_PACKAGE_REPOSITORY) ] ;
|
||||||
local baseUrl = [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
|
|
||||||
local packagesChecksumFile
|
|
||||||
= [ on $(repository)
|
|
||||||
return $(HAIKU_REPOSITORY_PACKAGES_CHECKSUM_FILE) ] ;
|
|
||||||
|
|
||||||
local downloadedFile = [ DownloadFile $(fileName)
|
return [ InvokeRepositoryMethod $(repository) : FetchPackage : $(package)
|
||||||
: "$(baseUrl)/`cat $source`/packages/$(fileName)"
|
: $(fileName) ] ;
|
||||||
: $(packagesChecksumFile) ] ;
|
|
||||||
NoUpdate $(downloadedFile) ;
|
|
||||||
# Don't download the file again when something in the repository
|
|
||||||
# changes. It is (supposed to be) still the same file.
|
|
||||||
return $(downloadedFile) ;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ if $(HOST_RM_ATTRS_TARGET) {
|
|||||||
# always want to do that in non-update mode, but also in update mode when all
|
# always want to do that in non-update mode, but also in update mode when all
|
||||||
# packages are updated.
|
# packages are updated.
|
||||||
local resolvePackageDependencies ;
|
local resolvePackageDependencies ;
|
||||||
if ! [ IsUpdateHaikuImageOnly ] || $(HAIKU_UPDATE_ALL_PACKAGES) {
|
if ( ! [ IsUpdateHaikuImageOnly ] || $(HAIKU_UPDATE_ALL_PACKAGES) )
|
||||||
|
&& ! $(HAIKU_BOOTSTRAP_BUILD) {
|
||||||
resolvePackageDependencies = 1 ;
|
resolvePackageDependencies = 1 ;
|
||||||
}
|
}
|
||||||
AddVariableToScript $(script) : resolvePackageDependencies
|
AddVariableToScript $(script) : resolvePackageDependencies
|
||||||
|
|||||||
@@ -4,73 +4,82 @@
|
|||||||
# The main use of this package is to provide HaikuPorter with a development
|
# The main use of this package is to provide HaikuPorter with a development
|
||||||
# environment for a cross-build Haiku platform.
|
# 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
|
local stage ;
|
||||||
= haiku_cross_devel_sysroot_$(HAIKU_PACKAGING_ARCH).hpkg ;
|
for stage in _stage1 "" {
|
||||||
HaikuPackage $(haikuCrossDevelSysrootPackage) ;
|
# 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
|
local developCrossLibDirTokens = develop lib ;
|
||||||
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
|
|
||||||
;
|
|
||||||
|
|
||||||
# kernel
|
# glue code
|
||||||
AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ;
|
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
|
# kernel
|
||||||
AddLibrariesToPackage $(developCrossLibDirTokens) :
|
AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ;
|
||||||
libbsd.so
|
|
||||||
<revisioned>libroot.so
|
|
||||||
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
|
|
||||||
;
|
|
||||||
|
|
||||||
# static libraries
|
# libraries
|
||||||
AddFilesToPackage $(developCrossLibDirTokens) : liblocalestub.a ;
|
AddLibrariesToPackage $(developCrossLibDirTokens) :
|
||||||
|
libbsd.so
|
||||||
|
<revisioned>libroot.so
|
||||||
|
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
|
||||||
|
$(additionalLibraries$(stage))
|
||||||
|
;
|
||||||
|
|
||||||
# the POSIX error code mapper library
|
# static libraries
|
||||||
AddFilesToPackage $(developCrossLibDirTokens) : libposix_error_mapper.a ;
|
AddFilesToPackage $(developCrossLibDirTokens) : liblocalestub.a ;
|
||||||
|
|
||||||
# headers
|
# the POSIX error code mapper library
|
||||||
local developCrossHeadersDirTokens = develop headers ;
|
AddFilesToPackage $(developCrossLibDirTokens) : libposix_error_mapper.a ;
|
||||||
local headerDir ;
|
|
||||||
for headerDir in config glibc os posix {
|
# headers
|
||||||
CopyDirectoryToPackage $(developCrossHeadersDirTokens)
|
local developCrossHeadersDirTokens = develop headers ;
|
||||||
: [ FDirName $(HAIKU_TOP) headers $(headerDir) ] ;
|
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 ;
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
PackageRepository HaikuPorts
|
RemotePackageRepository HaikuPorts
|
||||||
: x86_gcc2
|
: x86_gcc2
|
||||||
: http://haiku-files.org/files/repo
|
: http://haiku-files.org/files/repo
|
||||||
:
|
:
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
BootstrapPackageRepository HaikuPortsCross
|
||||||
|
: x86_gcc2
|
||||||
|
:
|
||||||
|
# architecture "any" packages
|
||||||
|
:
|
||||||
|
# repository architecture packages (stage 1)
|
||||||
|
autoconf_bootstrap-2.69-1
|
||||||
|
automake_bootstrap-1.13.1-1
|
||||||
|
binutils_bootstrap-2.17_2013_04_21-2
|
||||||
|
bison_bootstrap-2.4.3-1
|
||||||
|
flex_bootstrap-2.5.35-1
|
||||||
|
freetype_bootstrap-2.4.9-1
|
||||||
|
freetype_bootstrap_devel-2.4.9-1
|
||||||
|
gcc_bootstrap-2.95.3_2013_07_15-2
|
||||||
|
grep_bootstrap-2.14-1
|
||||||
|
# TODO: No actual ICU bootstrap recipe yet.
|
||||||
|
icu_bootstrap-4.8.1.1-3
|
||||||
|
icu_bootstrap_devel-4.8.1.1-3
|
||||||
|
libtool_bootstrap-2.4-8
|
||||||
|
libtool_bootstrap_libltdl-2.4-8
|
||||||
|
m4_bootstrap-1.4.16-1
|
||||||
|
make_bootstrap-3.82-1
|
||||||
|
makeinfo_bootstrap-4.13a-1
|
||||||
|
ncurses_bootstrap-5.9-1
|
||||||
|
ncurses_bootstrap_devel-5.9-1
|
||||||
|
python_bootstrap-2.6.8-1
|
||||||
|
sed_bootstrap-4.2.1-1
|
||||||
|
# Available, but probably not needed:
|
||||||
|
# texinfo_bootstrap-4.13a-1
|
||||||
|
zlib_bootstrap-1.2.8-2
|
||||||
|
zlib_bootstrap_devel-1.2.8-2
|
||||||
|
:
|
||||||
|
# repository architecture packages (stage 2)
|
||||||
|
libsolv_bootstrap-0.3.0_haiku_2013_06_16-1
|
||||||
|
libsolv_bootstrap_devel-0.3.0_haiku_2013_06_16-1
|
||||||
|
:
|
||||||
|
# source packages
|
||||||
|
autoconf_bootstrap
|
||||||
|
automake_bootstrap
|
||||||
|
binutils_bootstrap
|
||||||
|
bison_bootstrap
|
||||||
|
flex_bootstrap
|
||||||
|
freetype_bootstrap
|
||||||
|
gawk_bootstrap
|
||||||
|
gcc_bootstrap
|
||||||
|
grep_bootstrap
|
||||||
|
libsolv_bootstrap
|
||||||
|
libtool_bootstrap
|
||||||
|
m4_bootstrap
|
||||||
|
make_bootstrap
|
||||||
|
makeinfo_bootstrap
|
||||||
|
ncurses_bootstrap
|
||||||
|
python_bootstrap
|
||||||
|
sed_bootstrap
|
||||||
|
texinfo_bootstrap
|
||||||
|
zlib_bootstrap
|
||||||
|
:
|
||||||
|
# debuginfo packages
|
||||||
|
;
|
||||||
@@ -12,6 +12,16 @@ usage()
|
|||||||
|
|
||||||
Usage: $0 <options>
|
Usage: $0 <options>
|
||||||
options:
|
options:
|
||||||
|
--bootstrap <haikuporter> <HaikuPorts cross repo> <HaikuPorts repo>
|
||||||
|
Prepare for a bootstrap build. No pre-built
|
||||||
|
packages will be used, instead they will be built
|
||||||
|
from the sources (in several phases).
|
||||||
|
<haikuporter> is the path to the haikuporter tool
|
||||||
|
suitable for the host platform.
|
||||||
|
<HaikuPorts cross repo> is the path to a checked
|
||||||
|
out HaikuPorts cross-compilation repository.
|
||||||
|
<HaikuPorts repo> is the path to a checked out
|
||||||
|
HaikuPorts repository.
|
||||||
--build-cross-tools <build tools dir>
|
--build-cross-tools <build tools dir>
|
||||||
Assume cross compilation. <build tools dir>
|
Assume cross compilation. <build tools dir>
|
||||||
defines the location of the build tools sources.
|
defines the location of the build tools sources.
|
||||||
@@ -135,6 +145,19 @@ assertparams()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# absolute_path
|
||||||
|
#
|
||||||
|
# returns the absolute path of a given path.
|
||||||
|
#
|
||||||
|
absolute_path()
|
||||||
|
{
|
||||||
|
if [[ "$1" == /* ]]; then
|
||||||
|
echo "$1"
|
||||||
|
else
|
||||||
|
echo "`pwd`/$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# real_path
|
# real_path
|
||||||
#
|
#
|
||||||
# returns the realpath of a symbolic link.
|
# returns the realpath of a symbolic link.
|
||||||
@@ -376,6 +399,9 @@ HOST_GCC_OBJCOPY=`gcc -print-prog-name=objcopy`
|
|||||||
SFDISK_BINARY=sfdisk
|
SFDISK_BINARY=sfdisk
|
||||||
HOST_SFDISK=$SFDISK_BINARY
|
HOST_SFDISK=$SFDISK_BINARY
|
||||||
HOST_SHA256=
|
HOST_SHA256=
|
||||||
|
HOST_HAIKU_PORTER=
|
||||||
|
HAIKU_PORTS=
|
||||||
|
HAIKU_PORTS_CROSS=
|
||||||
|
|
||||||
if sha256sum < /dev/null > /dev/null 2>&1; then
|
if sha256sum < /dev/null > /dev/null 2>&1; then
|
||||||
HOST_SHA256=sha256sum
|
HOST_SHA256=sha256sum
|
||||||
@@ -438,6 +464,13 @@ fi
|
|||||||
#
|
#
|
||||||
while [ $# -gt 0 ] ; do
|
while [ $# -gt 0 ] ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
--bootstrap)
|
||||||
|
assertparams "$1" 3 $#
|
||||||
|
HOST_HAIKU_PORTER="`absolute_path $2`"
|
||||||
|
HAIKU_PORTS_CROSS="`absolute_path $3`"
|
||||||
|
HAIKU_PORTS="`absolute_path $4`"
|
||||||
|
shift 4
|
||||||
|
;;
|
||||||
--build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;;
|
--build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;;
|
||||||
--build-cross-tools-gcc4)
|
--build-cross-tools-gcc4)
|
||||||
assertparams "$1" 2 $#
|
assertparams "$1" 2 $#
|
||||||
@@ -449,7 +482,7 @@ while [ $# -gt 0 ] ; do
|
|||||||
ppc) HAIKU_GCC_MACHINE=powerpc-apple-haiku;;
|
ppc) HAIKU_GCC_MACHINE=powerpc-apple-haiku;;
|
||||||
m68k) HAIKU_GCC_MACHINE=m68k-unknown-haiku;;
|
m68k) HAIKU_GCC_MACHINE=m68k-unknown-haiku;;
|
||||||
arm) HAIKU_GCC_MACHINE=arm-unknown-haiku;;
|
arm) HAIKU_GCC_MACHINE=arm-unknown-haiku;;
|
||||||
mipsel) HAIKU_GCC_MACHINE=mipsel-unknown-haiku;
|
mipsel) HAIKU_GCC_MACHINE=mipsel-unknown-haiku;;
|
||||||
*) echo "Unsupported target architecture: $2"
|
*) echo "Unsupported target architecture: $2"
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
@@ -664,6 +697,10 @@ HOST_OBJCOPY ?= ${HOST_GCC_OBJCOPY} ;
|
|||||||
HOST_SFDISK ?= ${HOST_SFDISK} ;
|
HOST_SFDISK ?= ${HOST_SFDISK} ;
|
||||||
HOST_SHA256 ?= ${HOST_SHA256} ;
|
HOST_SHA256 ?= ${HOST_SHA256} ;
|
||||||
|
|
||||||
|
HOST_HAIKU_PORTER ?= ${HOST_HAIKU_PORTER} ;
|
||||||
|
HAIKU_PORTS ?= ${HAIKU_PORTS} ;
|
||||||
|
HAIKU_PORTS_CROSS ?= ${HAIKU_PORTS_CROSS} ;
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Libgcc.a objects
|
# Libgcc.a objects
|
||||||
|
|||||||
Reference in New Issue
Block a user