Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Distributed version control system" |
| 2 | HOMEPAGE = "http://git-scm.com" |
| 3 | SECTION = "console/utils" |
| 4 | LICENSE = "GPLv2" |
| 5 | DEPENDS = "openssl curl zlib expat" |
| 6 | |
| 7 | PROVIDES_append_class-native = " git-replacement-native" |
| 8 | |
| 9 | SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ |
| 10 | ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages" |
| 11 | |
| 12 | S = "${WORKDIR}/git-${PV}" |
| 13 | |
| 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1" |
| 15 | |
| 16 | EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \ |
| 17 | --without-tcltk \ |
| 18 | " |
| 19 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 20 | inherit autotools-brokensep perlnative bash-completion |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | |
| 22 | EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'" |
| 23 | EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'" |
| 24 | EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1" |
| 25 | |
| 26 | do_compile_prepend () { |
| 27 | # Remove perl/perl.mak to fix the out-of-date perl.mak error |
| 28 | # during rebuild |
| 29 | rm -f perl/perl.mak |
| 30 | } |
| 31 | |
| 32 | do_install () { |
| 33 | oe_runmake install DESTDIR="${D}" bindir=${bindir} \ |
| 34 | template_dir=${datadir}/git-core/templates \ |
| 35 | GIT_PYTHON_DIR=${D}${datadir}/git-core/python |
| 36 | install -d ${D}/${mandir}/man1 |
| 37 | install -d ${D}/${mandir}/man5 |
| 38 | install -d ${D}/${mandir}/man7 |
| 39 | install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/* |
| 40 | install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/* |
| 41 | install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/* |
| 42 | install -d ${D}/${datadir}/bash-completion/completions/ |
| 43 | install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git |
| 44 | } |
| 45 | |
| 46 | perl_native_fixup () { |
| 47 | sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \ |
| 48 | -e 's#${libdir}/perl-native/#${libdir}/#' \ |
| 49 | ${@d.getVar("PERLTOOLS", True).replace(' /',d.getVar('D', True) + '/')} |
| 50 | |
| 51 | # ${libdir} is not applicable here, perl-native files are always |
| 52 | # installed to /usr/lib on both 32/64 bits targets. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 53 | |
| 54 | mkdir -p ${D}${libdir} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 55 | mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir} |
| 56 | rmdir -p ${D}${exec_prefix}/lib/perl-native || true |
| 57 | } |
| 58 | |
| 59 | REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core" |
| 60 | REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates" |
| 61 | |
| 62 | do_install_append_class-target () { |
| 63 | perl_native_fixup |
| 64 | } |
| 65 | |
| 66 | do_install_append_class-native() { |
| 67 | create_wrapper ${D}${bindir}/git \ |
| 68 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 69 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 70 | } |
| 71 | |
| 72 | do_install_append_class-nativesdk() { |
| 73 | create_wrapper ${D}${bindir}/git \ |
| 74 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 75 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 76 | perl_native_fixup |
| 77 | } |
| 78 | |
| 79 | FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 80 | |
| 81 | PERLTOOLS = " \ |
| 82 | ${libexecdir}/git-core/git-add--interactive \ |
| 83 | ${libexecdir}/git-core/git-archimport \ |
| 84 | ${libexecdir}/git-core/git-cvsexportcommit \ |
| 85 | ${libexecdir}/git-core/git-cvsimport \ |
| 86 | ${libexecdir}/git-core/git-cvsserver \ |
| 87 | ${bindir}/git-cvsserver \ |
| 88 | ${libexecdir}/git-core/git-difftool \ |
| 89 | ${libexecdir}/git-core/git-relink \ |
| 90 | ${libexecdir}/git-core/git-send-email \ |
| 91 | ${libexecdir}/git-core/git-svn \ |
| 92 | ${libexecdir}/git-core/git-instaweb \ |
| 93 | ${libexecdir}/git-core/git-submodule \ |
| 94 | ${libexecdir}/git-core/git-am \ |
| 95 | ${libexecdir}/git-core/git-request-pull \ |
| 96 | ${datadir}/gitweb/gitweb.cgi \ |
| 97 | ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \ |
| 98 | ${datadir}/git-core/templates/hooks/pre-rebase.sample \ |
| 99 | " |
| 100 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 101 | # Git tools requiring perl |
| 102 | PACKAGES =+ "${PN}-perltools" |
| 103 | FILES_${PN}-perltools += " \ |
| 104 | ${PERLTOOLS} \ |
| 105 | ${libdir}/perl \ |
| 106 | ${datadir}/perl \ |
| 107 | " |
| 108 | RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils" |
| 109 | |
| 110 | PACKAGES =+ "${PN}-python" |
| 111 | FILES_${PN}-python = "${libdir}/python*" |
| 112 | |
| 113 | |
| 114 | # git-tk package with gitk and git-gui |
| 115 | PACKAGES =+ "${PN}-tk" |
| 116 | #RDEPENDS_${PN}-tk = "${PN} tk tcl" |
| 117 | #EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh" |
| 118 | FILES_${PN}-tk = " \ |
| 119 | ${bindir}/gitk \ |
| 120 | ${datadir}/gitk \ |
| 121 | " |
| 122 | |
| 123 | PACKAGES =+ "gitweb" |
| 124 | FILES_gitweb = "${datadir}/gitweb/" |
| 125 | |
| 126 | |
| 127 | BBCLASSEXTEND = "native nativesdk" |