Adjust handling of package infos.

* add HAIKU_PACKAGING_ARCH, which is set to the target packaging 
  architecture
* introduce support for generic package infos, which are package infos
  that are the same for all architectures, except for the declaration
  of the package architecture itself
* move package info files underneath architecture-specific or generic
  folder
This commit is contained in:
Oliver Tappe
2013-06-04 00:24:37 +02:00
parent 6c36ad168e
commit 59e2e2f3a7
10 changed files with 32 additions and 4 deletions
+10
View File
@@ -232,6 +232,7 @@ switch $(HAIKU_CPU) {
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
# offset in floppy image (>= sizeof(haiku_loader)) # offset in floppy image (>= sizeof(haiku_loader))
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
HAIKU_PACKAGING_ARCH = ppc ;
} }
case arm : case arm :
{ {
@@ -244,6 +245,7 @@ switch $(HAIKU_CPU) {
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
HAIKU_NO_WERROR = 1 ; HAIKU_NO_WERROR = 1 ;
# we use #warning as placeholders for things to write... # we use #warning as placeholders for things to write...
HAIKU_PACKAGING_ARCH = arm ;
} }
case x86 : case x86 :
{ {
@@ -252,6 +254,11 @@ switch $(HAIKU_CPU) {
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
# offset in floppy image (>= sizeof(haiku_loader)) # offset in floppy image (>= sizeof(haiku_loader))
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
if $(HAIKU_GCC_VERSION[1]) = 2 {
HAIKU_PACKAGING_ARCH = x86_gcc2 ;
} else {
HAIKU_PACKAGING_ARCH = x86 ;
}
# yasm is required for target arch x86 # yasm is required for target arch x86
if ! $(HAIKU_YASM) { if ! $(HAIKU_YASM) {
@@ -265,6 +272,7 @@ switch $(HAIKU_CPU) {
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
# offset in floppy image (>= sizeof(haiku_loader)) # offset in floppy image (>= sizeof(haiku_loader))
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
HAIKU_PACKAGING_ARCH = x86_64 ;
# x86_64 kernel source is under arch/x86. # x86_64 kernel source is under arch/x86.
HAIKU_KERNEL_ARCH = x86 ; HAIKU_KERNEL_ARCH = x86 ;
@@ -293,6 +301,7 @@ switch $(HAIKU_CPU) {
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 260 ; # in kB HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 260 ; # in kB
HAIKU_NO_WERROR = 1 ; HAIKU_NO_WERROR = 1 ;
# we use #warning as placeholders for things to write... # we use #warning as placeholders for things to write...
HAIKU_PACKAGING_ARCH = m68k ;
} }
case mipsel : case mipsel :
{ {
@@ -303,6 +312,7 @@ switch $(HAIKU_CPU) {
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB
HAIKU_NO_WERROR = 1 ; HAIKU_NO_WERROR = 1 ;
# we use #warning as placeholders for things to write... # we use #warning as placeholders for things to write...
HAIKU_PACKAGING_ARCH = mipsel ;
} }
case * : case * :
Exit "Currently unsupported target CPU:" $(HAIKU_CPU) ; Exit "Currently unsupported target CPU:" $(HAIKU_CPU) ;
+7 -1
View File
@@ -298,7 +298,11 @@ rule BuildHaikuPackage package : packageInfo
# locate the package and package info # locate the package and package info
MakeLocate $(package) : $(HAIKU_PACKAGES_DIR) ; MakeLocate $(package) : $(HAIKU_PACKAGES_DIR) ;
SEARCH on $(packageInfo) += $(HAIKU_PACKAGE_INFOS_DIR) ; SEARCH on $(packageInfo) +=
[ FDirName $(HAIKU_PACKAGE_INFOS_DIR) $(HAIKU_PACKAGING_ARCH) ]
[ FDirName $(HAIKU_PACKAGE_INFOS_DIR) any ]
[ FDirName $(HAIKU_PACKAGE_INFOS_DIR) generic ]
;
LocalDepends $(package) : $(packageInfo) ; LocalDepends $(package) : $(packageInfo) ;
# prepare the script that initializes the shell variables # prepare the script that initializes the shell variables
@@ -316,6 +320,8 @@ rule BuildHaikuPackage package : packageInfo
: [ on $(package) return $(HAIKU_PACKAGE_COMPRESSION_LEVEL) ] ; : [ on $(package) return $(HAIKU_PACKAGE_COMPRESSION_LEVEL) ] ;
AddVariableToScript $(script) : updateOnly AddVariableToScript $(script) : updateOnly
: [ on $(package) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] ; : [ on $(package) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] ;
AddVariableToScript $(script) : cc : $(TARGET_CC) ;
AddVariableToScript $(script) : packagingArch : $(HAIKU_PACKAGING_ARCH) ;
AddTargetVariableToScript $(script) : <build>addattr ; AddTargetVariableToScript $(script) : <build>addattr ;
AddTargetVariableToScript $(script) : <build>copyattr ; AddTargetVariableToScript $(script) : <build>copyattr ;
AddTargetVariableToScript $(script) : <mimedb>mime_db : mimeDB ; AddTargetVariableToScript $(script) : <mimedb>mime_db : mimeDB ;
+12
View File
@@ -9,6 +9,8 @@ set -o errexit
# tmpDir # tmpDir
# compressionLevel # compressionLevel
# updateOnly # updateOnly
# cc
# packagingArch
# #
# addattr # addattr
# copyattr # copyattr
@@ -113,6 +115,16 @@ echo "$packageName: mimeset'ing package contents ..."
$mimeset --mimedb "$mimeDB" "$contentsDir" $mimeset --mimedb "$mimeDB" "$contentsDir"
# create the package-info from a generic package-info if needed
if [ $(basename $(dirname $packageInfoPath)) = 'generic' ]; then
echo "$packageName: Creating real package info from generic one ..."
genericPackageInfoPath=$packageInfoPath
packageInfoPath=$tmpDir/.PackageInfo
cat "$genericPackageInfoPath" \
| $cc -E -DHAIKU_PACKAGING_ARCH=$packagingArch - > "$packageInfoPath"
fi
# create the package # create the package
if [ ! $updateOnly ]; then if [ ! $updateOnly ]; then
echo "$packageName: Creating the package ..." echo "$packageName: Creating the package ..."
@@ -1,6 +1,6 @@
name haiku_cross_devel name haiku_cross_devel
version R1~alpha4_pm-1 version R1~alpha4_pm-1
architecture x86_gcc2 architecture HAIKU_PACKAGING_ARCH
summary "The Haiku base system files for cross development" summary "The Haiku base system files for cross development"
description "The package contains all files associated with the base system description "The package contains all files associated with the base system
@@ -1,6 +1,6 @@
name haiku_devel name haiku_devel
version R1~alpha4_pm-1 version R1~alpha4_pm-1
architecture x86_gcc2 architecture HAIKU_PACKAGING_ARCH
summary "The Haiku base system development files" summary "The Haiku base system development files"
description "The package contains all files associated with the base system description "The package contains all files associated with the base system
@@ -1,6 +1,6 @@
name haiku_loader name haiku_loader
version R1~alpha4_pm-1 version R1~alpha4_pm-1
architecture x86_gcc2 architecture HAIKU_PACKAGING_ARCH
summary "The Haiku boot loader" summary "The Haiku boot loader"
description "The Haiku boot loader." description "The Haiku boot loader."