summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorQing He <qing.he@intel.com>2011-03-11 17:16:36 +0800
committerSaul Wold <sgw@linux.intel.com>2011-03-14 17:41:46 -0700
commitc455f4ccbdfffc39c4ef97a573e9f44c723f363e (patch)
tree1df4a6f69070fc25901b3201f4ec107c721455a6 /meta/recipes-extended
parentb8f4c95e21c9997b115e8c99a25ac79fdcff6ee9 (diff)
downloadpoky-c455f4ccbdfffc39c4ef97a573e9f44c723f363e.tar.gz
libzypp: add machine arch support
(From OE-Core rev: b463188407c0c783c8d5aeb0098fc59445db57bf) Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/libzypp/libzypp/archconf.patch15
-rw-r--r--meta/recipes-extended/libzypp/libzypp/builtin-arch.patch122
-rw-r--r--meta/recipes-extended/libzypp/libzypp/no-builtin-arch.patch128
-rw-r--r--meta/recipes-extended/libzypp/libzypp_git.bb28
4 files changed, 292 insertions, 1 deletions
diff --git a/meta/recipes-extended/libzypp/libzypp/archconf.patch b/meta/recipes-extended/libzypp/libzypp/archconf.patch
new file mode 100644
index 0000000000..44ebe33592
--- /dev/null
+++ b/meta/recipes-extended/libzypp/libzypp/archconf.patch
@@ -0,0 +1,15 @@
1diff --git a/zypp.conf b/zypp.conf
2index 1e84a3f..7a26548 100644
3--- a/zypp.conf
4+++ b/zypp.conf
5@@ -17,7 +17,10 @@
6 ## ** Changing this needs a full refresh (incl. download)
7 ## ** of all repository data.
8 ##
9+## ** CAUTION: Don't change this value on yocto !
10+##
11 # arch = s390
12+arch = @MACHINE_ARCH@
13
14
15 ##
diff --git a/meta/recipes-extended/libzypp/libzypp/builtin-arch.patch b/meta/recipes-extended/libzypp/libzypp/builtin-arch.patch
new file mode 100644
index 0000000000..53dcfac652
--- /dev/null
+++ b/meta/recipes-extended/libzypp/libzypp/builtin-arch.patch
@@ -0,0 +1,122 @@
1This patch adds the ${MACHINE_ARCH} and ${PACKAGE_ARCH} to
2libzypp available archs, see do_archpatch in .bb for more
3details, this is the version for ${BASE_PACKAGE_ARCH} already
4recognized in libzypp.
5
6Also "all" is added as a synonym for noarch.
7
8Signed-off-by: Qing He <qing.he@intel.com>
9
10diff --git a/zypp/Arch.cc b/zypp/Arch.cc
11index 7b357bb..d9102cc 100644
12--- a/zypp/Arch.cc
13+++ b/zypp/Arch.cc
14@@ -122,7 +122,13 @@ namespace zypp
15
16 /** \relates Arch::CompatEntry */
17 inline bool operator==( const Arch::CompatEntry & lhs, const Arch::CompatEntry & rhs )
18- { return lhs._idStr == rhs._idStr; }
19+ {
20+ if ( (lhs._idStr == "all" && rhs._idStr == "noarch") ||
21+ (lhs._idStr == "noarch" && rhs._idStr == "all") )
22+ return true;
23+ else
24+ return lhs._idStr == rhs._idStr;
25+ }
26 /** \relates Arch::CompatEntry */
27 inline bool operator!=( const Arch::CompatEntry & lhs, const Arch::CompatEntry & rhs )
28 { return ! ( lhs == rhs ); }
29@@ -153,7 +159,7 @@ namespace zypp
30 // bit for each architecture.
31 //
32 #define DEF_BUILTIN(A) const IdString _##A( #A );
33- DEF_BUILTIN( noarch );
34+ const IdString _noarch( "all" );
35
36 DEF_BUILTIN( i386 );
37 DEF_BUILTIN( i486 );
38@@ -202,6 +208,8 @@ namespace zypp
39
40 DEF_BUILTIN( sh4 );
41 DEF_BUILTIN( sh4a );
42+
43+ const IdString _machine( "@MACHINE_ARCH@" );
44 #undef DEF_BUILTIN
45
46 ///////////////////////////////////////////////////////////////////
47@@ -326,12 +334,14 @@ namespace zypp
48 //
49 defCompatibleWith( _sh4, _noarch );
50 defCompatibleWith( _sh4a, _noarch,_sh4 );
51+
52+ defCompatibleWith( _machine, @PKG_ARCH_TAIL@,_@PKG_ARCH@ );
53 //
54 ///////////////////////////////////////////////////////////////////
55 // dumpOn( USR ) << endl;
56 }
57
58- private:
59+ public:
60 /** Return the next avialable _idBit.
61 * Ctor injects _noarch into the _compatSet, 1 is for
62 * nonbuiltin archs, so we can use <tt>size</tt> for
63@@ -440,6 +450,8 @@ namespace zypp
64 const Arch Arch_sh4( _sh4 );
65 const Arch Arch_sh4a( _sh4a );
66
67+ const Arch Arch_machine( _machine );
68+
69 ///////////////////////////////////////////////////////////////////
70 //
71 // METHOD NAME : Arch::Arch
72diff --git a/zypp/Arch.h b/zypp/Arch.h
73index 6b18a6e..092211c 100644
74--- a/zypp/Arch.h
75+++ b/zypp/Arch.h
76@@ -249,6 +249,8 @@ namespace zypp
77 extern const Arch Arch_sh4;
78 /** \relates Arch */
79 extern const Arch Arch_sh4a;
80+
81+ extern const Arch Arch_machine;
82 //@}
83
84 ///////////////////////////////////////////////////////////////////
85diff --git a/zypp/parser/yum/schema/common-inc.rnc b/zypp/parser/yum/schema/common-inc.rnc
86index f12ac3b..24ce06e 100644
87--- a/zypp/parser/yum/schema/common-inc.rnc
88+++ b/zypp/parser/yum/schema/common-inc.rnc
89@@ -26,6 +26,7 @@ private.evr =
90 private.localizedtext = attribute lang { "en" | "de" }, text
91
92 private.archenum = "noarch"
93+ | "all"
94 | "armv4l"
95 | "armv5el"
96 | "armv5tel"
97@@ -46,4 +47,5 @@ private.archenum = "noarch"
98 | "sh4"
99 | "x86_64"
100 | "src"
101+ | "@MACHINE_ARCH@"
102
103diff --git a/zypp/parser/yum/schema/common-inc.rng b/zypp/parser/yum/schema/common-inc.rng
104index 60e5742..8a9ce2e 100644
105--- a/zypp/parser/yum/schema/common-inc.rng
106+++ b/zypp/parser/yum/schema/common-inc.rng
107@@ -89,6 +89,7 @@
108 <define name="private.archenum">
109 <choice>
110 <value>noarch</value>
111+ <value>all</value>
112 <value>armv4l</value>
113 <value>armv5el</value>
114 <value>armv5tel</value>
115@@ -109,6 +110,7 @@
116 <value>sh4</value>
117 <value>x86_64</value>
118 <value>src</value>
119+ <value>@MACHINE_ARCH@</value>
120 </choice>
121 </define>
122 </grammar>
diff --git a/meta/recipes-extended/libzypp/libzypp/no-builtin-arch.patch b/meta/recipes-extended/libzypp/libzypp/no-builtin-arch.patch
new file mode 100644
index 0000000000..22dd89c45f
--- /dev/null
+++ b/meta/recipes-extended/libzypp/libzypp/no-builtin-arch.patch
@@ -0,0 +1,128 @@
1This patch adds the ${MACHINE_ARCH} and ${PACKAGE_ARCH} to
2libzypp available archs, see do_archpatch in .bb for more
3details, this is the version for ${BASE_PACKAGE_ARCH} not
4recognized in libzypp.
5
6Also "all" is added as a synonym for noarch.
7
8Signed-off-by: Qing He <qing.he@intel.com>
9
10diff --git a/zypp/Arch.cc b/zypp/Arch.cc
11index 7b357bb..d4cbca6 100644
12--- a/zypp/Arch.cc
13+++ b/zypp/Arch.cc
14@@ -122,7 +122,13 @@ namespace zypp
15
16 /** \relates Arch::CompatEntry */
17 inline bool operator==( const Arch::CompatEntry & lhs, const Arch::CompatEntry & rhs )
18- { return lhs._idStr == rhs._idStr; }
19+ {
20+ if ( (lhs._idStr == "all" && rhs._idStr == "noarch") ||
21+ (lhs._idStr == "noarch" && rhs._idStr == "all") )
22+ return true;
23+ else
24+ return lhs._idStr == rhs._idStr;
25+ }
26 /** \relates Arch::CompatEntry */
27 inline bool operator!=( const Arch::CompatEntry & lhs, const Arch::CompatEntry & rhs )
28 { return ! ( lhs == rhs ); }
29@@ -153,7 +159,7 @@ namespace zypp
30 // bit for each architecture.
31 //
32 #define DEF_BUILTIN(A) const IdString _##A( #A );
33- DEF_BUILTIN( noarch );
34+ const IdString _noarch( "all" );
35
36 DEF_BUILTIN( i386 );
37 DEF_BUILTIN( i486 );
38@@ -202,6 +208,9 @@ namespace zypp
39
40 DEF_BUILTIN( sh4 );
41 DEF_BUILTIN( sh4a );
42+
43+ const IdString _package( "@PKG_ARCH@" );
44+ const IdString _machine( "@MACHINE_ARCH@" );
45 #undef DEF_BUILTIN
46
47 ///////////////////////////////////////////////////////////////////
48@@ -326,12 +335,15 @@ namespace zypp
49 //
50 defCompatibleWith( _sh4, _noarch );
51 defCompatibleWith( _sh4a, _noarch,_sh4 );
52+
53+ defCompatibleWith( _package, _noarch );
54+ defCompatibleWith( _machine, _noarch,_package );
55 //
56 ///////////////////////////////////////////////////////////////////
57 // dumpOn( USR ) << endl;
58 }
59
60- private:
61+ public:
62 /** Return the next avialable _idBit.
63 * Ctor injects _noarch into the _compatSet, 1 is for
64 * nonbuiltin archs, so we can use <tt>size</tt> for
65@@ -440,6 +452,9 @@ namespace zypp
66 const Arch Arch_sh4( _sh4 );
67 const Arch Arch_sh4a( _sh4a );
68
69+ const Arch Arch_package( _package );
70+ const Arch Arch_machine( _machine );
71+
72 ///////////////////////////////////////////////////////////////////
73 //
74 // METHOD NAME : Arch::Arch
75diff --git a/zypp/Arch.h b/zypp/Arch.h
76index 6b18a6e..f91a562 100644
77--- a/zypp/Arch.h
78+++ b/zypp/Arch.h
79@@ -249,6 +249,9 @@ namespace zypp
80 extern const Arch Arch_sh4;
81 /** \relates Arch */
82 extern const Arch Arch_sh4a;
83+
84+ extern const Arch Arch_package;
85+ extern const Arch Arch_machine;
86 //@}
87
88 ///////////////////////////////////////////////////////////////////
89diff --git a/zypp/parser/yum/schema/common-inc.rnc b/zypp/parser/yum/schema/common-inc.rnc
90index f12ac3b..04677c3 100644
91--- a/zypp/parser/yum/schema/common-inc.rnc
92+++ b/zypp/parser/yum/schema/common-inc.rnc
93@@ -26,6 +26,7 @@ private.evr =
94 private.localizedtext = attribute lang { "en" | "de" }, text
95
96 private.archenum = "noarch"
97+ | "all"
98 | "armv4l"
99 | "armv5el"
100 | "armv5tel"
101@@ -46,4 +47,6 @@ private.archenum = "noarch"
102 | "sh4"
103 | "x86_64"
104 | "src"
105+ | "@PKG_ARCH@"
106+ | "@MACHINE_ARCH@"
107
108diff --git a/zypp/parser/yum/schema/common-inc.rng b/zypp/parser/yum/schema/common-inc.rng
109index 60e5742..27694aa 100644
110--- a/zypp/parser/yum/schema/common-inc.rng
111+++ b/zypp/parser/yum/schema/common-inc.rng
112@@ -89,6 +89,7 @@
113 <define name="private.archenum">
114 <choice>
115 <value>noarch</value>
116+ <value>all</value>
117 <value>armv4l</value>
118 <value>armv5el</value>
119 <value>armv5tel</value>
120@@ -109,6 +110,8 @@
121 <value>sh4</value>
122 <value>x86_64</value>
123 <value>src</value>
124+ <value>@PKG_ARCH@</value>
125+ <value>@MACHINE_ARCH@</value>
126 </choice>
127 </define>
128 </grammar>
diff --git a/meta/recipes-extended/libzypp/libzypp_git.bb b/meta/recipes-extended/libzypp/libzypp_git.bb
index b9110eb09e..825339d126 100644
--- a/meta/recipes-extended/libzypp/libzypp_git.bb
+++ b/meta/recipes-extended/libzypp/libzypp_git.bb
@@ -13,12 +13,15 @@ RDEPENDS_${PN} = "sat-solver"
13 13
14S = "${WORKDIR}/git" 14S = "${WORKDIR}/git"
15PV = "0.0-git${SRCPV}" 15PV = "0.0-git${SRCPV}"
16PR = "r6" 16PR = "r7"
17 17
18SRC_URI = "git://gitorious.org/opensuse/libzypp.git;protocol=git \ 18SRC_URI = "git://gitorious.org/opensuse/libzypp.git;protocol=git \
19 file://no-doc.patch \ 19 file://no-doc.patch \
20 file://rpm5.patch \ 20 file://rpm5.patch \
21 file://rpm5-no-rpmdbinit.patch \ 21 file://rpm5-no-rpmdbinit.patch \
22 file://builtin-arch.patch;apply=no \
23 file://no-builtin-arch.patch;apply=no \
24 file://archconf.patch;apply=no \
22 " 25 "
23 26
24SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch" 27SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch"
@@ -27,3 +30,26 @@ FILES_${PN} += "${libdir}/zypp ${datadir}/zypp ${datadir}/icons"
27FILES_${PN}-dev += "${datadir}/cmake" 30FILES_${PN}-dev += "${datadir}/cmake"
28 31
29EXTRA_OECMAKE += "-DLIB=lib" 32EXTRA_OECMAKE += "-DLIB=lib"
33
34PACKAGE_ARCH = "${MACHINE_ARCH}"
35
36do_archpatch () {
37 PKG_ARCH_TAIL=`sed -n ${S}/zypp/Arch.cc -e "s|^.*defCompatibleWith( _${BASE_PACKAGE_ARCH},[ \t]*\(.*\) .*$|\1|p"`
38 if [ "x${PKG_ARCH_TAIL}" == x ]; then
39 PATCHFILE=${WORKDIR}/no-builtin-arch.patch
40 else
41 PATCHFILE=${WORKDIR}/builtin-arch.patch
42 fi
43
44 sed -i "${PATCHFILE}" \
45 -e "s|@MACHINE_ARCH@|${MACHINE_ARCH}|g" \
46 -e "s|@PKG_ARCH@|${BASE_PACKAGE_ARCH}|g" \
47 -e "s|@PKG_ARCH_TAIL@|${PKG_ARCH_TAIL}|g"
48
49 patch -p1 -i "${PATCHFILE}"
50
51 sed -i ${WORKDIR}/archconf.patch -e "s|@MACHINE_ARCH@|${MACHINE_ARCH}|g"
52 patch -p1 -i ${WORKDIR}/archconf.patch
53}
54
55addtask archpatch before do_patch after do_unpack