haiku/build/jam/RepositoryRules

657 lines
20 KiB
Plaintext
Raw Normal View History

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.
2013-07-21 06:10:48 +04:00
#pragma mark - Private
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
rule PackageFamily packageBaseName
{
return $(packageBaseName:G=package-family) ;
}
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.
2013-07-21 06:10:48 +04:00
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) ] ;
}
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
rule AddRepositoryPackage repository : architecture : baseName : version
{
local package = $(baseName)-$(version) ;
package = $(package:E=$(baseName):G=package-in-$(repository:G=)) ;
HAIKU_PACKAGE_REPOSITORY on $(package) = $(repository) ;
HAIKU_PACKAGE_ARCHITECTURE on $(package) = $(architecture) ;
HAIKU_PACKAGE_FILE_NAME on $(package) = $(package:G=)-$(architecture).hpkg ;
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.
2013-07-21 06:10:48 +04:00
local packageFamily = [ InvokeRepositoryMethod $(repository) : PackageFamily
: $(baseName) ] ;
baseName = $(packageFamily:G=) ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
if ! $(baseName) in $(HAIKU_AVAILABLE_PACKAGES) {
HAIKU_AVAILABLE_PACKAGES += $(baseName) ;
}
HAIKU_PACKAGE_VERSIONS on $(packageFamily) += $(package) ;
HAIKU_REPOSITORY_PACKAGES on $(repository) += $(package) ;
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.
2013-07-21 06:10:48 +04:00
return $(package) ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
}
rule AddRepositoryPackages repository : architecture : packages : sourcePackages
: debugInfoPackages
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
{
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.
2013-07-21 06:10:48 +04:00
local packageTargets ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
local package ;
for package in $(packages) {
local splitName = [ Match "([^-]*)-(.*)" : $(package) ] ;
local baseName = $(splitName[1]:E=$(package)) ;
local version = $(splitName[2]) ;
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.
2013-07-21 06:10:48 +04:00
packageTargets += [ AddRepositoryPackage $(repository) : $(architecture)
: $(baseName) : $(version) ] ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
if $(baseName) in $(sourcePackages) {
AddRepositoryPackage $(repository) : source : $(baseName)_source
: $(version) ;
}
if $(baseName) in $(debugInfoPackages) {
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.
2013-07-21 06:10:48 +04:00
packageTargets += [ AddRepositoryPackage $(repository)
: $(architecture) : $(baseName)_debuginfo : $(version) ] ;
}
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
}
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.
2013-07-21 06:10:48 +04:00
return $(packageTargets) ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
}
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.
2013-07-21 06:10:48 +04:00
rule PackageRepository repository : architecture : anyPackages : packages
: sourcePackages : debugInfoPackages
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
{
if $(architecture) != $(HAIKU_PACKAGING_ARCHS[1]) {
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
return ;
}
HAIKU_REPOSITORIES += $(repository) ;
HAIKU_REPOSITORY_DEFINITION_FILE on $(repository)
= $(HAIKU_REPOSITORY_JAMFILE) ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
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.
2013-07-21 06:10:48 +04:00
return [ AddRepositoryPackages $(repository) : any : $(anyPackages)
: $(sourcePackages) : $(debugInfoPackages) ]
[ AddRepositoryPackages $(repository) : $(architecture) : $(packages)
: $(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
local packageListFile = $(repository:G=repository-package-list)-packages ;
local repositoriesDir = $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture)) ;
MakeLocate $(packageListFile) : $(repositoriesDir) ;
GeneratedRepositoryPackageList $(packageListFile) : $(repository) ;
# build package list checksum file
local packagesChecksumFile
= $(repository:G=repository-package-checksum)-checksum ;
MakeLocate $(packagesChecksumFile) : $(repositoriesDir) ;
Depends $(packagesChecksumFile) : $(packageListFile) ;
ChecksumFileSHA256 $(packagesChecksumFile) : $(packageListFile) ;
# download repository info file
local repositoryInfo = $(repository:G=repository-info)-info ;
MakeLocate $(repositoryInfo) : $(repositoriesDir) ;
local repoUrl = [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
DownloadLocatedFile $(repositoryInfo)
: "$(repoUrl)/`cat $source`/repo.info"
: $(packagesChecksumFile) ;
# download repository file
local repositoryFile = $(repository:G=repository-cache) ;
MakeLocate $(repositoryFile) : $(repositoriesDir) ;
local repoUrl = [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
DownloadLocatedFile $(repositoryFile)
: "$(repoUrl)/`cat $source`/repo"
: $(packagesChecksumFile) ;
# build repository config file
local repositoryConfig = $(repository:G=repository-config)-config ;
MakeLocate $(repositoryConfig) : $(repositoriesDir) ;
RepositoryConfig $(repositoryConfig) : $(repositoryInfo)
: $(packagesChecksumFile) : $(repository) ;
HAIKU_REPOSITORY_CACHE_FILE on $(repository) = $(repositoryFile) ;
HAIKU_REPOSITORY_CONFIG_FILE on $(repository) = $(repositoryConfig) ;
HAIKU_REPOSITORY_PACKAGES_CHECKSUM_FILE on $(repository)
= $(packagesChecksumFile) ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
}
rule GeneratedRepositoryPackageList target : repository
{
repository = $(repository:G=repository) ;
# construct a list of file names
local fileNames ;
local package ;
for package in [ on $(repository) return $(HAIKU_REPOSITORY_PACKAGES) ] {
fileNames += [ on $(package) return $(HAIKU_PACKAGE_FILE_NAME) ] ;
}
local definitionFile
= [ on $(repository) return $(HAIKU_REPOSITORY_DEFINITION_FILE) ] ;
Depends $(target) : $(definitionFile) ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
HAIKU_REPOSITORY_PACKAGE_FILE_NAMES on $(target) = $(fileNames) ;
GeneratedRepositoryPackageList1 $(target) ;
}
actions GeneratedRepositoryPackageList1
{
(for file in $(HAIKU_REPOSITORY_PACKAGE_FILE_NAMES) ; do
echo $file
done) | LC_ALL=C sort -u > $(1)
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
}
rule RepositoryConfig repoConfig : repoInfo : packagesChecksumFile : repository
{
repository = $(repository:G=repository) ;
HAIKU_REPOSITORY_URL on $(repoConfig)
= [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
Depends $(repoConfig)
: <build>create_repository_config $(repoInfo) $(packagesChecksumFile) ;
RepositoryConfig1 $(repoConfig)
: <build>create_repository_config $(repoInfo) $(packagesChecksumFile) ;
}
actions RepositoryConfig1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) $(HAIKU_REPOSITORY_URL)/`cat $(2[3])` $(2[2]) $(1)
}
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.
2013-07-21 06:10:48 +04:00
#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) ] ;
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
local haikuCrossDevelPackages = [ on $(package)
return $(HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES) ] ;
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.
2013-07-21 06:10:48 +04:00
local packageFile = <cross-built>$(fileName) ;
if [ on $(packageFile) return $(HAIKU_REPOSITORY_BUILD_DIRECTORY) ] {
# rule already called for this package
return $(packageFile) ;
}
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(packageFile) = $(outputDir) ;
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.
2013-07-21 06:10:48 +04:00
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.
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
Depends $(packageFile) : $(haikuCrossDevelPackages) $(configFile) ;
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.
2013-07-21 06:10:48 +04:00
BootstrapRepositoryFetchPackage1 $(packageFile)
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
: $(haikuCrossDevelPackages) ;
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.
2013-07-21 06:10:48 +04:00
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
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
haikuCrossDevelPackage="$(2[1])"
if [ "x$haikuCrossDevelPackage" = "x${haikuCrossDevelPackage#/}" ]; then
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.
2013-07-21 06:10:48 +04:00
haikuCrossDevelPackage="`pwd`/$haikuCrossDevelPackage"
fi
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
# make secondary Haiku cross devel packages path absolute
secondaryCrossDevelPackages=
if [ -n "$(2[2-]:J)" ]; then
for secondaryCrossDevelPackage in "$(2[2-])" ; do
if [ "x$secondaryCrossDevelPackage" = "x${secondaryCrossDevelPackage#/}" ]; then
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
secondaryCrossDevelPackage="`pwd`/$secondaryCrossDevelPackage"
fi
if [ -n "$secondaryCrossDevelPackages" ]; then
secondaryCrossDevelPackages="secondaryCrossDevelPackages,$secondaryCrossDevelPackage"
else
secondaryCrossDevelPackages="--secondary-cross-devel-package=$secondaryCrossDevelPackage"
fi
done
fi
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.
2013-07-21 06:10:48 +04:00
# determine the portName
portName=`basename "$package" | sed 's@-.*@@'`
case $portName in
*_devel|*_doc|*_source|*_debuginfo)
portName=`echo $portName | sed 's@_[^_]*$@@'`
;;
*_source_rigged)
portName=`echo $portName | sed 's@_source_rigged$@@'`
;;
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.
2013-07-21 06:10:48 +04:00
esac
cd $(HAIKU_REPOSITORY_BUILD_DIRECTORY)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
if [ -n "$secondaryCrossDevelPackages" ]; then
$(HOST_HAIKU_PORTER) -j$(HAIKU_PORTER_CONCURRENT_JOBS) \
--cross-devel-package "$haikuCrossDevelPackage" \
"$secondaryCrossDevelPackages" $portName
else
$(HOST_HAIKU_PORTER) -j$(HAIKU_PORTER_CONCURRENT_JOBS) \
--cross-devel-package "$haikuCrossDevelPackage" $portName
fi
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.
2013-07-21 06:10:48 +04:00
}
actions BuildBootstrapRepositoryConfig
{
cat > $(1) << EOF
PACKAGER="The Haiku build system <build-system@haiku-os.org>"
TREE_PATH="$(HAIKU_REPOSITORY_TREE_PATH)"
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.
2013-07-21 06:10:48 +04:00
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_$(HAIKU_PACKAGING_ARCH))
if [ "x$gcc" != "x${gcc#/}" ]; then
if [ `basename $gcc` = \
$(HAIKU_GCC_MACHINE_$(HAIKU_PACKAGING_ARCH))-gcc ]; then
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.
2013-07-21 06:10:48 +04:00
dir=`dirname $gcc`
dir=`dirname $dir`
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
echo CROSS_TOOLS=\"$dir\" >> $(1)
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.
2013-07-21 06:10:48 +04:00
fi
fi
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
# Add secondary architectures and cross tools.
secondaryArchs="$(HAIKU_PACKAGING_ARCHS[2-]:E=)"
if [ -n "$secondaryArchs" ]; then
echo SECONDARY_TARGET_ARCHITECTURES=\" >> $(1)
for arch in $secondaryArchs; do
echo " $arch" >> $(1)
done
echo \" >> $(1)
echo SECONDARY_CROSS_TOOLS=\" >> $(1)
for gcc in $(HAIKU_CC_$(HAIKU_PACKAGING_ARCHS[2-])) ; do
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
dir=`dirname $gcc`
dir=`dirname $dir`
echo " $dir" >> $(1)
done
echo \" >> $(1)
fi
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.
2013-07-21 06:10:48 +04:00
}
rule BootstrapPackageRepository repository : architecture
: anyPackages : packagesStage1 : packagesStage2 : sourcePackages
: debugInfoPackages
{
repository = $(repository:G=repository) ;
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
packagesStage1 = [ FFilterByBuildFeatures $(packagesStage1) ] ;
packagesStage2 = [ FFilterByBuildFeatures $(packagesStage2) ] ;
sourcePackages = [ FFilterByBuildFeatures $(sourcePackages) ] ;
debugInfoPackages = [ FFilterByBuildFeatures $(debugInfoPackages) ] ;
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.
2013-07-21 06:10:48 +04:00
SetRepositoryMethod $(repository) : PackageFamily
: BootstrapRepositoryPackageFamily ;
SetRepositoryMethod $(repository) : FetchPackage
: BootstrapRepositoryFetchPackage ;
# register repository with stage 1 packages
local stage1PackageTargets = [ PackageRepository $(repository)
: $(architecture) : $(anyPackages) : $(packagesStage1)
: $(sourcePackages) : $(debugInfoPackages) ] ;
if ! $(stage1PackageTargets) {
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.
2013-07-21 06:10:48 +04:00
return ;
}
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
local crossDevelPackageSuffixes = $(architecture)
$(architecture)_$(HAIKU_PACKAGING_ARCHS[2-]) ;
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage1PackageTargets)
= haiku_cross_devel_sysroot_stage1_$(crossDevelPackageSuffixes).hpkg ;
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.
2013-07-21 06:10:48 +04:00
# add stage 2 packages
local stage2PackageTargets = [ AddRepositoryPackages $(repository)
: $(architecture) : $(packagesStage2) : $(sourcePackages)
: $(debugInfoPackages) ] ;
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage2PackageTargets)
= haiku_cross_devel_sysroot_$(crossDevelPackageSuffixes).hpkg ;
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.
2013-07-21 06:10:48 +04:00
# prepare the config file for the HaikuPorts cross build
local outputDir = [ FDirName
$(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture))
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.
2013-07-21 06:10:48 +04:00
$(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) ;
HAIKU_PACKAGING_ARCH on $(configFile) = $(architecture) ;
HAIKU_REPOSITORY_TREE_PATH on $(configFile) = $(HAIKU_PORTS_CROSS) ;
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.
2013-07-21 06:10:48 +04:00
BuildBootstrapRepositoryConfig $(configFile)
: <build>package <build>mimeset <mimedb>mime_db ;
HAIKU_REPOSITORY_BUILD_CONFIG_FILE on $(repository) = $(configFile) ;
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(repository) = $(outputDir) ;
# Serialize all package file targets. We need to do this, since
# haikuporter uses a common directory for building the ports, so building
# two ports concurrently isn't possible.
local previousPackageFile ;
local package ;
for package in $(stage1PackageTargets) $(stage2PackageTargets) {
local fileName = [ on $(package) return $(HAIKU_PACKAGE_FILE_NAME) ] ;
local packageFile = [ BootstrapRepositoryFetchPackage $(repository)
: $(package) : $(fileName) ] ;
Depends $(packageFile) : $(previousPackageFile) ;
previousPackageFile = $(packageFile) ;
}
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.
2013-07-21 06:10:48 +04:00
}
#pragma mark - Public
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
rule FSplitPackageName packageName
{
local splitName = [ Match "(.*)_([^_]*)" : $(packageName) ] ;
local knownPackageSuffixes = devel doc source debuginfo ;
if $(splitName[2]) && $(splitName[2]) in $(knownPackageSuffixes) {
return $(splitName) ;
}
return $(packageName) ;
}
rule IsPackageAvailable package : flags
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
{
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
# for a secondary architecture adjust the package name
if $(TARGET_PACKAGING_ARCH) != $(TARGET_PACKAGING_ARCHS[1])
&& ! nameResolved in $(flags) {
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
local splitName = [ FSplitPackageName $(package) ] ;
splitName = $(splitName[1]) $(TARGET_PACKAGING_ARCH) $(splitName[2-]) ;
package = $(splitName:J=_) ;
}
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
if $(package) in $(HAIKU_AVAILABLE_PACKAGES) {
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
return $(package) ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
}
return ;
}
rule FetchPackage packageName : flags
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
{
local foundPackageName = [ IsPackageAvailable $(packageName) : $(flags) ] ;
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
if ! $(foundPackageName) {
Exit "DownloadPackage: package" $(packageName) "not available!" ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
return ;
}
build features/bootstrap repo: support secondary arch * Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
2013-08-05 09:09:45 +04:00
packageName = $(foundPackageName) ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
# TODO: We should support explicitly specified versions (or partial/minimum
# versions like gcc-2 or gcc-4).
local packageFamily = [ PackageFamily $(packageName) ] ;
local package
= [ on $(packageFamily) return $(HAIKU_PACKAGE_VERSIONS[1]) ] ;
local fileName = [ on $(package) return $(HAIKU_PACKAGE_FILE_NAME) ] ;
local repository = [ on $(package) return $(HAIKU_PACKAGE_REPOSITORY) ] ;
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.
2013-07-21 06:10:48 +04:00
return [ InvokeRepositoryMethod $(repository) : FetchPackage : $(package)
: $(fileName) ] ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
}
rule BuildHaikuPortsSourcePackageDirectory
{
local architecture = $(TARGET_PACKAGING_ARCH) ;
local outputDir = [ FDirName
$(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture))
HaikuPorts-sources-build ] ;
local sourcePackageDir = <HaikuPorts-repository-source-packages>packages ;
MakeLocate $(sourcePackageDir) : $(outputDir) ;
# build the package list file
local packageList
= <repository-package-list-HaikuPorts-sources>package_list ;
MakeLocate $(packageList) : $(outputDir) ;
Depends $(packageList) :
[ FDirName $(HAIKU_BUILD_RULES_DIR) repositories HaikuPorts
$(architecture) ] ;
# Note: Those are packages we need for building on the bootstrap Haiku. They
# are build-pre-requires and as such won't be detected by haikuporter as
# required dependencies when building the source packages.
HAIKU_REPOSITORY_BUILD_ADDITIONAL_PACKAGES on $(packageList) =
htmldoc
texi2html
;
BuildHaikuPortsPackageList $(packageList) ;
# prepare the config file for the HaikuPorts build
local configFile = <repository-config-HaikuPorts-sources>haikuports.conf ;
MakeLocate $(configFile) : $(outputDir) ;
NoUpdate $(configFile) ;
Depends $(configFile) : <build>package <build>mimeset <mimedb>mime_db ;
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(configFile) = $(outputDir) ;
HAIKU_PACKAGING_ARCH on $(configFile) = $(architecture) ;
HAIKU_REPOSITORY_TREE_PATH on $(configFile) = $(HAIKU_PORTS) ;
BuildBootstrapRepositoryConfig $(configFile)
: <build>package <build>mimeset <mimedb>mime_db ;
# get Haiku cross-devel packages and build the sources
local crossDevelPackageSuffixes = $(architecture)
$(architecture)_$(HAIKU_PACKAGING_ARCHS[2-]) ;
local haikuCrossDevelPackages
= haiku_cross_devel_sysroot_stage1_$(crossDevelPackageSuffixes).hpkg ;
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(sourcePackageDir) = $(outputDir) ;
Depends $(sourcePackageDir) : $(packageList) $(haikuCrossDevelPackages)
$(configFile) ;
BuildHaikuPortsSourcePackageDirectory1 $(sourcePackageDir)
: $(packageList) $(haikuCrossDevelPackages) ;
return $(sourcePackageDir) ;
}
actions BuildHaikuPortsPackageList
{
HAIKU_BOOTSTRAP_BUILD= $(JAM:E=jam) @alpha-raw build-package-list $(1) \
$(HAIKU_REPOSITORY_BUILD_ADDITIONAL_PACKAGES)
}
actions BuildHaikuPortsSourcePackageDirectory1
{
packageList="$(2[1])"
# make Haiku cross devel package path absolute
haikuCrossDevelPackage="$(2[2])"
if [ "x$haikuCrossDevelPackage" = "x${haikuCrossDevelPackage#/}" ]; then
haikuCrossDevelPackage="`pwd`/$haikuCrossDevelPackage"
fi
# make secondary Haiku cross devel packages path absolute
secondaryCrossDevelPackages=
if [ -n "$(2[3-]:J)" ]; then
for secondaryCrossDevelPackage in "$(2[3-])" ; do
if [ "x$secondaryCrossDevelPackage" = "x${secondaryCrossDevelPackage#/}" ]; then
secondaryCrossDevelPackage="`pwd`/$secondaryCrossDevelPackage"
fi
if [ -n "$secondaryCrossDevelPackages" ]; then
secondaryCrossDevelPackages="secondaryCrossDevelPackages,$secondaryCrossDevelPackage"
else
secondaryCrossDevelPackages="--secondary-cross-devel-package=$secondaryCrossDevelPackage"
fi
done
fi
cd $(HAIKU_REPOSITORY_BUILD_DIRECTORY)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
if [ -n "$secondaryCrossDevelPackages" ]; then
$(HOST_HAIKU_PORTER) --cross-devel-package "$haikuCrossDevelPackage" \
"$secondaryCrossDevelPackages" \
--create-source-packages-for-bootstrap --portsfile $packageList
else
$(HOST_HAIKU_PORTER) --cross-devel-package "$haikuCrossDevelPackage" \
--create-source-packages-for-bootstrap --portsfile $packageList
fi
}
rule BuildHaikuPortsRepositoryConfig treePath
{
local architecture = $(TARGET_PACKAGING_ARCH) ;
local outputDir = [ FDirName
$(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture))
HaikuPorts-bootstrap ] ;
local configFile = <repository-config-HaikuPorts-bootstrap>haikuports.conf ;
MakeLocate $(configFile) : $(outputDir) ;
NoUpdate $(configFile) ;
HAIKU_REPOSITORY_TREE_PATH on $(configFile) = $(treePath) ;
BuildHaikuPortsRepositoryConfig1 $(configFile) ;
return $(configFile) ;
}
actions BuildHaikuPortsRepositoryConfig1
{
cat > $(1) << EOF
PACKAGER="The Haiku build system <build-system@haiku-os.org>"
TREE_PATH="$(HAIKU_REPOSITORY_TREE_PATH)"
TARGET_ARCHITECTURE="$(HAIKU_PACKAGING_ARCH)"
EOF
}
rule BuildRemoteHaikuPortsRepository target : packages
{
local packageListFile = <repository-package-list>HaikuPorts-packages ;
Depends $(target) : $(packageListFile) ;
HAIKU_REMOTE_REPOSITORY_PACKAGES on $(target) = $(packages) ;
BuildRemoteHaikuPortsRepository1 $(target) : $(packageListFile) ;
}
actions BuildRemoteHaikuPortsRepository1
{
remote=haiku_files@haiku-files.org
if [ -n "$(HAIKU_REMOTE_REPOSITORY_PACKAGES:E=:J)" ]; then
for package in $(HAIKU_REMOTE_REPOSITORY_PACKAGES) ; do
file=`basename $package`
if ! grep -q $file $(2); then
echo "Error: $file is not being referenced in $(2)"
exit 1
fi
done
scp $(HAIKU_REMOTE_REPOSITORY_PACKAGES) \
$remote:haiku-files.org/files/hpkg/
fi
packageList=package-list.$(TARGET_PACKAGING_ARCH)
scp $(2) $remote:build_repository/$packageList
ssh $remote \
"cd build_repository \
&& ./build_repo.sh $(TARGET_PACKAGING_ARCH) $packageList"
}