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 | |
| 20 | inherit autotools-brokensep perlnative |
| 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. |
| 53 | mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir} |
| 54 | rmdir -p ${D}${exec_prefix}/lib/perl-native || true |
| 55 | } |
| 56 | |
| 57 | REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core" |
| 58 | REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates" |
| 59 | |
| 60 | do_install_append_class-target () { |
| 61 | perl_native_fixup |
| 62 | } |
| 63 | |
| 64 | do_install_append_class-native() { |
| 65 | create_wrapper ${D}${bindir}/git \ |
| 66 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 67 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 68 | } |
| 69 | |
| 70 | do_install_append_class-nativesdk() { |
| 71 | create_wrapper ${D}${bindir}/git \ |
| 72 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 73 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 74 | perl_native_fixup |
| 75 | } |
| 76 | |
| 77 | FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/" |
| 78 | FILES_${PN}-dbg += "${libexecdir}/git-core/.debug" |
| 79 | |
| 80 | PERLTOOLS = " \ |
| 81 | ${libexecdir}/git-core/git-add--interactive \ |
| 82 | ${libexecdir}/git-core/git-archimport \ |
| 83 | ${libexecdir}/git-core/git-cvsexportcommit \ |
| 84 | ${libexecdir}/git-core/git-cvsimport \ |
| 85 | ${libexecdir}/git-core/git-cvsserver \ |
| 86 | ${bindir}/git-cvsserver \ |
| 87 | ${libexecdir}/git-core/git-difftool \ |
| 88 | ${libexecdir}/git-core/git-relink \ |
| 89 | ${libexecdir}/git-core/git-send-email \ |
| 90 | ${libexecdir}/git-core/git-svn \ |
| 91 | ${libexecdir}/git-core/git-instaweb \ |
| 92 | ${libexecdir}/git-core/git-submodule \ |
| 93 | ${libexecdir}/git-core/git-am \ |
| 94 | ${libexecdir}/git-core/git-request-pull \ |
| 95 | ${datadir}/gitweb/gitweb.cgi \ |
| 96 | ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \ |
| 97 | ${datadir}/git-core/templates/hooks/pre-rebase.sample \ |
| 98 | " |
| 99 | |
| 100 | # Basic tab completion support |
| 101 | PACKAGES =+ "${PN}-bash-completion" |
| 102 | FILES_${PN}-bash-completion = "${datadir}/bash-completion/completions/*" |
| 103 | |
| 104 | # Git tools requiring perl |
| 105 | PACKAGES =+ "${PN}-perltools" |
| 106 | FILES_${PN}-perltools += " \ |
| 107 | ${PERLTOOLS} \ |
| 108 | ${libdir}/perl \ |
| 109 | ${datadir}/perl \ |
| 110 | " |
| 111 | RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils" |
| 112 | |
| 113 | PACKAGES =+ "${PN}-python" |
| 114 | FILES_${PN}-python = "${libdir}/python*" |
| 115 | |
| 116 | |
| 117 | # git-tk package with gitk and git-gui |
| 118 | PACKAGES =+ "${PN}-tk" |
| 119 | #RDEPENDS_${PN}-tk = "${PN} tk tcl" |
| 120 | #EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh" |
| 121 | FILES_${PN}-tk = " \ |
| 122 | ${bindir}/gitk \ |
| 123 | ${datadir}/gitk \ |
| 124 | " |
| 125 | |
| 126 | PACKAGES =+ "gitweb" |
| 127 | FILES_gitweb = "${datadir}/gitweb/" |
| 128 | |
| 129 | |
| 130 | BBCLASSEXTEND = "native nativesdk" |