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

View File

@ -41,18 +41,22 @@ rule PreprocessPackageInfo source : directory : architecture
local target = $(source:BSG=package-info)-package-info ;
local defines = HAIKU_PACKAGING_ARCH=$(architecture) ;
local sedReplacements = %HAIKU_PACKAGING_ARCH%,$(architecture) ;
if $(HAIKU_BOOTSTRAP_BUILD) {
defines += HAIKU_BOOTSTRAP_BUILD ;
target = $(target)-bootstrap ;
}
if $(secondaryArchitecture) {
defines += HAIKU_SECONDARY_PACKAGING_ARCH=$(secondaryArchitecture) ;
sedReplacements
+= %HAIKU_SECONDARY_PACKAGING_ARCH%,$(secondaryArchitecture) ;
}
MakeLocate $(target) : $(directory) ;
Depends $(target) : $(source) ;
CCDEFS on $(target) = [ FDefines $(defines) ] ;
HAIKU_SED_REPLACEMENTS on $(target) = "-e s,$(sedReplacements),g" ;
PreprocessPackageInfo1 $(target) : $(source) ;
@ -62,7 +66,7 @@ rule PreprocessPackageInfo source : directory : architecture
actions PreprocessPackageInfo1
{
$(HOST_CC) -E -w $(CCDEFS) - -o $(1) < $(2)
sed $(HAIKU_SED_REPLACEMENTS) < $(2) | $(HOST_CC) -E -w $(CCDEFS) - -o $(1)
}

View File

@ -1,6 +1,3 @@
#define DO_CONCAT(a, b) a ## b
#define CONCAT(a, b) DO_CONCAT(a, b)
name haiku_cross_devel
version R1~alpha4_pm-1
architecture any
@ -17,5 +14,5 @@ copyrights "2001-2013 Haiku, Inc. et al"
licenses "MIT"
provides {
CONCAT(haiku_cross_devel_, HAIKU_PACKAGING_ARCH) = R1~alpha4_pm-1
haiku_cross_devel_%HAIKU_PACKAGING_ARCH% = R1~alpha4_pm-1
}

View File

@ -1,6 +1,3 @@
#define DO_CONCAT(a, b) a ## b
#define CONCAT(a, b) DO_CONCAT(a, b)
name haiku_cross_devel_sysroot
version R1~alpha4_pm-1
architecture any
@ -17,5 +14,5 @@ copyrights "2001-2013 Haiku, Inc. et al"
licenses "MIT"
provides {
CONCAT(haiku_cross_devel_sysroot_, HAIKU_PACKAGING_ARCH) = R1~alpha4_pm-1
haiku_cross_devel_sysroot_%HAIKU_PACKAGING_ARCH% = R1~alpha4_pm-1
}

View File

@ -1,6 +1,6 @@
name haiku_devel
version R1~alpha4_pm-1
architecture HAIKU_PACKAGING_ARCH
architecture %HAIKU_PACKAGING_ARCH%
summary "The Haiku base system development files"
description "The package contains all files associated with the base system

View File

@ -1,15 +1,10 @@
#define DO_CONCAT(a, b) a ## b
#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)
name haiku_%HAIKU_SECONDARY_PACKAGING_ARCH%_devel
version R1~alpha4_pm-1
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
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."
packager "The Haiku build system"
@ -19,9 +14,9 @@ copyrights "2001-2013 Haiku, Inc. et al"
licenses "MIT"
provides {
CONCAT(haiku_devel_, HAIKU_SECONDARY_PACKAGING_ARCH) = R1~alpha4_pm-1
haiku_devel_%HAIKU_SECONDARY_PACKAGING_ARCH% = R1~alpha4_pm-1
}
requires {
CONCAT(haiku_, HAIKU_SECONDARY_PACKAGING_ARCH) == R1~alpha4_pm-1
haiku_%HAIKU_SECONDARY_PACKAGING_ARCH% == R1~alpha4_pm-1
}

View File

@ -1,6 +1,6 @@
name haiku_loader
version R1~alpha4_pm-1
architecture HAIKU_PACKAGING_ARCH
architecture %HAIKU_PACKAGING_ARCH%
summary "The Haiku boot loader"
description "The Haiku boot loader."

View File

@ -1,14 +1,9 @@
#define DO_CONCAT(a, b) a ## b
#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)
name haiku_%HAIKU_SECONDARY_PACKAGING_ARCH%
version R1~alpha4_pm-1
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
other files required to run programs build for that architecture."
@ -22,16 +17,16 @@ licenses {
}
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 {
CONCAT(lib:libfreetype_, HAIKU_SECONDARY_PACKAGING_ARCH)
lib:libfreetype_%HAIKU_SECONDARY_PACKAGING_ARCH%
#ifndef HAIKU_BOOTSTRAP_BUILD
CONCAT(lib:libjpeg_, HAIKU_SECONDARY_PACKAGING_ARCH)
CONCAT(lib:libpng_, HAIKU_SECONDARY_PACKAGING_ARCH)
lib:libjpeg_%HAIKU_SECONDARY_PACKAGING_ARCH%
lib:libpng_%HAIKU_SECONDARY_PACKAGING_ARCH%
#endif
CONCAT(lib:libsolv_, HAIKU_SECONDARY_PACKAGING_ARCH)
CONCAT(lib:libsolvext_, HAIKU_SECONDARY_PACKAGING_ARCH)
CONCAT(lib:libz_, HAIKU_SECONDARY_PACKAGING_ARCH)
lib:libsolv_%HAIKU_SECONDARY_PACKAGING_ARCH%
lib:libsolvext_%HAIKU_SECONDARY_PACKAGING_ARCH%
lib:libz_%HAIKU_SECONDARY_PACKAGING_ARCH%
}