<commit_before>require git.inc

SRC_URI += "file://git-less-hardlinks.diff;patch=1"

SRC_URI[src.md5sum] = "d94314eb49622a945b22595b36b7fc47"
SRC_URI[src.sha256sum] = "dd9dfcf1da59f09c4b66b53836b56fcb2208d0be9edf1f8b9079c7e980435086"
PR = "r1"

EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no ac_cv_c_c99_format=yes"
EXTRA_OECONF += "NO_TCLTK=yes"

EXTRA_OEMAKE += "V=1"

DEPENDS = "openssl curl zlib expat"
RDEPENDS_${PN} = "findutils sed"

# Dropbear ssh needs a wrapper script, so install openssh-ssh to make it work out of the box
RRECOMMENDS_${PN} = "openssh-ssh"

do_install_append() {
	# Fix broken hardlinks
	for gitprog in git-receive-pack git-upload-archive ; do
		rm ${D}${bindir}/$gitprog
		ln -sf ${bindir}/git ${D}${bindir}/$gitprog
	done
	for gitprog in git-cvsserver git-shell git-upload-pack ; do
		rm ${D}${libexecdir}/git-core/$gitprog
		ln -sf ${bindir}/$gitprog ${D}${libexecdir}/git-core/$gitprog
	done
	rm ${D}${libexecdir}/git-core/git && ln -sf ${bindir}/git ${D}${libexecdir}/git-core/git
	
	# Bash completion
	install -d ${D}${sysconfdir}/bash_completion.d/
	install -m 0755 contrib/completion/git-completion.bash ${D}${sysconfdir}/bash_completion.d/git
}

FILES_${PN}-dbg += "${libexecdir}/git-core/.debug"

PACKAGES =+ "${PN}-perltools"
FILES_${PN}-perltools += " \
	${libexecdir}/git-core/git-add--interactive \
	${libexecdir}/git-core/git-archimport \
	${libexecdir}/git-core/git-cvsexportcommit \
	${libexecdir}/git-core/git-cvsimport \
	${libexecdir}/git-core/git-cvsserver \
	${bindir}/git-cvsserver \
	${libexecdir}/git-core/git-difftool \
	${libexecdir}/git-core/git-relink \
	${libexecdir}/git-core/git-send-email \
	${libexecdir}/git-core/git-svn \
	${datadir}/perl5 \
"
RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"

# # git-tk package with gitk and git-gui
# PACKAGES =+ "${PN}-tk"
# DEPENDS += "tcl-native"
# RDEPENDS_${PN}-tk = "${PN} tk tcl"
# EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
# FILES_${PN}-tk = " \
# 	${bindir}/gitk \
# 	${datadir}/gitk \
# "<commit_msg>Git: change path to perl module<commit_after>require git.inc

SRC_URI += "file://git-less-hardlinks.diff;patch=1"

SRC_URI[src.md5sum] = "d94314eb49622a945b22595b36b7fc47"
SRC_URI[src.sha256sum] = "dd9dfcf1da59f09c4b66b53836b56fcb2208d0be9edf1f8b9079c7e980435086"
PR = "r2"

EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no ac_cv_c_c99_format=yes"
EXTRA_OECONF += "NO_TCLTK=yes"

EXTRA_OEMAKE += "V=1"

DEPENDS = "openssl curl zlib expat"
RDEPENDS_${PN} = "findutils sed"

# Dropbear ssh needs a wrapper script, so install openssh-ssh to make it work out of the box
RRECOMMENDS_${PN} = "openssh-ssh"

do_install_append() {
	# Fix broken hardlinks
	for gitprog in git-receive-pack git-upload-archive ; do
		rm ${D}${bindir}/$gitprog
		ln -sf ${bindir}/git ${D}${bindir}/$gitprog
	done
	for gitprog in git-cvsserver git-shell git-upload-pack ; do
		rm ${D}${libexecdir}/git-core/$gitprog
		ln -sf ${bindir}/$gitprog ${D}${libexecdir}/git-core/$gitprog
	done
	rm ${D}${libexecdir}/git-core/git && ln -sf ${bindir}/git ${D}${libexecdir}/git-core/git
	
	# Bash completion
	install -d ${D}${sysconfdir}/bash_completion.d/
	install -m 0755 contrib/completion/git-completion.bash ${D}${sysconfdir}/bash_completion.d/git
}

FILES_${PN}-dbg += "${libexecdir}/git-core/.debug"

PACKAGES =+ "${PN}-perltools"
FILES_${PN}-perltools += " \
	${libexecdir}/git-core/git-add--interactive \
	${libexecdir}/git-core/git-archimport \
	${libexecdir}/git-core/git-cvsexportcommit \
	${libexecdir}/git-core/git-cvsimport \
	${libexecdir}/git-core/git-cvsserver \
	${bindir}/git-cvsserver \
	${libexecdir}/git-core/git-difftool \
	${libexecdir}/git-core/git-relink \
	${libexecdir}/git-core/git-send-email \
	${libexecdir}/git-core/git-svn \
	${libdir}/perl5 \
"
RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"

# # git-tk package with gitk and git-gui
# PACKAGES =+ "${PN}-tk"
# DEPENDS += "tcl-native"
# RDEPENDS_${PN}-tk = "${PN} tk tcl"
# EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
# FILES_${PN}-tk = " \
# 	${bindir}/gitk \
# 	${datadir}/gitk \
# "
{'fraction_non_alphanumeric': 0.18007290400972054, 'fraction_numerical': 0.03645200486026731, 'mean_word_length': 4.748603351955308, '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': '7116109', 'n_tokens_mistral': 1899, 'n_tokens_neox': 1763, 'n_words': 267}