<commit_before>#
# Base recipe: 
#	meta/recipes-graphics/pango/pango.inc
#	meta/recipes-graphics/pango/pango_1.36.2.bb
# Base branch: daisy
# Base commit: <PASSWORD>
#

SUMMARY = "Framework for layout and rendering of internationalized text"
DESCRIPTION = "Pango is a library for laying out and rendering of text, \
with an emphasis on internationalization. Pango can be used anywhere \
that text layout is needed, though most of the work on Pango so far has \
been done in the context of the GTK+ widget toolkit. Pango forms the \
core of text and font handling for GTK+-2.x."
HOMEPAGE = "http://www.pango.org/"
BUGTRACKER = "http://bugzilla.gnome.org"

PR = "r1"
DPN = "pango1.0"

X11DEPENDS = "virtual/libx11 libxft"
DEPENDS = "glib-2.0 fontconfig freetype zlib virtual/libiconv cairo harfbuzz qemu-native"

PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
PACKAGECONFIG[x11] = "--with-xft,--without-xft,${X11DEPENDS}"

BBCLASSEXTEND = "native"
DEPENDS_class-native = "glib-2.0-native cairo-native harfbuzz-native"

inherit gnomebase gtk-doc qemu debian-package
PV = "1.36.8"

# Remove dependency on gnome
DEPENDS_remove = "gnome-common-native"

LICENSE = "LGPLv2.0+"
LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"

EXTRA_AUTORECONF = ""

#Remove unrecognised options: --with-mlprefix
EXTRA_OECONF = "--disable-introspection \
		--enable-explicit-deps=no \
	        --disable-debug \
"

GNOME_COMPRESS_TYPE="xz"

LEAD_SONAME = "libpango-1.0*"
LIBV = "1.8.0"

postinst_prologue() {
if ! [ -e $D${sysconfdir}/pango ] ; then
	mkdir -p $D${sysconfdir}/pango
fi

if [ "x$D" != "x" ]; then
	${@qemu_run_binary(d, '$D','${bindir}/${MLPREFIX}pango-querymodules')} \
		$D${libdir}/pango/${LIBV}/modules/*.so \
		> $D${sysconfdir}/pango/${MLPREFIX}pango.modules 2>/dev/null

	[ $? -ne 0 ] && exit 1

	sed -i -e "s:$D::" $D${sysconfdir}/pango/${MLPREFIX}pango.modules

	exit 0
fi
}

#Remove doc when build
do_configure_prepend() {
        sed -i -e "s/docs//" ${S}/Makefile.am
        sed -i -e "/docs\/Makefile/d" ${S}/configure.ac
        sed -i -e "/docs\/version.xml/d" ${S}/configure.ac
        sed -i -e "/GTK_DOC_CHECK/d" ${S}/configure.ac
}

do_install_append () {
	if [ "${MLPREFIX}" != "" ]; then
		mv ${D}/${bindir}/pango-querymodules ${D}/${bindir}/${MLPREFIX}pango-querymodules 
	fi<commit_msg>pango: Config as Debian and install missing files<commit_after>#
# Base recipe: 
#	meta/recipes-graphics/pango/pango.inc
#	meta/recipes-graphics/pango/pango_1.36.2.bb
# Base branch: daisy
# Base commit: <PASSWORD>
#

SUMMARY = "Framework for layout and rendering of internationalized text"
DESCRIPTION = "Pango is a library for laying out and rendering of text, \
with an emphasis on internationalization. Pango can be used anywhere \
that text layout is needed, though most of the work on Pango so far has \
been done in the context of the GTK+ widget toolkit. Pango forms the \
core of text and font handling for GTK+-2.x."
HOMEPAGE = "http://www.pango.org/"
BUGTRACKER = "http://bugzilla.gnome.org"

PR = "r2"
DPN = "pango1.0"

X11DEPENDS = "virtual/libx11 libxft"
DEPENDS = "glib-2.0 fontconfig freetype cairo harfbuzz qemu-native"

PACKAGECONFIG ??= "${@<EMAIL>.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
PACKAGECONFIG[x11] = "--with-xft,--without-xft,${X11DEPENDS}"

BBCLASSEXTEND = "native"
DEPENDS_class-native = "glib-2.0-native cairo-native harfbuzz-native"

inherit gnomebase gtk-doc qemu debian-package
PV = "1.36.8"

LICENSE = "LGPLv2.0+"
LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"

EXTRA_AUTORECONF = ""

EXTRA_OECONF = " \
    --htmldir=${docdir}/libpango1.0-doc \
    --with-included-modules \
"

# Don't let explicit-deps auto or other packages will fail when cross-build using libpango*
EXTRA_OECONF += "--enable-explicit-deps=no"

LEAD_SONAME = "libpango-1.0*"
LIBV = "1.8.0"

postinst_prologue() {
if ! [ -e $D${sysconfdir}/pango ] ; then
	mkdir -p $D${sysconfdir}/pango
fi

if [ "x$D" != "x" ]; then
	${@qemu_run_binary(d, '$D','${bindir}/${MLPREFIX}pango-querymodules')} \
		$D${libdir}/pango/${LIBV}/modules/*.so \
		> $D${sysconfdir}/pango/${MLPREFIX}pango.modules 2>/dev/null

	[ $? -ne 0 ] && exit 1

	sed -i -e "s:$D::" $D${sysconfdir}/pango/${MLPREFIX}pango.modules

	exit 0
fi
}

#Remove doc when build
do_configure_prepend() {
	sed -i -e "s/docs//" ${S}/Makefile.am
	sed -i -e "/docs\/Makefile/d" ${S}/configure.ac
	sed -i -e "/docs\/version.xml/d" ${S}/configure.ac
	sed -i -e "/GTK_DOC_CHECK/d" ${S}/configure.ac
}

do_configure_append() {
	mkdir -p ${WORKDIR}/build-static
	cd ${WORKDIR}/build-static
	oe_runconf --disable-shared --enable-static
	cd -
}

do_compile_append() {
	oe_runmake -C ${WORKDIR}/build-static
}

do_install_append () {
	# Install static libs
	oe_runmake -C ${WORKDIR}/build-static install \
		DESTDIR="${WORKDIR}/image-static"
	cp ${WORKDIR}/image-static/${libdir}/*.a ${D}${libdir}/

	if [ "${MLPREFIX}" != "" ]; then
		mv ${D}/${bindir}/pango-querymodules ${D}/${bindir}/${MLPREFIX}pango-querymodules 
	fi

	install -d ${D}${docdir}/libpango1.0-doc/pango \
	           ${D}${datadir}/gtk-doc/html
	# According to debian/libpango1.0-doc.install.in
	install -m 0644 ${S}/docs/html/* ${D}${docdir}/libpango1.0-doc/pango/

	# According to debian/libpango1.0-doc.links.in
	ln -sf ../libglib2.0-doc/glib ${D}${docdir}/libpango1.0-doc/glib
	ln -sf ../libglib2.0-doc/gobject ${D}${docdir}/libpango1.0-doc/gobject
	ln -sf ../../doc/libpango1.0-doc/pango ${D}${datadir}/gtk-doc/html/pango
{'fraction_non_alphanumeric': 0.1748011569052784, 'fraction_numerical': 0.026030368763557483, 'mean_word_length': 3.913854351687389, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4024360', 'n_tokens_mistral': 2324, 'n_tokens_neox': 2240, 'n_words': 469}