Move creating the Haiku repo info to jam
* PreprocessPackageInfo rule: Pull out new rule PreprocessPackageOrRepositoryInfo which does the sed substituation and optionally the filtering through the C preprocessor. * HaikuRepository rule: Generate the repository info file (from the given template). No longer do that in the build_haiku_repository script.
This commit is contained in:
parent
af559cd6ee
commit
12c19e6362
@ -50,11 +50,57 @@ rule PreprocessPackageInfo source : directory : architecture
|
|||||||
;
|
;
|
||||||
|
|
||||||
local target = $(source:BSG=package-info)-package-info ;
|
local target = $(source:BSG=package-info)-package-info ;
|
||||||
|
if $(HAIKU_BOOTSTRAP_BUILD) {
|
||||||
|
target = $(target)-bootstrap ;
|
||||||
|
}
|
||||||
|
MakeLocate $(target) : $(directory) ;
|
||||||
|
|
||||||
|
PreprocessPackageOrRepositoryInfo $(target) : $(source) : $(architecture)
|
||||||
|
: $(secondaryArchitecture) : useCPP ;
|
||||||
|
|
||||||
|
# Update requires in the package info.
|
||||||
|
if ! $(HAIKU_BOOTSTRAP_BUILD) {
|
||||||
|
local updateRequiresFiles =
|
||||||
|
<build>update_package_requires
|
||||||
|
[ on <repository>HaikuPorts return $(HAIKU_REPOSITORY_CACHE_FILE) ]
|
||||||
|
;
|
||||||
|
Depends $(target) : $(updateRequiresFiles) ;
|
||||||
|
UpdatePackageInfoRequires $(target) : $(updateRequiresFiles) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $(target) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
actions UpdatePackageInfoRequires
|
||||||
|
{
|
||||||
|
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
||||||
|
"$(2[1])" "$(1)" "$(2[2])"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rule PreprocessPackageOrRepositoryInfo target : source : architecture
|
||||||
|
: secondaryArchitecture : flags
|
||||||
|
{
|
||||||
|
# PreprocessPackageOrRepositoryInfo <target> : <source> : <architecture>
|
||||||
|
# : [ <secondaryArchitecture> ] [ : <flags> ] ;
|
||||||
|
# Preprocesses the package or repository info template file <source> by
|
||||||
|
# performing several placeholder substitutions and optionally filtering it
|
||||||
|
# through the C preprocessor.
|
||||||
|
#
|
||||||
|
# <target> - The generated preprocessed file.
|
||||||
|
# <source> - The package or repository info template file.
|
||||||
|
# <architecture> - The primary packaging architecture.
|
||||||
|
# <secondaryArchitecture> - If given, the secondary packaging architecture
|
||||||
|
# the package targets. Otherwise the primary architecture is targeted.
|
||||||
|
# <flags>:
|
||||||
|
# useCPP - Filter the source file through the C preprocessor after the
|
||||||
|
# placeholder substitutions have been performed.
|
||||||
|
|
||||||
local defines = HAIKU_PACKAGING_ARCH=$(architecture) ;
|
local defines = HAIKU_PACKAGING_ARCH=$(architecture) ;
|
||||||
local sedReplacements = %HAIKU_PACKAGING_ARCH%,$(architecture) ;
|
local sedReplacements = %HAIKU_PACKAGING_ARCH%,$(architecture) ;
|
||||||
if $(HAIKU_BOOTSTRAP_BUILD) {
|
if $(HAIKU_BOOTSTRAP_BUILD) {
|
||||||
defines += HAIKU_BOOTSTRAP_BUILD ;
|
defines += HAIKU_BOOTSTRAP_BUILD ;
|
||||||
target = $(target)-bootstrap ;
|
|
||||||
}
|
}
|
||||||
if $(secondaryArchitecture) {
|
if $(secondaryArchitecture) {
|
||||||
defines += HAIKU_SECONDARY_PACKAGING_ARCH=$(secondaryArchitecture) ;
|
defines += HAIKU_SECONDARY_PACKAGING_ARCH=$(secondaryArchitecture) ;
|
||||||
@ -68,39 +114,29 @@ rule PreprocessPackageInfo source : directory : architecture
|
|||||||
}
|
}
|
||||||
|
|
||||||
local revisionFile = [ DetermineEffectiveHaikuRevision ] ;
|
local revisionFile = [ DetermineEffectiveHaikuRevision ] ;
|
||||||
local updateRequiresFiles ;
|
Depends $(target) : $(source) $(revisionFile) ;
|
||||||
local haikuPortsRepositoryFile ;
|
|
||||||
if ! $(HAIKU_BOOTSTRAP_BUILD) {
|
if useCPP in $(flags) {
|
||||||
updateRequiresFiles =
|
PREPROCESSOR on $(target)
|
||||||
<build>update_package_requires
|
= "|" $(HOST_CC) -E -w [ FDefines $(defines) ] - ;
|
||||||
[ on <repository>HaikuPorts return $(HAIKU_REPOSITORY_CACHE_FILE) ]
|
} else {
|
||||||
;
|
PREPROCESSOR on $(target) = ;
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeLocate $(target) : $(directory) ;
|
|
||||||
Depends $(target) : $(source) $(revisionFile) $(updateRequiresFiles) ;
|
|
||||||
|
|
||||||
CCDEFS on $(target) = [ FDefines $(defines) ] ;
|
|
||||||
HAIKU_SED_REPLACEMENTS on $(target) = "-e s,$(sedReplacements),g" ;
|
HAIKU_SED_REPLACEMENTS on $(target) = "-e s,$(sedReplacements),g" ;
|
||||||
|
|
||||||
PreprocessPackageInfo1 $(target) : $(source) $(revisionFile)
|
PreprocessPackageOrRepositoryInfo1 $(target) : $(source) $(revisionFile) ;
|
||||||
$(updateRequiresFiles) ;
|
|
||||||
|
|
||||||
return $(target) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
actions PreprocessPackageInfo1
|
actions PreprocessPackageOrRepositoryInfo1
|
||||||
{
|
{
|
||||||
revision=`cat $(2[2])`
|
revision=`cat $(2[2])`
|
||||||
|
version=$(HAIKU_VERSION)_${revision}
|
||||||
sed $(HAIKU_SED_REPLACEMENTS) \
|
sed $(HAIKU_SED_REPLACEMENTS) \
|
||||||
-e s,%HAIKU_VERSION%,$(HAIKU_VERSION)_${revision}-1, < $(2[1]) \
|
-e s,%HAIKU_VERSION%,${version}-1, \
|
||||||
| $(HOST_CC) -E -w $(CCDEFS) - -o $(1)
|
-e s,%HAIKU_VERSION_NO_REVISION%,${version}, $(2[1]) \
|
||||||
|
$(PREPROCESSOR) > $(1)
|
||||||
if [ -n "$(2[4]:E)" ]; then
|
|
||||||
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
|
||||||
"$(2[3])" "$(1)" "$(2[4])" || exit 1
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -677,12 +677,30 @@ actions BuildRemoteHaikuPortsRepository1
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rule HaikuRepository repository : repoInfo : packages
|
rule HaikuRepository repository : repoInfoTemplate : packages
|
||||||
{
|
{
|
||||||
|
# HaikuRepository <repository> : <repoInfoTemplate> : <packages> ;
|
||||||
|
# Builds the Haiku repository from the given packages and repository info
|
||||||
|
# template. <repository> must already be located.
|
||||||
|
|
||||||
|
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
|
||||||
|
local repoInfo = $(repository:G=repository-info)-info ;
|
||||||
|
MakeLocate $(repoInfo) : $(repositoriesDir) ;
|
||||||
|
PreprocessPackageOrRepositoryInfo $(repoInfo) : $(repoInfoTemplate)
|
||||||
|
: $(architecture) : $(secondaryArchitecture) ;
|
||||||
|
|
||||||
# prepare the script that initializes the shell variables
|
# prepare the script that initializes the shell variables
|
||||||
local initVariablesScript = $(repository)-repository-init-vars ;
|
local initVariablesScript = $(repository)-repository-init-vars ;
|
||||||
MakeLocate $(initVariablesScript)
|
MakeLocate $(initVariablesScript)
|
||||||
: $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(HAIKU_PACKAGING_ARCH)) ;
|
: $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture)) ;
|
||||||
Always $(initVariablesScript) ;
|
Always $(initVariablesScript) ;
|
||||||
|
|
||||||
local script = $(initVariablesScript) ;
|
local script = $(initVariablesScript) ;
|
||||||
|
@ -4,7 +4,7 @@ local haikuRepository = <repository>haiku ;
|
|||||||
MakeLocate $(haikuRepository)
|
MakeLocate $(haikuRepository)
|
||||||
: $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(HAIKU_PACKAGING_ARCH)) ;
|
: $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(HAIKU_PACKAGING_ARCH)) ;
|
||||||
|
|
||||||
local repoInfo = <repository-info>haiku ;
|
local repoInfo = <repository-info-template>haiku ;
|
||||||
SEARCH on $(repoInfo) = $(HAIKU_TOP)/src/data/repository_infos ;
|
SEARCH on $(repoInfo) = $(HAIKU_TOP)/src/data/repository_infos ;
|
||||||
|
|
||||||
local secondaryArchs = $(TARGET_PACKAGING_ARCHS[2-]) ;
|
local secondaryArchs = $(TARGET_PACKAGING_ARCHS[2-]) ;
|
||||||
|
@ -35,17 +35,8 @@ for packageFile in "$@"; do
|
|||||||
cp "$packageFile" "$packageDir/$fileName"
|
cp "$packageFile" "$packageDir/$fileName"
|
||||||
done
|
done
|
||||||
|
|
||||||
# prepare the repo info file
|
|
||||||
fileName=`basename "$packageDir"/haiku-*.hpkg .hpkg`
|
|
||||||
version=${fileName#*-}
|
|
||||||
version=${version%%-*}
|
|
||||||
arch=${fileName##*-}
|
|
||||||
|
|
||||||
sed -e "s/%HAIKU_ARCHITECTURE%/$arch/g" \
|
|
||||||
-e "s/%HAIKU_VERSION%/$version/g" \
|
|
||||||
"$repoInfo" > "$repositoryDir/repo.info"
|
|
||||||
|
|
||||||
# build the repository file
|
# build the repository file
|
||||||
|
cp "$repoInfo" "$repositoryDir/repo.info"
|
||||||
"$packageRepo" create -C "$repositoryDir" "$repositoryDir/repo.info" \
|
"$packageRepo" create -C "$repositoryDir" "$repositoryDir/repo.info" \
|
||||||
"$packageDir"/*.hpkg
|
"$packageDir"/*.hpkg
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name Haiku
|
name Haiku
|
||||||
vendor "Haiku Project"
|
vendor "Haiku Project"
|
||||||
summary "The Haiku repository (for Haiku %HAIKU_VERSION%)"
|
summary "The Haiku repository (for Haiku %HAIKU_VERSION_NO_REVISION%)"
|
||||||
priority 1
|
priority 1
|
||||||
url http://packages.haiku-os.org/haiku/master/repo/%HAIKU_ARCHITECTURE%/%HAIKU_VERSION%
|
url http://packages.haiku-os.org/haiku/master/repo/%HAIKU_PACKAGING_ARCH%/%HAIKU_VERSION_NO_REVISION%
|
||||||
architecture %HAIKU_ARCHITECTURE%
|
architecture %HAIKU_PACKAGING_ARCH%
|
||||||
|
Loading…
Reference in New Issue
Block a user