xref: /openbmc/openbmc/meta-openembedded/meta-oe/recipes-test/pm-qa/pm-qa_git.bb (revision eaae0b339f806200d8722cb09e5e3b83c15a5956)
1DESCRIPTION = "Utilities for testing Power Management"
2HOMEPAGE = "https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQa"
3
4LICENSE = "GPL-2.0-only"
5LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
6
7PV = "0.5.2"
8
9BRANCH ?= "master"
10
11SRCREV = "05710ec5032be4c8edafb4109d4d908d31243906"
12
13SRC_URI = " \
14    git://git.linaro.org/power/pm-qa.git;protocol=git;branch=${BRANCH} \
15    file://0001-fix-build-with-gcc-15-Wincompatible-pointer-types-er.patch \
16"
17
18S = "${WORKDIR}/git"
19
20CFLAGS += "-pthread"
21
22PATCHTOOL = "git"
23
24do_compile () {
25    # Find all the .c files in this project and build them.
26    for x in `find . -name "*.c"`
27    do
28        util=`echo ${x} | sed s/.c$//`
29        oe_runmake ${util}
30    done
31}
32
33do_install () {
34    install -d ${D}${bindir}
35    install -d ${D}${libdir}/${BPN}
36
37    # Install the compiled binaries that were built in the previous step
38    for x in `find . -name "*.c"`
39    do
40        util=`echo ${x} | sed s/.c$//`
41        util_basename=`basename ${util}`
42        install -m 0755 ${util} ${D}${bindir}/${util_basename}
43    done
44
45    # Install the helper scripts in a subdirectory of $libdir
46    for script in `find . -name "*.sh" | grep include`
47    do
48        # Remove hardcoded relative paths
49        sed -i -e 's#..\/utils\/##' ${script}
50        sed -i -e 's#. ..\/Switches#${bindir}#g' ${script}
51
52        script_basename=`basename ${script}`
53        install -m 0755 $script ${D}${libdir}/${BPN}/${script_basename}
54    done
55
56    # Install the shell scripts NOT in the $libdir directory since those
57    # will be installed elsewhere
58    for script in `find . -name "*.sh" | grep -v include`
59    do
60        # if the script includes any helper scripts from the $libdir
61        # directory then change the source path to the absolute path
62        # to reflect the install location of the helper scripts.
63        sed -i -e "s#. ../include#. ${libdir}/${BPN}#g" ${script}
64        # Remove hardcoded relative paths
65        sed -i -e 's#..\/utils\/##' ${script}
66
67        script_basename=`basename ${script}`
68        install -m 0755 $script ${D}${bindir}/${script_basename}
69    done
70}
71RDEPENDS:${PN} += "bash"
72
73# http://errors.yoctoproject.org/Errors/Details/186956/
74COMPATIBLE_HOST:libc-musl = 'null'
75