xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-devtools/quilt/quilt.inc (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1SUMMARY = "Tool for working with series of patches"
2DESCRIPTION = "Quilt is a tool to manage large sets of patches by keeping \
3track of the changes each patch makes. Patches can be applied, un-applied,\
4refreshed, etc."
5HOMEPAGE = "http://savannah.nongnu.org/projects/quilt/"
6SECTION = "devel"
7LICENSE = "GPL-2.0-only"
8LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
9
10SRC_URI = "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \
11        file://run-ptest \
12        file://Makefile \
13        file://test.sh \
14        file://0001-tests-Allow-different-output-from-mv.patch \
15        file://fix-grep-3.8.patch \
16        file://faildiff-order.patch \
17"
18
19SRC_URI:append:class-target = " file://gnu_patch_test_fix_target.patch"
20
21SRC_URI[sha256sum] = "3be3be0987e72a6c364678bb827e3e1fcc10322b56bc5f02b576698f55013cc2"
22
23inherit autotools-brokensep ptest
24
25INHIBIT_AUTOTOOLS_DEPS:class-native = "1"
26PATCHTOOL:class-native = "patch"
27
28CLEANBROKEN = "1"
29
30EXTRA_OECONF = "--with-perl='${USRBINPATH}/env perl' --with-patch=patch --without-sendmail"
31EXTRA_OECONF:append:class-native = " --disable-nls"
32
33EXTRA_AUTORECONF += "--exclude=aclocal"
34
35CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash ac_cv_path_COLUMN=column"
36
37# Make sure we don't have "-w" in shebang lines: it breaks using
38# "/usr/bin/env perl" as parser
39do_configure:prepend () {
40	find ${S} -name "*.in" -exec sed -i -e "1s,^#\!.*@PERL@ -w$,#\! @PERL@\nuse warnings;," {} \;
41}
42
43# Don't setup symlinks to host utilities, we don't need them
44do_configure:append () {
45	sed -e 's,^COMPAT_SYMLINKS.*:=.*,COMPAT_SYMLINKS	:=,' -i ${S}/Makefile
46}
47
48do_configure:class-native () {
49    oe_runconf
50}
51
52# quilt Makefiles install to BUILD_ROOT instead of DESTDIR
53do_install () {
54	oe_runmake 'BUILD_ROOT=${D}' install
55	# cleanup unpackaged files
56	rm -rf ${D}/${datadir}/emacs
57}
58
59do_install:append:class-native () {
60    # Dummy quiltrc file for patch.bbclass
61    install -d ${D}${sysconfdir}/
62    touch ${D}${sysconfdir}/quiltrc
63}
64
65do_compile_ptest() {
66	oe_runmake bin/patch-wrapper test/.depend
67}
68
69do_install_ptest() {
70	tar -c --exclude=\*.in bin/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
71	tar -c --exclude=\*.in compat/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
72	tar -c --exclude=\*.in quilt/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
73	tar -c --exclude=mail.test --exclude=delete.test test/ | ( cd ${D}${PTEST_PATH} && tar -xf - && chmod 777 test)
74	cp ${WORKDIR}/Makefile ${D}${PTEST_PATH}
75	cp ${WORKDIR}/test.sh ${D}${PTEST_PATH}
76}
77
78PACKAGES += "guards guards-doc"
79
80FILES:${PN} = "${sysconfdir} ${datadir}/quilt \
81               ${bindir}/quilt ${libdir}/quilt"
82FILES:guards = "${bindir}/guards"
83FILES:${PN}-doc = "${mandir}/man1/quilt.1 ${docdir}/${BPN}"
84FILES:guards-doc = "${mandir}/man1/guards.1"
85
86RDEPENDS:${PN} = "bash patch diffstat bzip2 util-linux less"
87RDEPENDS:${PN}:class-native = "diffstat-native patch-native bzip2-native"
88
89RDEPENDS:${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
90                        perl-module-filehandle perl-module-getopt-std \
91                        perl-module-posix perl-module-file-temp \
92                        perl-module-text-parsewords perl-module-overloading \
93                        bash util-linux-getopt patch \
94                       "
95