summaryrefslogtreecommitdiffstats
path: root/meta-filesystems/recipes-utils/e2tools/e2tools_0.1.2.bb
blob: 06f0c28d6d09c6e0f4094915d5c96537dd7ed5ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
SUMMARY = "Set of GPL'ed utilities to ext2/ext3 filesystem."
DESCRIPTION = "e2tools is a simple set of GPL'ed utilities to read, write, \
and manipulate files in an ext2/ext3 filesystem. These utilities access a \
filesystem directly using the ext2fs library. Can also be used on a Linux \
machine to read/write to disk images or floppies without having to mount \
them or have root access."
HOMEPAGE = "https://github.com/e2tools/e2tools"
SECTION = "base"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

DEPENDS += "coreutils e2fsprogs"

SRC_URI = " \
           git://github.com/e2tools/e2tools;protocol=https;branch=master \
           file://run-ptest \
"

SRCREV = "46da6c398e70635a296245851fcedbc56c35e824"


inherit autotools pkgconfig ptest

# Otherwise these tools will be detected from build host and
# assumptions will go wrong, Fun of cross compiling
EXTRA_OECONF += "\
                ac_cv_path_MKE2FS=${base_sbindir}/mke2fs \
                ac_cv_path_CHMOD=${base_bindir}/chmod \
                ac_cv_path_DD=${base_bindir}/dd \
                ac_cv_path_GREP=${base_bindir}/grep \
                "

do_install_ptest() {
    rm -rf "${D}${PTEST_PATH}/*"
    cp -r ../build "${D}${PTEST_PATH}"
    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
    cp -r "${UNPACKDIR}" "${D}${PTEST_PATH}/"
    rm -rf ${D}${PTEST_PATH}/build/config.log \
        ${D}${PTEST_PATH}/build/autom4te.cache \
        ${D}${PTEST_PATH}/*/*/.git ${D}${PTEST_PATH}/*/*/.github \
        ${D}${PTEST_PATH}/*/*/autom4te.cache

    # config.status contains WORKDIR paths in strings literal split across
    # multiple lines. ie
    # S["foo"]="/path/to/work"\
    # "dir/"
    # These line splits prevent the following sed from working properly.
    # Make a first pass on the file to undo any line split
    sed '
        :a;N;$!ba;  # Read the whole file into the pattern buffer
        s/"\\\n"//g # Delete "\<newline>" ie literal string line break
        ' \
        -i ${D}${PTEST_PATH}/build/config.status

    # Now remove/replace the non-reproducible paths
    sed -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \
        -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \
        -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \
        -e 's@[^ ]*--sysroot=[^ "]*@@g' \
        -e 's@[^ ]*--with-libtool-sysroot=[^ "]*@@g' \
        -e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \
        -e '/EXT2FS_CFLAGS/d' \
        -e '/LDFLAGS/d' \
        -e '/PKG_CONFIG_PATH/d' \
        -e '/PKG_CONFIG_LIBDIR/d' \
        -e 's@${S}@${PTEST_PATH}@g' \
        -e 's@${B}@${PTEST_PATH}/build@g' \
        -e 's@${HOSTTOOLS_DIR}@@g' \
        -e 's@${RECIPE_SYSROOT_NATIVE}@@g' \
        -e 's@${RECIPE_SYSROOT}@@g' \
        -i ${D}${PTEST_PATH}/build/config.status
}

RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk make perl"

BBCLASSEXTEND = "native"