Add target for building a Haiku package repository
* Add rule HaikuRepository to build a repository from a repository info file and a list of package files. It calls a build_haiku_repository script which does all the work. * Add target <repository>haiku for building the Haiku package repository. It should be built via "jam -q @alpha-raw build <repository>haiku"; the build profile is only needed to activate all build features.
This commit is contained in:
parent
8e0eb17508
commit
d85bab41bd
1
Jamfile
1
Jamfile
@ -73,6 +73,7 @@ include [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootImage ] ;
|
||||
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootPPCImage ] ;
|
||||
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuCD ] ;
|
||||
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images AnybootImage ] ;
|
||||
include [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories Haiku ] ;
|
||||
|
||||
# Check whether all requested optional packages do actually exist.
|
||||
local package ;
|
||||
|
@ -675,3 +675,40 @@ actions BuildRemoteHaikuPortsRepository1
|
||||
|
||||
ssh $remote "build_repository_for_testing.sh $branch $repoArch"
|
||||
}
|
||||
|
||||
|
||||
rule HaikuRepository repository : repoInfo : packages
|
||||
{
|
||||
# prepare the script that initializes the shell variables
|
||||
local initVariablesScript = $(repository)-repository-init-vars ;
|
||||
MakeLocate $(initVariablesScript)
|
||||
: $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(HAIKU_PACKAGING_ARCH)) ;
|
||||
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 ] ;
|
||||
|
||||
Depends $(repository) : $(mainScript) $(initVariablesScript) $(repoInfo)
|
||||
$(packages) ;
|
||||
HaikuRepository1 $(repository) : $(mainScript) $(initVariablesScript)
|
||||
$(repoInfo) $(packages) ;
|
||||
Always $(repository) ;
|
||||
|
||||
RmTemps $(repository) : $(initVariablesScript) ;
|
||||
}
|
||||
|
||||
|
||||
actions HaikuRepository1
|
||||
{
|
||||
$(2[1]) "$(2[2])" "$(1)" "$(2[3-])"
|
||||
}
|
||||
|
23
build/jam/repositories/Haiku
Normal file
23
build/jam/repositories/Haiku
Normal file
@ -0,0 +1,23 @@
|
||||
# Builds the Haiku packages repository.
|
||||
|
||||
local haikuRepository = <repository>haiku ;
|
||||
MakeLocate $(haikuRepository)
|
||||
: $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(HAIKU_PACKAGING_ARCH)) ;
|
||||
|
||||
local repoInfo = <repository-info>haiku ;
|
||||
SEARCH on $(repoInfo) = $(HAIKU_TOP)/src/data/repository_infos ;
|
||||
|
||||
local secondaryArchs = $(TARGET_PACKAGING_ARCHS[2-]) ;
|
||||
local packages =
|
||||
haiku
|
||||
haiku_devel
|
||||
haiku_loader
|
||||
haiku_userguide
|
||||
haiku_welcome
|
||||
makefile_engine
|
||||
|
||||
haiku_$(secondaryArchs)
|
||||
haiku_$(secondaryArchs)_devel
|
||||
;
|
||||
|
||||
HaikuRepository $(haikuRepository) : $(repoInfo) : $(packages:S=.hpkg) ;
|
56
build/scripts/build_haiku_repository
Executable file
56
build/scripts/build_haiku_repository
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Usage: build_haiku_repository <initScript> <repositoryDir> <repoInfo>
|
||||
# <packages> ...
|
||||
|
||||
set -o errexit
|
||||
|
||||
if [ $# -le 2 ]; then
|
||||
echo "$0: Missing parameters!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $1
|
||||
shift
|
||||
|
||||
repositoryDir="$1"
|
||||
repoInfo="$2"
|
||||
shift 2
|
||||
# the remaining arguments are the packages
|
||||
|
||||
# this adds the build library dir to LD_LIBRARY_PATH
|
||||
eval "$addBuildCompatibilityLibDir"
|
||||
|
||||
# create a clean repository directory
|
||||
rm -rf "$repositoryDir"
|
||||
mkdir "$repositoryDir"
|
||||
|
||||
packageDir="$repositoryDir/packages"
|
||||
mkdir "$packageDir"
|
||||
|
||||
# Get the canonical names for the packages and copy them to the package
|
||||
# directory.
|
||||
for packageFile in "$@"; do
|
||||
fileName=`"$package" info -f "%fileName%" "$packageFile"`
|
||||
cp "$packageFile" "$packageDir/$fileName"
|
||||
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
|
||||
"$packageRepo" create -C "$repositoryDir" "$repositoryDir/repo.info" \
|
||||
"$packageDir"/*.hpkg
|
||||
|
||||
# create the checksum file
|
||||
$sha256 "$repositoryDir/repo" \
|
||||
| $sedExtendedRegex 's,([^[:space:]]*).*,\1,' > "$repositoryDir/repo.sha256"
|
||||
# The sed part is only necessary for sha256sum, but it doesn't harm for
|
||||
# sha256 either.
|
6
src/data/repository_infos/haiku
Normal file
6
src/data/repository_infos/haiku
Normal file
@ -0,0 +1,6 @@
|
||||
name Haiku
|
||||
vendor "Haiku Project"
|
||||
summary "The Haiku repository (for Haiku %HAIKU_VERSION%)"
|
||||
priority 1
|
||||
url http://packages.haiku-os.org/haiku/master/repo/%HAIKU_ARCHITECTURE%/%HAIKU_VERSION%
|
||||
architecture %HAIKU_ARCHITECTURE%
|
Loading…
Reference in New Issue
Block a user