<commit_before>#
# base recipe: meta/recipes-devtools/bison/bison_2.7.1.bb
# base branch: daisy
#

PR = "r0"

inherit debian-package

LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = " \
	file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
"

DEPENDS = "bison-native flex-native"
DEPENDS_class-native = "gettext-minimal-native"

# Exclude following patches because they were tried to apply on 
# doc/Makefile.am but there is no such file:
# fix_cross_manpage_building.patch
# dont-depend-on-help2man.patch
# FIXME: file doc/bison.texi is missing, temporarily build without document
# and examples for minimal implementation with
# remove-document-examples-target.patch

BASE_SRC_URI = " \
	file://m4.patch \
	file://remove-document-examples-target.patch \
"

SRC_URI_class-native = " \
	${DEBIAN_SRC_URI} \
	${BASE_SRC_URI} \
"

SRC_URI += " \
	${BASE_SRC_URI} \
"

# avoid a parallel build problem in src/yacc
PARALLEL_MAKE = ""

# No point in hardcoding path to m4, just use PATH
EXTRA_OECONF += "M4=m4"

LDFLAGS_prepend_libc-uclibc = " -lrt "

inherit autotools gettext
acpaths = "-I ${S}/m4"

do_configure_prepend(){
	# Fix error gettext infrastructure mismatch
	cp ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/runtime-po/
}

# Follow debian, rename yacc to bison.yacc
do_install_append(){
	mv ${D}${bindir}/yacc ${D}${bindir}/bison.yacc
}

do_install_append_class-native() {
	create_wrapper ${D}/${bindir}/bison \
		BISON_PKGDATADIR=${STAGING_DATADIR_NATIVE}/bison
}
BBCLASSEXTEND = "native nativesdk"<commit_msg>bison: Use update-alternatives to create link for yacc<commit_after>#
# base recipe: meta/recipes-devtools/bison/bison_2.7.1.bb
# base branch: daisy
#

PR = "r1"

inherit debian-package

LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = " \
	file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
"

DEPENDS = "bison-native flex-native"
DEPENDS_class-native = "gettext-minimal-native"

# Exclude following patches because they were tried to apply on 
# doc/Makefile.am but there is no such file:
# fix_cross_manpage_building.patch
# dont-depend-on-help2man.patch
# FIXME: file doc/bison.texi is missing, temporarily build without document
# and examples for minimal implementation with
# remove-document-examples-target.patch

BASE_SRC_URI = " \
	file://m4.patch \
	file://remove-document-examples-target.patch \
"

SRC_URI_class-native = " \
	${DEBIAN_SRC_URI} \
	${BASE_SRC_URI} \
"

SRC_URI += " \
	${BASE_SRC_URI} \
"

# avoid a parallel build problem in src/yacc
PARALLEL_MAKE = ""

# No point in hardcoding path to m4, just use PATH
EXTRA_OECONF += "M4=m4"

LDFLAGS_prepend_libc-uclibc = " -lrt "

inherit autotools gettext update-alternatives
acpaths = "-I ${S}/m4"

do_configure_prepend(){
	# Fix error gettext infrastructure mismatch
	cp ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/runtime-po/
}

# Follow debian, rename yacc to bison.yacc
do_install_append_class-target(){
	mv ${D}${bindir}/yacc ${D}${bindir}/bison.yacc
}

do_install_append_class-native() {
	create_wrapper ${D}/${bindir}/bison \
		BISON_PKGDATADIR=${STAGING_DATADIR_NATIVE}/bison
}

# Follow debian/bison.postinst
ALTERNATIVE_${PN} = "yacc"
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE_LINK_NAME[yacc] = "${bindir}/yacc"
ALTERNATIVE_TARGET[yacc] = "${bindir}/bison.yacc"

BBCLASSEXTEND = "native nativesdk"
{'fraction_non_alphanumeric': 0.128709872804361, 'fraction_numerical': 0.020896426408237433, 'mean_word_length': 4.815140845070423, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2121000', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1277, 'n_words': 251}