[oe] [meta-oe][PATCH] uhubctl: add recipe

Khem Raj raj.khem at gmail.com
Tue May 22 18:17:30 UTC 2018


On Tue, May 22, 2018 at 8:25 AM, Richard Leitner
<richard.leitner at skidata.com> wrote:
> Add recipe for uhubctl v2.0.0, an utility to control USB power per-port
> on "smart" USB hubs.
>
> Signed-off-by: Richard Leitner <richard.leitner at skidata.com>
> ---
>  ...001-Makefile-set-program-version-to-2.0.0.patch | 34 ++++++++++++++++++++++
>  meta-oe/recipes-support/uhubctl/uhubctl_2.0.0.bb   | 22 ++++++++++++++
>  2 files changed, 56 insertions(+)
>  create mode 100644 meta-oe/recipes-support/uhubctl/files/0001-Makefile-set-program-version-to-2.0.0.patch
>  create mode 100644 meta-oe/recipes-support/uhubctl/uhubctl_2.0.0.bb
>
> diff --git a/meta-oe/recipes-support/uhubctl/files/0001-Makefile-set-program-version-to-2.0.0.patch b/meta-oe/recipes-support/uhubctl/files/0001-Makefile-set-program-version-to-2.0.0.patch
> new file mode 100644
> index 000000000..e9e06bc71
> --- /dev/null
> +++ b/meta-oe/recipes-support/uhubctl/files/0001-Makefile-set-program-version-to-2.0.0.patch
> @@ -0,0 +1,34 @@
> +From 4f241d2f407e834c30db4047cfb6863cd5f14ea6 Mon Sep 17 00:00:00 2001
> +From: Richard Leitner <richard.leitner at skidata.com>
> +Date: Tue, 22 May 2018 13:42:20 +0200
> +Subject: [PATCH] Makefile: set program version to 2.0.0
> +
> +Remove the dynamic PROGRAM_VERSION gathering via "git describe" an
> +replace it with the hardcoded value "2.0.0".
> +
> +This is needed because "git describe" fails with an error when executed
> +in a non-git directory as it will occur when uhubctl source is not
> +downloaded via "git clone". But for example as an source archive.
> +
> +Signed-off-by: Richard Leitner <richard.leitner at skidata.com>
> +---
> + Makefile | 3 +--
> + 1 file changed, 1 insertion(+), 2 deletions(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 7074cbf..c80fa17 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -14,8 +14,7 @@ RM           := rm -rf
> + CC ?= gcc
> + CFLAGS ?= -g -O0
> + CFLAGS += -Wall -Wextra -std=c99 -pedantic
> +-GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
> +-CFLAGS += -DPROGRAM_VERSION=\"$(GIT_VERSION)\"
> ++CFLAGS += -DPROGRAM_VERSION=\"2.0.0\"

can we do it via some other means ? may be via sed or some such and use ${PV}
be used instead of hardcoding version.

> +
> + ifeq ($(UNAME_S),Linux)
> +       LDFLAGS += -Wl,-z,relro -lusb-1.0
> +--
> +2.11.0
> +
> diff --git a/meta-oe/recipes-support/uhubctl/uhubctl_2.0.0.bb b/meta-oe/recipes-support/uhubctl/uhubctl_2.0.0.bb
> new file mode 100644
> index 000000000..80fc92332
> --- /dev/null
> +++ b/meta-oe/recipes-support/uhubctl/uhubctl_2.0.0.bb
> @@ -0,0 +1,22 @@
> +SUMMARY = "USB hub per-port power control"
> +HOMEPAGE = "https://github.com/mvp/uhubctl"
> +BUGTRACKER = "https://github.com/mvp/uhubctl/issues"
> +DEPENDS = "libusb1"
> +
> +LICENSE = "GPLv2"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
> +
> +SRC_URI = "\
> +    https://github.com/mvp/${PN}/archive/v${PV}.tar.gz \
> +    file://0001-Makefile-set-program-version-to-2.0.0.patch \
> +    "
> +SRC_URI[md5sum] = "5c711911d766d76813333c3812277574"
> +SRC_URI[sha256sum] = "4c31278b2c03e5be5a696c3088bc86cf2557a70e00f697799c163aba18e3c40e"
> +
> +S = "${WORKDIR}/${PN}-${PV}"
> +

this looks redundant.

> +do_install () {
> +    oe_runmake install DESTDIR=${D}
> +}
> +

do we need this ?

> +FILES_${PN} = "${sbindir}/uhubctl"

Do we need this ?

> --
> 2.11.0
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel



More information about the Openembedded-devel mailing list