2013-07-21 06:10:48 +04:00
|
|
|
#pragma mark - Private
|
|
|
|
|
2014-05-01 14:50:11 +04:00
|
|
|
# default value for the build profile that defines the set of source packages
|
2014-03-16 04:00:28 +04:00
|
|
|
# that will be put onto the bootstrap image
|
|
|
|
HAIKU_BOOTSTRAP_SOURCES_PROFILE ?= @minimum-raw ;
|
2013-07-21 06:10:48 +04:00
|
|
|
|
2013-07-05 12:51:42 +04:00
|
|
|
rule PackageFamily packageBaseName
|
|
|
|
{
|
|
|
|
return $(packageBaseName:G=package-family) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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) ] ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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) ;
|
2014-05-01 21:41:31 +04:00
|
|
|
local packageFileName = $(package:G=)-$(architecture).hpkg ;
|
|
|
|
HAIKU_PACKAGE_FILE_NAME on $(package) = $(packageFileName) ;
|
2013-07-05 12:51:42 +04:00
|
|
|
|
2013-07-21 06:10:48 +04:00
|
|
|
local packageFamily = [ InvokeRepositoryMethod $(repository) : PackageFamily
|
|
|
|
: $(baseName) ] ;
|
|
|
|
baseName = $(packageFamily:G=) ;
|
|
|
|
|
2014-10-26 23:07:01 +03:00
|
|
|
if $(HAIKU_NO_DOWNLOADS) = 1 && $(HAIKU_IS_BOOTSTRAP) != 1 {
|
2014-05-01 21:41:31 +04:00
|
|
|
# Only add packages to repository that already exist in download
|
|
|
|
# directory.
|
|
|
|
if ! [ Glob $(HAIKU_DOWNLOAD_DIR) : $(packageFileName) ] {
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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) ;
|
2013-07-21 06:10:48 +04:00
|
|
|
|
|
|
|
return $(package) ;
|
2013-07-05 12:51:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rule AddRepositoryPackages repository : architecture : packages : sourcePackages
|
2013-07-12 15:27:56 +04:00
|
|
|
: debugInfoPackages
|
2013-07-05 12:51:42 +04:00
|
|
|
{
|
2013-07-21 06:10:48 +04:00
|
|
|
local packageTargets ;
|
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]) ;
|
2013-07-21 06:10:48 +04:00
|
|
|
packageTargets += [ AddRepositoryPackage $(repository) : $(architecture)
|
|
|
|
: $(baseName) : $(version) ] ;
|
2013-07-05 12:51:42 +04:00
|
|
|
if $(baseName) in $(sourcePackages) {
|
|
|
|
AddRepositoryPackage $(repository) : source : $(baseName)_source
|
|
|
|
: $(version) ;
|
|
|
|
}
|
2013-07-12 15:27:56 +04:00
|
|
|
if $(baseName) in $(debugInfoPackages) {
|
2013-07-21 06:10:48 +04:00
|
|
|
packageTargets += [ AddRepositoryPackage $(repository)
|
|
|
|
: $(architecture) : $(baseName)_debuginfo : $(version) ] ;
|
2013-07-12 15:27:56 +04:00
|
|
|
}
|
2013-07-05 12:51:42 +04:00
|
|
|
}
|
2013-07-21 06:10:48 +04:00
|
|
|
|
|
|
|
return $(packageTargets) ;
|
2013-07-05 12:51:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-21 06:10:48 +04:00
|
|
|
rule PackageRepository repository : architecture : anyPackages : packages
|
|
|
|
: sourcePackages : debugInfoPackages
|
2013-07-05 12:51:42 +04:00
|
|
|
{
|
2013-08-01 10:51:16 +04:00
|
|
|
if $(architecture) != $(HAIKU_PACKAGING_ARCHS[1]) {
|
2013-07-05 12:51:42 +04:00
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
|
|
|
HAIKU_REPOSITORIES += $(repository) ;
|
2013-07-06 04:29:51 +04:00
|
|
|
HAIKU_REPOSITORY_DEFINITION_FILE on $(repository)
|
|
|
|
= $(HAIKU_REPOSITORY_JAMFILE) ;
|
2013-07-05 12:51:42 +04:00
|
|
|
|
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) ;
|
|
|
|
|
2013-10-01 21:35:36 +04:00
|
|
|
if ! $(HOST_EXTENDED_REGEX_SED) {
|
|
|
|
ECHO "Variable HOST_EXTENDED_REGEX_SED not set. Please run ./configure or" ;
|
|
|
|
EXIT "specify it manually." ;
|
|
|
|
}
|
|
|
|
|
2013-07-21 06:10:48 +04:00
|
|
|
SetRepositoryMethod $(repository) : PackageFamily
|
|
|
|
: RemoteRepositoryPackageFamily ;
|
|
|
|
SetRepositoryMethod $(repository) : FetchPackage
|
|
|
|
: RemoteRepositoryFetchPackage ;
|
|
|
|
|
|
|
|
HAIKU_REPOSITORY_URL on $(repository) = $(repositoryUrl) ;
|
|
|
|
|
|
|
|
PackageRepository $(repository) : $(architecture) : $(anyPackages)
|
|
|
|
: $(packages) : $(sourcePackages) : $(debugInfoPackages) ;
|
2013-07-06 04:29:51 +04:00
|
|
|
|
|
|
|
# build package list file
|
|
|
|
local packageListFile = $(repository:G=repository-package-list)-packages ;
|
2013-08-01 10:51:16 +04:00
|
|
|
local repositoriesDir = $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture)) ;
|
|
|
|
MakeLocate $(packageListFile) : $(repositoriesDir) ;
|
2013-07-06 04:29:51 +04:00
|
|
|
GeneratedRepositoryPackageList $(packageListFile) : $(repository) ;
|
|
|
|
|
|
|
|
# build package list checksum file
|
|
|
|
local packagesChecksumFile
|
|
|
|
= $(repository:G=repository-package-checksum)-checksum ;
|
2017-11-25 14:01:30 +03:00
|
|
|
local thisPackageRepositoryFile = [ Glob [ FDirName
|
|
|
|
$(HAIKU_BUILD_RULES_DIR) repositories HaikuPorts ] :
|
|
|
|
$(HAIKU_PACKAGING_ARCH) ] ;
|
2013-08-01 10:51:16 +04:00
|
|
|
MakeLocate $(packagesChecksumFile) : $(repositoriesDir) ;
|
2017-11-25 14:01:30 +03:00
|
|
|
Depends $(packagesChecksumFile) : $(thisPackageRepositoryFile) ;
|
|
|
|
ChecksumFileSHA256 $(packagesChecksumFile) : $(thisPackageRepositoryFile) ;
|
2013-07-06 04:29:51 +04:00
|
|
|
|
|
|
|
local repositoryInfo = $(repository:G=repository-info)-info ;
|
|
|
|
local repositoryFile = $(repository:G=repository-cache) ;
|
2014-05-01 01:47:55 +04:00
|
|
|
local repositoryConfig = $(repository:G=repository-config)-config ;
|
|
|
|
MakeLocate $(repositoryInfo) $(repositoryFile) $(repositoryConfig)
|
|
|
|
: $(repositoriesDir) ;
|
|
|
|
# Use a locally created dummy repository if downloads have been disabled.
|
|
|
|
# This is useful when trying to build everything locally from source.
|
|
|
|
if $(HAIKU_NO_DOWNLOADS) = 1 {
|
2014-05-01 21:41:31 +04:00
|
|
|
# build repository file
|
|
|
|
local packageFileNames = [
|
2014-05-01 01:47:55 +04:00
|
|
|
on $(packageListFile) return $(HAIKU_REPOSITORY_PACKAGE_FILE_NAMES)
|
|
|
|
] ;
|
|
|
|
local packageFiles ;
|
2014-07-31 20:34:37 +04:00
|
|
|
local packageFile ;
|
2014-05-01 21:41:31 +04:00
|
|
|
for packageFile in $(packageFileNames) {
|
|
|
|
MakeLocate $(packageFile) : $(HAIKU_DOWNLOAD_DIR) ;
|
|
|
|
packageFiles += $(packageFile) ;
|
2014-05-01 01:47:55 +04:00
|
|
|
}
|
|
|
|
RepositoryCache $(repositoryFile) : $(repositoryInfo)
|
|
|
|
: $(packageFiles) ;
|
|
|
|
} else {
|
|
|
|
# download repository file
|
2017-12-03 02:48:21 +03:00
|
|
|
local repoUrl = [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
|
2014-05-01 01:47:55 +04:00
|
|
|
DownloadLocatedFile $(repositoryFile)
|
|
|
|
: "$(repoUrl)/`cat $source`/repo"
|
|
|
|
: $(packagesChecksumFile) ;
|
|
|
|
}
|
2013-07-06 04:29:51 +04:00
|
|
|
|
2017-12-03 02:36:26 +03:00
|
|
|
# build the repository info file
|
|
|
|
local repositoryInfoTemplate = <repository-info-template>haikuports ;
|
|
|
|
SEARCH on $(repositoryInfoTemplate)
|
|
|
|
= $(HAIKU_TOP)/src/data/repository_infos ;
|
|
|
|
PreprocessPackageOrRepositoryInfo $(repositoryInfo)
|
|
|
|
: $(repositoryInfoTemplate) : $(architecture) ;
|
|
|
|
|
2013-07-06 04:29:51 +04:00
|
|
|
# build repository config file
|
|
|
|
RepositoryConfig $(repositoryConfig) : $(repositoryInfo)
|
2017-12-03 02:29:13 +03:00
|
|
|
: $(packagesChecksumFile) ;
|
2013-07-06 04:29:51 +04:00
|
|
|
|
|
|
|
HAIKU_REPOSITORY_CACHE_FILE on $(repository) = $(repositoryFile) ;
|
|
|
|
HAIKU_REPOSITORY_CONFIG_FILE on $(repository) = $(repositoryConfig) ;
|
2013-07-06 20:06:02 +04:00
|
|
|
HAIKU_REPOSITORY_PACKAGES_CHECKSUM_FILE on $(repository)
|
|
|
|
= $(packagesChecksumFile) ;
|
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) ] ;
|
|
|
|
}
|
|
|
|
|
2013-07-06 04:29:51 +04:00
|
|
|
local definitionFile
|
|
|
|
= [ on $(repository) return $(HAIKU_REPOSITORY_DEFINITION_FILE) ] ;
|
|
|
|
Depends $(target) : $(definitionFile) ;
|
|
|
|
|
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
|
2013-07-05 16:26:30 +04:00
|
|
|
done) | LC_ALL=C sort -u > $(1)
|
2013-07-05 12:51:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-12-03 02:29:13 +03:00
|
|
|
rule RepositoryConfig repoConfig : repoInfo : checksumFile
|
2013-07-06 04:29:51 +04:00
|
|
|
{
|
|
|
|
Depends $(repoConfig)
|
2017-12-03 02:29:13 +03:00
|
|
|
: <build>create_repository_config $(repoInfo) $(checksumFile) ;
|
2013-07-06 04:29:51 +04:00
|
|
|
RepositoryConfig1 $(repoConfig)
|
2017-12-03 02:29:13 +03:00
|
|
|
: <build>create_repository_config $(repoInfo) $(checksumFile) ;
|
2013-07-06 04:29:51 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
actions RepositoryConfig1
|
|
|
|
{
|
2014-01-19 03:41:39 +04:00
|
|
|
version=
|
|
|
|
if [ -n "$(2[3]:E)" ]; then
|
|
|
|
version=`cat "$(2[3]:E)"`
|
|
|
|
fi
|
2013-07-06 04:29:51 +04:00
|
|
|
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
2017-11-25 14:01:30 +03:00
|
|
|
$(2[1]) $(2[2]) $(1)
|
2013-07-06 04:29:51 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-01 01:47:55 +04:00
|
|
|
rule RepositoryCache repoCache : repoInfo : packageFiles
|
|
|
|
{
|
|
|
|
Depends $(repoCache)
|
|
|
|
: <build>package_repo $(repoInfo) $(packageFiles) ;
|
|
|
|
RepositoryCache1 $(repoCache)
|
|
|
|
: <build>package_repo $(repoInfo) $(packageFiles) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
actions RepositoryCache1
|
|
|
|
{
|
|
|
|
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
|
|
|
$(2[1]) create -q $(2[2-])
|
|
|
|
mv $(1:B=repo) $(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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) ] ;
|
2013-08-05 09:09:45 +04:00
|
|
|
local haikuCrossDevelPackages = [ on $(package)
|
|
|
|
return $(HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES) ] ;
|
2013-07-21 06:10:48 +04:00
|
|
|
|
|
|
|
local packageFile = <cross-built>$(fileName) ;
|
2013-07-21 21:39:06 +04:00
|
|
|
if [ on $(packageFile) return $(HAIKU_REPOSITORY_BUILD_DIRECTORY) ] {
|
|
|
|
# rule already called for this package
|
|
|
|
return $(packageFile) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(packageFile) = $(outputDir) ;
|
|
|
|
|
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.
|
|
|
|
|
2013-08-05 09:09:45 +04:00
|
|
|
Depends $(packageFile) : $(haikuCrossDevelPackages) $(configFile) ;
|
2013-07-21 06:10:48 +04:00
|
|
|
BootstrapRepositoryFetchPackage1 $(packageFile)
|
2013-08-05 09:09:45 +04:00
|
|
|
: $(haikuCrossDevelPackages) ;
|
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
|
2013-08-05 09:09:45 +04:00
|
|
|
haikuCrossDevelPackage="$(2[1])"
|
2019-02-21 00:42:59 +03:00
|
|
|
if [ "x$haikuCrossDevelPackage" = "x" ]; then
|
2019-02-24 16:22:00 +03:00
|
|
|
echo "$package does not have a cross-devel package defined!"
|
2019-02-21 00:42:59 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-09-29 05:01:39 +04:00
|
|
|
if [ "x$haikuCrossDevelPackage" = "x${haikuCrossDevelPackage#/}" ]; then
|
2013-07-21 06:10:48 +04:00
|
|
|
haikuCrossDevelPackage="`pwd`/$haikuCrossDevelPackage"
|
|
|
|
fi
|
|
|
|
|
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
|
2013-09-29 05:01:39 +04:00
|
|
|
if [ "x$secondaryCrossDevelPackage" = "x${secondaryCrossDevelPackage#/}" ]; then
|
2013-08-05 09:09:45 +04:00
|
|
|
secondaryCrossDevelPackage="`pwd`/$secondaryCrossDevelPackage"
|
|
|
|
fi
|
|
|
|
if [ -n "$secondaryCrossDevelPackages" ]; then
|
2018-07-22 21:02:12 +03:00
|
|
|
secondaryCrossDevelPackages="$secondaryCrossDevelPackages,$secondaryCrossDevelPackage"
|
2013-08-05 09:09:45 +04:00
|
|
|
else
|
|
|
|
secondaryCrossDevelPackages="--secondary-cross-devel-package=$secondaryCrossDevelPackage"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2014-08-13 14:37:55 +04:00
|
|
|
# determine the port-specification from the package name
|
|
|
|
portSpec=`basename "$package" | sed 's@-.*@@'`
|
2013-07-21 06:10:48 +04:00
|
|
|
|
|
|
|
cd $(HAIKU_REPOSITORY_BUILD_DIRECTORY)
|
|
|
|
|
|
|
|
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
2013-08-05 23:36:25 +04:00
|
|
|
if [ -n "$secondaryCrossDevelPackages" ]; then
|
2013-08-17 11:12:35 +04:00
|
|
|
$(HOST_HAIKU_PORTER) -j$(HAIKU_PORTER_CONCURRENT_JOBS) \
|
2017-07-03 02:23:30 +03:00
|
|
|
--all-dependencies $(HAIKU_PORTER_EXTRA_OPTIONS) \
|
2013-08-17 11:12:35 +04:00
|
|
|
--cross-devel-package "$haikuCrossDevelPackage" \
|
2014-08-13 14:37:55 +04:00
|
|
|
"$secondaryCrossDevelPackages" $portSpec
|
2013-08-05 23:36:25 +04:00
|
|
|
else
|
2013-08-17 11:12:35 +04:00
|
|
|
$(HOST_HAIKU_PORTER) -j$(HAIKU_PORTER_CONCURRENT_JOBS) \
|
2017-07-03 02:23:30 +03:00
|
|
|
--all-dependencies $(HAIKU_PORTER_EXTRA_OPTIONS) \
|
2014-08-13 14:37:55 +04:00
|
|
|
--cross-devel-package "$haikuCrossDevelPackage" $portSpec
|
2013-08-05 23:36:25 +04:00
|
|
|
fi
|
2013-07-21 06:10:48 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
actions BuildBootstrapRepositoryConfig
|
|
|
|
{
|
|
|
|
cat > $(1) << EOF
|
|
|
|
PACKAGER="The Haiku build system <build-system@haiku-os.org>"
|
2013-08-07 01:02:10 +04:00
|
|
|
TREE_PATH="$(HAIKU_REPOSITORY_TREE_PATH)"
|
2013-07-21 06:10:48 +04:00
|
|
|
TARGET_ARCHITECTURE="$(HAIKU_PACKAGING_ARCH)"
|
|
|
|
|
|
|
|
DOWNLOAD_IN_PORT_DIRECTORY="yes"
|
2018-11-17 05:41:43 +03:00
|
|
|
PACKAGE_COMMAND="$(PWD)/$(2[1])"
|
|
|
|
MIMESET_COMMAND="$(PWD)/$(2[2])"
|
|
|
|
SYSTEM_MIME_DB="$(PWD)/$(2[3])"
|
2018-11-03 17:43:34 +03:00
|
|
|
LICENSES_DIRECTORY="$(HAIKU_ABSOLUTE_TOP)/data/system/data/licenses"
|
2013-07-21 06:10:48 +04:00
|
|
|
OUTPUT_DIRECTORY="$(HAIKU_REPOSITORY_BUILD_DIRECTORY)"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# If we have cross tools, add the cross tools directory.
|
2013-08-01 10:51:16 +04:00
|
|
|
gcc=$(HAIKU_CC_$(HAIKU_PACKAGING_ARCH))
|
2013-09-29 05:01:39 +04:00
|
|
|
if [ "x$gcc" != "x${gcc#/}" ]; then
|
2013-08-01 10:51:16 +04:00
|
|
|
if [ `basename $gcc` = \
|
|
|
|
$(HAIKU_GCC_MACHINE_$(HAIKU_PACKAGING_ARCH))-gcc ]; then
|
2013-07-21 06:10:48 +04:00
|
|
|
dir=`dirname $gcc`
|
|
|
|
dir=`dirname $dir`
|
2013-08-05 09:09:45 +04:00
|
|
|
echo CROSS_TOOLS=\"$dir\" >> $(1)
|
2013-07-21 06:10:48 +04:00
|
|
|
fi
|
|
|
|
fi
|
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)
|
2013-08-05 23:36:25 +04:00
|
|
|
for gcc in $(HAIKU_CC_$(HAIKU_PACKAGING_ARCHS[2-])) ; do
|
2013-08-05 09:09:45 +04:00
|
|
|
dir=`dirname $gcc`
|
|
|
|
dir=`dirname $dir`
|
|
|
|
echo " $dir" >> $(1)
|
|
|
|
done
|
|
|
|
echo \" >> $(1)
|
|
|
|
fi
|
2013-07-21 06:10:48 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rule BootstrapPackageRepository repository : architecture
|
2014-08-12 00:28:44 +04:00
|
|
|
: anyPackages : packagesStage0 : packagesStage1 : packagesStage2
|
|
|
|
: sourcePackages : debugInfoPackages
|
2013-07-21 06:10:48 +04:00
|
|
|
{
|
|
|
|
repository = $(repository:G=repository) ;
|
2014-08-12 00:28:44 +04:00
|
|
|
packagesStage0 = [ FFilterByBuildFeatures $(packagesStage0) ] ;
|
2013-08-05 09:09:45 +04:00
|
|
|
packagesStage1 = [ FFilterByBuildFeatures $(packagesStage1) ] ;
|
|
|
|
packagesStage2 = [ FFilterByBuildFeatures $(packagesStage2) ] ;
|
|
|
|
sourcePackages = [ FFilterByBuildFeatures $(sourcePackages) ] ;
|
|
|
|
debugInfoPackages = [ FFilterByBuildFeatures $(debugInfoPackages) ] ;
|
2013-07-21 06:10:48 +04:00
|
|
|
|
|
|
|
SetRepositoryMethod $(repository) : PackageFamily
|
|
|
|
: BootstrapRepositoryPackageFamily ;
|
|
|
|
SetRepositoryMethod $(repository) : FetchPackage
|
|
|
|
: BootstrapRepositoryFetchPackage ;
|
|
|
|
|
2014-08-12 00:28:44 +04:00
|
|
|
# register repository with stage 0 packages
|
|
|
|
local stage0PackageTargets = [ PackageRepository $(repository)
|
|
|
|
: $(architecture) : $(anyPackages) : $(packagesStage0)
|
|
|
|
: $(sourcePackages) : $(debugInfoPackages) ] ;
|
|
|
|
if ! $(stage0PackageTargets) {
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
local crossDevelPackageSuffixes = $(architecture)
|
|
|
|
$(architecture)_$(HAIKU_PACKAGING_ARCHS[2-]) ;
|
|
|
|
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage0PackageTargets)
|
|
|
|
= haiku_cross_devel_sysroot_stage0_$(crossDevelPackageSuffixes).hpkg ;
|
|
|
|
|
2013-07-21 06:10:48 +04:00
|
|
|
# register repository with stage 1 packages
|
2013-07-21 21:39:06 +04:00
|
|
|
local stage1PackageTargets = [ PackageRepository $(repository)
|
|
|
|
: $(architecture) : $(anyPackages) : $(packagesStage1)
|
|
|
|
: $(sourcePackages) : $(debugInfoPackages) ] ;
|
|
|
|
if ! $(stage1PackageTargets) {
|
2013-07-21 06:10:48 +04:00
|
|
|
return ;
|
|
|
|
}
|
2013-08-05 09:09:45 +04:00
|
|
|
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage1PackageTargets)
|
|
|
|
= haiku_cross_devel_sysroot_stage1_$(crossDevelPackageSuffixes).hpkg ;
|
2013-07-21 06:10:48 +04:00
|
|
|
|
|
|
|
# add stage 2 packages
|
2013-07-21 21:39:06 +04:00
|
|
|
local stage2PackageTargets = [ AddRepositoryPackages $(repository)
|
|
|
|
: $(architecture) : $(packagesStage2) : $(sourcePackages)
|
|
|
|
: $(debugInfoPackages) ] ;
|
2013-08-05 09:09:45 +04:00
|
|
|
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage2PackageTargets)
|
|
|
|
= haiku_cross_devel_sysroot_$(crossDevelPackageSuffixes).hpkg ;
|
2013-07-21 06:10:48 +04:00
|
|
|
|
|
|
|
# prepare the config file for the HaikuPorts cross build
|
2018-11-03 17:43:34 +03:00
|
|
|
# This path needs to be absolute due to haikuporter's cwd
|
2013-08-01 10:51:16 +04:00
|
|
|
local outputDir = [ FDirName
|
2018-11-03 17:43:34 +03:00
|
|
|
$(PWD)
|
2013-08-01 10:51:16 +04:00
|
|
|
$(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture))
|
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) ;
|
2013-08-01 10:51:16 +04:00
|
|
|
HAIKU_PACKAGING_ARCH on $(configFile) = $(architecture) ;
|
2013-08-07 01:02:10 +04:00
|
|
|
HAIKU_REPOSITORY_TREE_PATH on $(configFile) = $(HAIKU_PORTS_CROSS) ;
|
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) ;
|
2013-07-21 21:39:06 +04:00
|
|
|
|
|
|
|
# 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) ;
|
|
|
|
}
|
2013-07-21 06:10:48 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - Public
|
|
|
|
|
|
|
|
|
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) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-24 22:52:40 +04:00
|
|
|
rule IsPackageAvailable packageName : flags
|
2013-07-05 12:51:42 +04:00
|
|
|
{
|
2013-08-05 09:09:45 +04:00
|
|
|
# for a secondary architecture adjust the package name
|
2013-08-07 01:02:10 +04:00
|
|
|
if $(TARGET_PACKAGING_ARCH) != $(TARGET_PACKAGING_ARCHS[1])
|
|
|
|
&& ! nameResolved in $(flags) {
|
2014-07-24 22:52:40 +04:00
|
|
|
# The position of the secondary architecture within the package name
|
|
|
|
# is not well defined, so we scan for it starting from the back.
|
|
|
|
local packageNameHead = $(packageName) ;
|
|
|
|
local packageNameTail = ;
|
|
|
|
while $(packageNameHead) {
|
|
|
|
local splitName = [ FSplitPackageName $(packageNameHead) ] ;
|
|
|
|
splitName = $(splitName[1]) $(TARGET_PACKAGING_ARCH) $(splitName[2])
|
|
|
|
$(packageNameTail) ;
|
|
|
|
packageName = $(splitName:J=_) ;
|
|
|
|
if $(packageName) in $(HAIKU_AVAILABLE_PACKAGES) {
|
|
|
|
return $(packageName) ;
|
|
|
|
}
|
|
|
|
local splitHead = [ Match "(.*)_([^_]*)" : $(packageNameHead) ] ;
|
|
|
|
packageNameHead = $(splitHead[1]) ;
|
|
|
|
packageNameTail = $(splitHead[2]) $(packageNameTail) ;
|
|
|
|
}
|
2013-08-05 09:09:45 +04:00
|
|
|
}
|
|
|
|
|
2014-07-24 22:52:40 +04:00
|
|
|
if $(packageName) in $(HAIKU_AVAILABLE_PACKAGES) {
|
|
|
|
return $(packageName) ;
|
2013-07-05 12:51:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-07 01:02:10 +04:00
|
|
|
rule FetchPackage packageName : flags
|
2013-07-05 12:51:42 +04:00
|
|
|
{
|
2013-08-07 01:02:10 +04:00
|
|
|
local foundPackageName = [ IsPackageAvailable $(packageName) : $(flags) ] ;
|
2013-08-05 09:09:45 +04:00
|
|
|
if ! $(foundPackageName) {
|
2014-04-03 17:54:17 +04:00
|
|
|
Exit "FetchPackage: package" $(packageName) "not available!" ;
|
2013-07-05 12:51:42 +04:00
|
|
|
return ;
|
|
|
|
}
|
2013-08-05 09:09:45 +04:00
|
|
|
packageName = $(foundPackageName) ;
|
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) ] ;
|
2013-07-06 20:06:02 +04:00
|
|
|
|
2014-04-03 17:54:17 +04:00
|
|
|
if $(HAIKU_DONT_FETCH_PACKAGES) {
|
|
|
|
Exit "FetchPackage: file" $(fileName) "not found and fetching"
|
|
|
|
"disabled!" ;
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
2013-07-21 06:10:48 +04:00
|
|
|
return [ InvokeRepositoryMethod $(repository) : FetchPackage : $(package)
|
|
|
|
: $(fileName) ] ;
|
2013-07-05 12:51:42 +04:00
|
|
|
}
|
2013-08-07 01:02:10 +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) ] ;
|
|
|
|
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
|
|
|
|
{
|
2014-03-22 23:23:10 +04:00
|
|
|
$(JAM:E=jam) $(HAIKU_BOOTSTRAP_SOURCES_PROFILE) build-package-list $(1) \
|
|
|
|
$(HAIKU_REPOSITORY_BUILD_ADDITIONAL_PACKAGES)
|
2013-08-07 01:02:10 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
actions BuildHaikuPortsSourcePackageDirectory1
|
|
|
|
{
|
|
|
|
packageList="$(2[1])"
|
|
|
|
|
|
|
|
# make Haiku cross devel package path absolute
|
|
|
|
haikuCrossDevelPackage="$(2[2])"
|
2013-09-29 05:01:39 +04:00
|
|
|
if [ "x$haikuCrossDevelPackage" = "x${haikuCrossDevelPackage#/}" ]; then
|
2013-08-07 01:02:10 +04:00
|
|
|
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
|
2013-09-29 05:01:39 +04:00
|
|
|
if [ "x$secondaryCrossDevelPackage" = "x${secondaryCrossDevelPackage#/}" ]; then
|
2013-08-07 01:02:10 +04:00
|
|
|
secondaryCrossDevelPackage="`pwd`/$secondaryCrossDevelPackage"
|
|
|
|
fi
|
|
|
|
if [ -n "$secondaryCrossDevelPackages" ]; then
|
2018-07-22 21:02:12 +03:00
|
|
|
secondaryCrossDevelPackages="$secondaryCrossDevelPackages,$secondaryCrossDevelPackage"
|
2013-08-07 01:02:10 +04:00
|
|
|
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" \
|
2013-08-07 15:42:16 +04:00
|
|
|
"$secondaryCrossDevelPackages" \
|
2017-07-03 02:23:30 +03:00
|
|
|
--all-dependencies $(HAIKU_PORTER_EXTRA_OPTIONS) \
|
2013-08-07 15:42:16 +04:00
|
|
|
--create-source-packages-for-bootstrap --portsfile $packageList
|
2013-08-07 01:02:10 +04:00
|
|
|
else
|
|
|
|
$(HOST_HAIKU_PORTER) --cross-devel-package "$haikuCrossDevelPackage" \
|
2017-07-03 02:23:30 +03:00
|
|
|
--all-dependencies $(HAIKU_PORTER_EXTRA_OPTIONS) \
|
2013-08-07 15:42:16 +04:00
|
|
|
--create-source-packages-for-bootstrap --portsfile $packageList
|
2013-08-07 01:02:10 +04:00
|
|
|
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
|
|
|
|
{
|
2014-07-03 19:48:35 +04:00
|
|
|
# use a specific packager for continuous integration builds (buildbot)
|
|
|
|
if [ "$(HAIKU_CONTINUOUS_INTEGRATION_BUILD)" = "1" ]; then
|
|
|
|
echo 'PACKAGER="Haiku buildmaster <buildmaster@haiku-os.org>"' > $(1)
|
|
|
|
else
|
|
|
|
echo '#PACKAGER="Joe Hacker <user@host.com>"' > $(1)
|
|
|
|
fi
|
2014-02-23 21:45:55 +04:00
|
|
|
cat >> $(1) << EOF
|
2013-08-07 01:02:10 +04:00
|
|
|
TREE_PATH="$(HAIKU_REPOSITORY_TREE_PATH)"
|
|
|
|
TARGET_ARCHITECTURE="$(HAIKU_PACKAGING_ARCH)"
|
|
|
|
EOF
|
|
|
|
}
|
2013-09-14 21:51:09 +04:00
|
|
|
|
|
|
|
|
2016-12-10 14:51:50 +03:00
|
|
|
rule HaikuRepository repository : repoInfoTemplate : packages
|
2013-11-23 04:46:04 +04:00
|
|
|
{
|
2016-12-10 14:51:50 +03:00
|
|
|
# HaikuRepository <repository> : <repoInfoTemplate> : <packages>
|
|
|
|
# [ : <url> [ : <versionFile> ] ] ;
|
2014-01-19 02:25:49 +04:00
|
|
|
# Builds the Haiku repository from the given packages and repository info
|
|
|
|
# template. <repository> must already be located.
|
2014-01-19 03:48:51 +04:00
|
|
|
#
|
|
|
|
# <repository> - The repository target. Resolves to a directory that will be
|
|
|
|
# (removed,) created and populated with the package files and repository
|
|
|
|
# meta data files.
|
|
|
|
# <repoInfoTemplate> - The repository info template file to be used.
|
|
|
|
# <packages> - The packages to be added to the repository.
|
2014-01-19 02:25:49 +04:00
|
|
|
|
|
|
|
local architecture = $(HAIKU_PACKAGING_ARCH) ;
|
|
|
|
local secondaryArchitecture ;
|
|
|
|
if $(TARGET_PACKAGING_ARCH) != $(architecture) {
|
|
|
|
secondaryArchitecture = $(TARGET_PACKAGING_ARCH) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
local repositoriesDir = $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture)) ;
|
|
|
|
|
|
|
|
# build the repository info
|
2014-07-26 02:35:53 +04:00
|
|
|
local repositoryInfo = $(repository:G=repository-info)-info ;
|
|
|
|
MakeLocate $(repositoryInfo) : $(repositoriesDir) ;
|
|
|
|
PreprocessPackageOrRepositoryInfo $(repositoryInfo) : $(repoInfoTemplate)
|
2014-01-19 02:25:49 +04:00
|
|
|
: $(architecture) : $(secondaryArchitecture) ;
|
|
|
|
|
2014-01-19 03:48:51 +04:00
|
|
|
# build the respository config
|
|
|
|
local repositoryConfig = $(repository:G=repository-config)-config ;
|
|
|
|
MakeLocate $(repositoryConfig) : $(repositoriesDir) ;
|
2016-12-10 14:51:50 +03:00
|
|
|
RepositoryConfig $(repositoryConfig) : $(repositoryInfo) ;
|
2014-01-19 03:48:51 +04:00
|
|
|
HAIKU_REPOSITORY_CONFIG_FILE on $(repository) = $(repositoryConfig) ;
|
|
|
|
|
2014-07-26 02:35:53 +04:00
|
|
|
# setup the repository cache file
|
|
|
|
local repositoryCache = $(repository:B=repo:G=repository-cache) ;
|
|
|
|
MakeLocate $(repositoryCache)
|
|
|
|
: [ FDirName $(repositoriesDir) $(repository:G=) ] ;
|
|
|
|
Depends $(repositoryCache) : $(repository) ;
|
|
|
|
HAIKU_REPOSITORY_CACHE_FILE on $(repository) = $(repositoryCache) ;
|
|
|
|
|
|
|
|
# add the repository to the list of known package repositories
|
|
|
|
HAIKU_REPOSITORIES += $(repository) ;
|
|
|
|
|
2013-11-23 04:46:04 +04:00
|
|
|
# prepare the script that initializes the shell variables
|
|
|
|
local initVariablesScript = $(repository)-repository-init-vars ;
|
|
|
|
MakeLocate $(initVariablesScript)
|
2014-01-19 02:25:49 +04:00
|
|
|
: $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture)) ;
|
2013-11-23 04:46:04 +04:00
|
|
|
Always $(initVariablesScript) ;
|
|
|
|
|
|
|
|
local script = $(initVariablesScript) ;
|
|
|
|
AddVariableToScript $(script) : addBuildCompatibilityLibDir
|
|
|
|
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
|
|
|
|
AddVariableToScript $(script) : sha256 : $(HOST_SHA256) ;
|
|
|
|
AddVariableToScript $(script) : sedExtendedRegex
|
|
|
|
: $(HOST_EXTENDED_REGEX_SED) ;
|
|
|
|
AddTargetVariableToScript $(script) : <build>package ;
|
|
|
|
AddTargetVariableToScript $(script) : <build>package_repo : packageRepo ;
|
|
|
|
|
|
|
|
# call the build actions
|
|
|
|
local mainScript = build_haiku_repository ;
|
|
|
|
SEARCH on $(mainScript) = [ FDirName $(HAIKU_TOP) build scripts ] ;
|
|
|
|
|
2014-07-26 02:35:53 +04:00
|
|
|
Depends $(repository) : $(mainScript) $(initVariablesScript)
|
|
|
|
$(repositoryInfo) $(packages) ;
|
2013-11-23 04:46:04 +04:00
|
|
|
HaikuRepository1 $(repository) : $(mainScript) $(initVariablesScript)
|
2014-07-26 02:35:53 +04:00
|
|
|
$(repositoryInfo) $(packages) ;
|
2013-11-23 04:46:04 +04:00
|
|
|
Always $(repository) ;
|
|
|
|
|
|
|
|
RmTemps $(repository) : $(initVariablesScript) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
actions HaikuRepository1
|
|
|
|
{
|
|
|
|
$(2[1]) "$(2[2])" "$(1)" "$(2[3-])"
|
|
|
|
}
|