summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/libzypp/libzypp_git.bb
blob: 809c1877f50fc773477e84395dc77eff98740132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
HOMEPAGE = "http://en.opensue.org/Portal:Libzypp"
DESCRIPTION  = "The ZYpp Linux Software management framework"

LICENSE  = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=11fccc94d26293d78cb4996cb17e5fa7"

inherit cmake

DEPENDS  = "rpm boost gettext curl libxml2 zlib sat-solver expat openssl udev"

# rpmdb2solv from sat-solver is run from libzypp
RDEPENDS_${PN} = "sat-solver"

S = "${WORKDIR}/git"
PV = "0.0-git${SRCPV}"
PR = "r9"

SRC_URI = "git://gitorious.org/opensuse/libzypp.git;protocol=git \
           file://no-doc.patch \
           file://rpm5.patch \
           file://rpm5-no-rpmdbinit.patch \
	   file://config-release.patch \
	   file://libzypp-pokyarch.patch \
          "

SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch"

FILES_${PN} += "${libdir}/zypp ${datadir}/zypp ${datadir}/icons"
FILES_${PN}-dev += "${datadir}/cmake"

EXTRA_OECMAKE += "-DLIB=lib"

PACKAGE_ARCH = "${MACHINE_ARCH}"

do_archgen () {
	# We need to dynamically generate our arch file based on the machine
	# configuration
	echo "/* Automatically generated by the libzypp recipes */" 		 > zypp/poky-arch.h
	echo ""									>> zypp/poky-arch.h
	echo "#ifndef POKY_ARCH_H"						>> zypp/poky-arch.h
	echo "#define POKY_ARCH_H 1"						>> zypp/poky-arch.h
	echo "#define Arch_machine Arch_${MACHINE_ARCH}"			>> zypp/poky-arch.h
	echo "#endif /* POKY_ARCH_H */"						>> zypp/poky-arch.h
	echo ""									>> zypp/poky-arch.h
	echo "#ifdef DEF_BUILTIN"						>> zypp/poky-arch.h
	echo "/* Specify builtin types */"					>> zypp/poky-arch.h
	for each_arch in ${PACKAGE_ARCHS} ; do
		case "$each_arch" in
			all | any | noarch)
				continue;;
		esac
		echo "    DEF_BUILTIN( ${each_arch} );"				>> zypp/poky-arch.h
	done
	echo "#endif /* DEF_BUILTIN */"						>> zypp/poky-arch.h
	echo ""									>> zypp/poky-arch.h
	echo "#ifdef POKY_EXTERN_PROTO"						>> zypp/poky-arch.h
	echo "/* Specify extern prototypes */"					>> zypp/poky-arch.h
	for each_arch in ${PACKAGE_ARCHS} ; do
		case "$each_arch" in
			all | any | noarch)
				continue;;
		esac
		echo "  extern const Arch Arch_${each_arch};"			>> zypp/poky-arch.h
	done
	echo "#endif /* POKY_EXTERN_PROTO */"					>> zypp/poky-arch.h
	echo ""									>> zypp/poky-arch.h
	echo "#ifdef POKY_PROTO"						>> zypp/poky-arch.h
	echo "/* Specify prototypes */"						>> zypp/poky-arch.h
	for each_arch in ${PACKAGE_ARCHS} ; do
		case "$each_arch" in
			all | any | noarch)
				continue;;
		esac
		echo "  const Arch Arch_${each_arch} (_${each_arch});"		>> zypp/poky-arch.h
	done
	echo "#endif /* POKY_PROTO */"						>> zypp/poky-arch.h
	echo ""									>> zypp/poky-arch.h
	echo "#ifdef POKY_DEF_COMPAT"						>> zypp/poky-arch.h
	echo "/* Specify compatibility information */"				>> zypp/poky-arch.h
	INSTALL_PLATFORM_ARCHS=""
	for each_arch in ${PACKAGE_ARCHS} ; do
		INSTALL_PLATFORM_ARCHS="$each_arch $INSTALL_PLATFORM_ARCHS"
	done

	COMPAT_WITH=""
	set -- ${INSTALL_PLATFORM_ARCHS}
	while [ $# -gt 0 ]; do
		case "$1" in
			all | any | noarch)
				shift ; continue;;
		esac
		ARCH=_"$1"
		shift
		COMPAT=""
		for each_arch in "$@"; do
			if [ -z "$COMPAT" ]; then
				COMPAT=_"$each_arch"
			else
				COMPAT=_"$each_arch,$COMPAT"
			fi
		done
		COMPAT_WITH="${ARCH},${COMPAT} $COMPAT_WITH"
	done
	for each_compat in ${COMPAT_WITH} ; do
		echo "        defCompatibleWith( ${each_compat} );"		>> zypp/poky-arch.h
	done
	echo "#endif /* DEF_COMPAT */"						>> zypp/poky-arch.h
	echo ""									>> zypp/poky-arch.h
}

addtask archgen before do_configure after do_patch