blob: 3374f4dfbf35f17cc7fa4c16c10cf26487bd8c6f [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Tool for working with series of patches"
Brad Bishopf3f93bb2019-10-16 14:33:32 -04002DESCRIPTION = "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."
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005HOMEPAGE = "http://savannah.nongnu.org/projects/quilt/"
6SECTION = "devel"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00007LICENSE = "GPL-2.0-only"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
9
10SRC_URI = "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011 file://run-ptest \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012 file://test.sh \
13 file://0001-tests-Allow-different-output-from-mv.patch \
Patrick Williams2390b1b2022-11-03 13:47:49 -050014 file://fix-grep-3.8.patch \
Andrew Geisslerc5535c92023-01-27 16:10:19 -060015 file://faildiff-order.patch \
Andrew Geissler028142b2023-05-05 11:29:21 -050016 file://0001-test-Fix-a-race-condition-in-merge.test.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017"
18
Patrick Williams213cb262021-08-07 19:21:33 -050019SRC_URI:append:class-target = " file://gnu_patch_test_fix_target.patch"
Brad Bishop19323692019-04-05 15:28:33 -040020
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000021SRC_URI[sha256sum] = "3be3be0987e72a6c364678bb827e3e1fcc10322b56bc5f02b576698f55013cc2"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022
23inherit autotools-brokensep ptest
24
Patrick Williams213cb262021-08-07 19:21:33 -050025INHIBIT_AUTOTOOLS_DEPS:class-native = "1"
26PATCHTOOL:class-native = "patch"
Brad Bishop19323692019-04-05 15:28:33 -040027
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028CLEANBROKEN = "1"
29
Andrew Geissler9aee5002022-03-30 16:27:02 +000030EXTRA_OECONF = "--with-perl='${USRBINPATH}/env perl' --with-patch=patch --without-sendmail"
Patrick Williams213cb262021-08-07 19:21:33 -050031EXTRA_OECONF:append:class-native = " --disable-nls"
Andrew Geissler9aee5002022-03-30 16:27:02 +000032
Brad Bishop19323692019-04-05 15:28:33 -040033EXTRA_AUTORECONF += "--exclude=aclocal"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050034
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060035CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash ac_cv_path_COLUMN=column"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037# Make sure we don't have "-w" in shebang lines: it breaks using
38# "/usr/bin/env perl" as parser
Patrick Williams213cb262021-08-07 19:21:33 -050039do_configure:prepend () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050040 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
Patrick Williams213cb262021-08-07 19:21:33 -050044do_configure:append () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050045 sed -e 's,^COMPAT_SYMLINKS.*:=.*,COMPAT_SYMLINKS :=,' -i ${S}/Makefile
46}
47
Patrick Williams213cb262021-08-07 19:21:33 -050048do_configure:class-native () {
Brad Bishop19323692019-04-05 15:28:33 -040049 oe_runconf
50}
51
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080052# quilt Makefiles install to BUILD_ROOT instead of DESTDIR
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053do_install () {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080054 oe_runmake 'BUILD_ROOT=${D}' install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055 # cleanup unpackaged files
56 rm -rf ${D}/${datadir}/emacs
57}
58
Patrick Williams213cb262021-08-07 19:21:33 -050059do_install:append:class-native () {
Brad Bishop19323692019-04-05 15:28:33 -040060 # Dummy quiltrc file for patch.bbclass
61 install -d ${D}${sysconfdir}/
62 touch ${D}${sysconfdir}/quiltrc
63}
64
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060065# The tests need to run as a non-root user, so pull in the ptest user
66DEPENDS:append:class-target = "${@bb.utils.contains('PTEST_ENABLED', '1', ' ptest-runner', '', d)}"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050067PACKAGE_WRITE_DEPS += "ptest-runner"
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060068
Patrick Williamsc124f4f2015-09-15 14:41:29 -050069do_install_ptest() {
Andrew Geisslerc5535c92023-01-27 16:10:19 -060070 install ${WORKDIR}/test.sh ${D}${PTEST_PATH}
71 mkdir ${D}${PTEST_PATH}/test
72 install ${S}/test/* ${D}${PTEST_PATH}/test
73 # mail needs a MTA, and the patch-wrapper is disabled
74 rm -f ${D}${PTEST_PATH}/test/mail.test ${D}${PTEST_PATH}/test/patch-wrapper.test
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075}
76
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060077# ptest.bbclass currently chowns the ptest directory explicitly, so we need to
78# change permission after that has happened so the ptest user can write a
79# temporary directory.
80do_install_ptest_base:append() {
81 chgrp ptest ${D}${PTEST_PATH}/test
82 chmod g+w ${D}${PTEST_PATH}/test
83}
84
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080085PACKAGES += "guards guards-doc"
86
Patrick Williams213cb262021-08-07 19:21:33 -050087FILES:${PN} = "${sysconfdir} ${datadir}/quilt \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080088 ${bindir}/quilt ${libdir}/quilt"
Patrick Williams213cb262021-08-07 19:21:33 -050089FILES:guards = "${bindir}/guards"
90FILES:${PN}-doc = "${mandir}/man1/quilt.1 ${docdir}/${BPN}"
91FILES:guards-doc = "${mandir}/man1/guards.1"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080092
Patrick Williams213cb262021-08-07 19:21:33 -050093RDEPENDS:${PN} = "bash patch diffstat bzip2 util-linux less"
94RDEPENDS:${PN}:class-native = "diffstat-native patch-native bzip2-native"
Brad Bishop19323692019-04-05 15:28:33 -040095
Andrew Geisslerc5535c92023-01-27 16:10:19 -060096RDEPENDS:${PN}-ptest += "file sed gawk diffutils findutils ed perl \
97 perl-module-filehandle perl-module-getopt-std \
98 perl-module-posix perl-module-file-temp \
99 perl-module-text-parsewords perl-module-overloading \
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600100 bash util-linux-getopt ptest-runner \
Andrew Geisslerc5535c92023-01-27 16:10:19 -0600101 "