Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | SUMMARY = "Distributed version control system" |
| 2 | HOMEPAGE = "http://git-scm.com" |
| 3 | DESCRIPTION = "Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency." |
| 4 | SECTION = "console/utils" |
| 5 | LICENSE = "GPL-2.0-only" |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame^] | 6 | DEPENDS = "openssl zlib" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 7 | |
| 8 | PROVIDES:append:class-native = " git-replacement-native" |
| 9 | |
| 10 | SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ |
| 11 | file://fixsort.patch \ |
| 12 | file://0001-config.mak.uname-do-not-force-RHEL-7-specific-build-.patch \ |
| 13 | " |
| 14 | |
| 15 | S = "${WORKDIR}/git-${PV}" |
| 16 | |
| 17 | LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1" |
| 18 | |
| 19 | CVE_PRODUCT = "git-scm:git" |
| 20 | |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame^] | 21 | PACKAGECONFIG ??= "expat curl" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 22 | PACKAGECONFIG[cvsserver] = "" |
| 23 | PACKAGECONFIG[svn] = "" |
| 24 | PACKAGECONFIG[manpages] = ",,asciidoc-native xmlto-native" |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame^] | 25 | PACKAGECONFIG[curl] = "--with-curl,--without-curl,curl" |
| 26 | PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 27 | |
| 28 | EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \ |
| 29 | --without-tcltk \ |
| 30 | --without-iconv \ |
| 31 | " |
| 32 | EXTRA_OECONF:append:class-nativesdk = " --with-gitconfig=/etc/gitconfig " |
| 33 | |
| 34 | # Needs brokensep as this doesn't use automake |
| 35 | inherit autotools-brokensep perlnative bash-completion manpages |
| 36 | |
| 37 | EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'" |
| 38 | EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'" |
| 39 | EXTRA_OEMAKE += "COMPUTE_HEADER_DEPENDENCIES=no" |
| 40 | EXTRA_OEMAKE:append:class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1" |
| 41 | |
| 42 | do_compile:prepend () { |
| 43 | # Remove perl/perl.mak to fix the out-of-date perl.mak error |
| 44 | # during rebuild |
| 45 | rm -f perl/perl.mak |
| 46 | |
| 47 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'manpages', d)}" ]; then |
| 48 | oe_runmake man |
| 49 | fi |
| 50 | } |
| 51 | |
| 52 | do_install () { |
| 53 | oe_runmake install DESTDIR="${D}" bindir=${bindir} \ |
| 54 | template_dir=${datadir}/git-core/templates |
| 55 | |
| 56 | install -d ${D}/${datadir}/bash-completion/completions/ |
| 57 | install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git |
| 58 | |
| 59 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'manpages', d)}" ]; then |
| 60 | oe_runmake install-man DESTDIR="${D}" |
| 61 | fi |
| 62 | } |
| 63 | |
| 64 | perl_native_fixup () { |
| 65 | sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \ |
| 66 | -e 's#${libdir}/perl-native/#${libdir}/#' \ |
| 67 | ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')} |
| 68 | |
| 69 | if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then |
| 70 | # Only install the git cvsserver command if explicitly requested |
| 71 | # as it requires the DBI Perl module, which does not exist in |
| 72 | # OE-Core. |
| 73 | rm ${D}${libexecdir}/git-core/git-cvsserver \ |
| 74 | ${D}${bindir}/git-cvsserver |
| 75 | fi |
| 76 | |
| 77 | if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then |
| 78 | # Only install the git svn command and all Git::SVN Perl modules |
| 79 | # if explicitly requested as they require the SVN::Core Perl |
| 80 | # module, which does not exist in OE-Core. |
| 81 | rm -r ${D}${libexecdir}/git-core/git-svn \ |
| 82 | ${D}${datadir}/perl5/Git/SVN* |
| 83 | fi |
| 84 | } |
| 85 | |
| 86 | REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core" |
| 87 | REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates" |
| 88 | |
| 89 | do_install:append:class-target () { |
| 90 | perl_native_fixup |
| 91 | } |
| 92 | |
| 93 | do_install:append:class-native() { |
| 94 | create_wrapper ${D}${bindir}/git \ |
| 95 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 96 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 97 | } |
| 98 | |
| 99 | do_install:append:class-nativesdk() { |
| 100 | create_wrapper ${D}${bindir}/git \ |
| 101 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 102 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 103 | perl_native_fixup |
| 104 | } |
| 105 | |
| 106 | FILES:${PN} += "${datadir}/git-core ${libexecdir}/git-core/" |
| 107 | |
| 108 | PERLTOOLS = " \ |
| 109 | ${bindir}/git-cvsserver \ |
| 110 | ${libexecdir}/git-core/git-add--interactive \ |
| 111 | ${libexecdir}/git-core/git-archimport \ |
| 112 | ${libexecdir}/git-core/git-cvsexportcommit \ |
| 113 | ${libexecdir}/git-core/git-cvsimport \ |
| 114 | ${libexecdir}/git-core/git-cvsserver \ |
| 115 | ${libexecdir}/git-core/git-send-email \ |
| 116 | ${libexecdir}/git-core/git-svn \ |
| 117 | ${libexecdir}/git-core/git-instaweb \ |
| 118 | ${datadir}/gitweb/gitweb.cgi \ |
| 119 | ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \ |
| 120 | ${datadir}/git-core/templates/hooks/pre-rebase.sample \ |
| 121 | ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \ |
| 122 | " |
| 123 | |
| 124 | # Git tools requiring perl |
| 125 | PACKAGES =+ "${PN}-perltools" |
| 126 | FILES:${PN}-perltools += " \ |
| 127 | ${PERLTOOLS} \ |
| 128 | ${libdir}/perl \ |
| 129 | ${datadir}/perl5 \ |
| 130 | " |
| 131 | |
| 132 | RDEPENDS:${PN}-perltools = "${PN} perl perl-module-file-path findutils" |
| 133 | |
| 134 | # git-tk package with gitk and git-gui |
| 135 | PACKAGES =+ "${PN}-tk" |
| 136 | #RDEPENDS_${PN}-tk = "${PN} tk tcl" |
| 137 | #EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh" |
| 138 | FILES:${PN}-tk = " \ |
| 139 | ${bindir}/gitk \ |
| 140 | ${datadir}/gitk \ |
| 141 | " |
| 142 | |
| 143 | PACKAGES =+ "gitweb" |
| 144 | FILES:gitweb = "${datadir}/gitweb/" |
| 145 | RDEPENDS:gitweb = "perl" |
| 146 | |
| 147 | BBCLASSEXTEND = "native nativesdk" |
| 148 | |
| 149 | EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no \ |
| 150 | ac_cv_fread_reads_directories=${ac_cv_fread_reads_directories=yes} \ |
| 151 | " |
| 152 | EXTRA_OEMAKE += "NO_GETTEXT=1" |
| 153 | |
| 154 | SRC_URI[tarball.sha256sum] = "9845a37dd01f9faaa7d8aa2078399d3aea91b43819a5efea6e2877b0af09bd43" |