Filter package infos through sed

%HAIKU_PACKAGING_ARCH% and %HAIKU_SECONDARY_PACKAGING_ARCH% in the
package infos are replaced before filtering them through the C
preprocessor.
This commit is contained in:
Ingo Weinhold
2013-08-06 04:11:44 +02:00
parent bddca41824
commit 384230184e
7 changed files with 24 additions and 36 deletions
+5 -1
View File
@@ -41,18 +41,22 @@ rule PreprocessPackageInfo source : directory : architecture
local target = $(source:BSG=package-info)-package-info ; local target = $(source:BSG=package-info)-package-info ;
local defines = HAIKU_PACKAGING_ARCH=$(architecture) ; local defines = 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 ; target = $(target)-bootstrap ;
} }
if $(secondaryArchitecture) { if $(secondaryArchitecture) {
defines += HAIKU_SECONDARY_PACKAGING_ARCH=$(secondaryArchitecture) ; defines += HAIKU_SECONDARY_PACKAGING_ARCH=$(secondaryArchitecture) ;
sedReplacements
+= %HAIKU_SECONDARY_PACKAGING_ARCH%,$(secondaryArchitecture) ;
} }
MakeLocate $(target) : $(directory) ; MakeLocate $(target) : $(directory) ;
Depends $(target) : $(source) ; Depends $(target) : $(source) ;
CCDEFS on $(target) = [ FDefines $(defines) ] ; CCDEFS on $(target) = [ FDefines $(defines) ] ;
HAIKU_SED_REPLACEMENTS on $(target) = "-e s,$(sedReplacements),g" ;
PreprocessPackageInfo1 $(target) : $(source) ; PreprocessPackageInfo1 $(target) : $(source) ;
@@ -62,7 +66,7 @@ rule PreprocessPackageInfo source : directory : architecture
actions PreprocessPackageInfo1 actions PreprocessPackageInfo1
{ {
$(HOST_CC) -E -w $(CCDEFS) - -o $(1) < $(2) sed $(HAIKU_SED_REPLACEMENTS) < $(2) | $(HOST_CC) -E -w $(CCDEFS) - -o $(1)
} }
@@ -1,6 +1,3 @@
#define DO_CONCAT(a, b) a ## b
#define CONCAT(a, b) DO_CONCAT(a, b)
name haiku_cross_devel name haiku_cross_devel
version R1~alpha4_pm-1 version R1~alpha4_pm-1
architecture any architecture any
@@ -17,5 +14,5 @@ copyrights "2001-2013 Haiku, Inc. et al"
licenses "MIT" licenses "MIT"
provides { provides {
CONCAT(haiku_cross_devel_, HAIKU_PACKAGING_ARCH) = R1~alpha4_pm-1 haiku_cross_devel_%HAIKU_PACKAGING_ARCH% = R1~alpha4_pm-1
} }
@@ -1,6 +1,3 @@
#define DO_CONCAT(a, b) a ## b
#define CONCAT(a, b) DO_CONCAT(a, b)
name haiku_cross_devel_sysroot name haiku_cross_devel_sysroot
version R1~alpha4_pm-1 version R1~alpha4_pm-1
architecture any architecture any
@@ -17,5 +14,5 @@ copyrights "2001-2013 Haiku, Inc. et al"
licenses "MIT" licenses "MIT"
provides { provides {
CONCAT(haiku_cross_devel_sysroot_, HAIKU_PACKAGING_ARCH) = R1~alpha4_pm-1 haiku_cross_devel_sysroot_%HAIKU_PACKAGING_ARCH% = R1~alpha4_pm-1
} }
+1 -1
View File
@@ -1,6 +1,6 @@
name haiku_devel name haiku_devel
version R1~alpha4_pm-1 version R1~alpha4_pm-1
architecture HAIKU_PACKAGING_ARCH 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,15 +1,10 @@
#define DO_CONCAT(a, b) a ## b name haiku_%HAIKU_SECONDARY_PACKAGING_ARCH%_devel
#define CONCAT(a, b) DO_CONCAT(a, b)
#define DO_TO_STRING(x) #x
#define TO_STRING(x) DO_TO_STRING(x)
name CONCAT(CONCAT(haiku_, HAIKU_SECONDARY_PACKAGING_ARCH), _devel)
version R1~alpha4_pm-1 version R1~alpha4_pm-1
architecture HAIKU_PACKAGING_ARCH architecture HAIKU_PACKAGING_ARCH
summary "The Haiku base system "TO_STRING(HAIKU_SECONDARY_PACKAGING_ARCH)" secondary architecture development files" summary "The Haiku base system %HAIKU_SECONDARY_PACKAGING_ARCH% secondary architecture development files"
description "The package contains all files associated with the base system description "The package contains all files associated with the base system
needed for development for the secondary architecture "TO_STRING(HAIKU_SECONDARY_PACKAGING_ARCH)", needed for development for the secondary architecture %HAIKU_SECONDARY_PACKAGING_ARCH%,
like static libraries, glue code, library symlinks, header files, etc." like static libraries, glue code, library symlinks, header files, etc."
packager "The Haiku build system" packager "The Haiku build system"
@@ -19,9 +14,9 @@ copyrights "2001-2013 Haiku, Inc. et al"
licenses "MIT" licenses "MIT"
provides { provides {
CONCAT(haiku_devel_, HAIKU_SECONDARY_PACKAGING_ARCH) = R1~alpha4_pm-1 haiku_devel_%HAIKU_SECONDARY_PACKAGING_ARCH% = R1~alpha4_pm-1
} }
requires { requires {
CONCAT(haiku_, HAIKU_SECONDARY_PACKAGING_ARCH) == R1~alpha4_pm-1 haiku_%HAIKU_SECONDARY_PACKAGING_ARCH% == R1~alpha4_pm-1
} }
+1 -1
View File
@@ -1,6 +1,6 @@
name haiku_loader name haiku_loader
version R1~alpha4_pm-1 version R1~alpha4_pm-1
architecture HAIKU_PACKAGING_ARCH architecture %HAIKU_PACKAGING_ARCH%
summary "The Haiku boot loader" summary "The Haiku boot loader"
description "The Haiku boot loader." description "The Haiku boot loader."
+10 -15
View File
@@ -1,14 +1,9 @@
#define DO_CONCAT(a, b) a ## b name haiku_%HAIKU_SECONDARY_PACKAGING_ARCH%
#define CONCAT(a, b) DO_CONCAT(a, b)
#define DO_TO_STRING(x) #x
#define TO_STRING(x) DO_TO_STRING(x)
name CONCAT(haiku_, HAIKU_SECONDARY_PACKAGING_ARCH)
version R1~alpha4_pm-1 version R1~alpha4_pm-1
architecture x86_gcc2 architecture x86_gcc2
summary "The Haiku base system "TO_STRING(HAIKU_SECONDARY_PACKAGING_ARCH)" secondary architecture support" summary "The Haiku base system %HAIKU_SECONDARY_PACKAGING_ARCH% secondary architecture support"
description "The Haiku base system "TO_STRING(HAIKU_SECONDARY_PACKAGING_ARCH)" description "The Haiku base system %HAIKU_SECONDARY_PACKAGING_ARCH%
secondary architecture support includes all system libraries, add-ons, and secondary architecture support includes all system libraries, add-ons, and
other files required to run programs build for that architecture." other files required to run programs build for that architecture."
@@ -22,16 +17,16 @@ licenses {
} }
provides { provides {
CONCAT(haiku_, HAIKU_SECONDARY_PACKAGING_ARCH) = R1~alpha4_pm-1 compat>=R1~alpha1 haiku_%HAIKU_SECONDARY_PACKAGING_ARCH% = R1~alpha4_pm-1 compat>=R1~alpha1
} }
requires { requires {
CONCAT(lib:libfreetype_, HAIKU_SECONDARY_PACKAGING_ARCH) lib:libfreetype_%HAIKU_SECONDARY_PACKAGING_ARCH%
#ifndef HAIKU_BOOTSTRAP_BUILD #ifndef HAIKU_BOOTSTRAP_BUILD
CONCAT(lib:libjpeg_, HAIKU_SECONDARY_PACKAGING_ARCH) lib:libjpeg_%HAIKU_SECONDARY_PACKAGING_ARCH%
CONCAT(lib:libpng_, HAIKU_SECONDARY_PACKAGING_ARCH) lib:libpng_%HAIKU_SECONDARY_PACKAGING_ARCH%
#endif #endif
CONCAT(lib:libsolv_, HAIKU_SECONDARY_PACKAGING_ARCH) lib:libsolv_%HAIKU_SECONDARY_PACKAGING_ARCH%
CONCAT(lib:libsolvext_, HAIKU_SECONDARY_PACKAGING_ARCH) lib:libsolvext_%HAIKU_SECONDARY_PACKAGING_ARCH%
CONCAT(lib:libz_, HAIKU_SECONDARY_PACKAGING_ARCH) lib:libz_%HAIKU_SECONDARY_PACKAGING_ARCH%
} }