Message ID | 20160530063545.GA31737@airbook.vandijck-laurijssen.be |
---|---|
State | Changes Requested |
Headers | show |
>>>>> "Kurt" == Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> writes: > Inputevent is an input-device to ascii tranlator. > Its output is of the format 'TIME CODE VALUE' and it's easy > to pipe it into a shell script. > Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> I see you are the author of this tool, but does this tool provide anything more than evtest (besides perhaps a bit easier to parse output)? > +################################################################################ > +# > +# inputevent > +# > +################################################################################ > + > +INPUTEVENT_VERSION = r8 > +INPUTEVENT_SITE = git://github.com/kurt-vd/inputevent.git We have a github macro to handle this (see E.G. input-event-daemon.mk for an example). > +INPUTEVENT_LICENSE = GPLv3 > +INPUTEVENT_LICENSE_FILES = LICENSE > + > +define INPUTEVENT_CONFIGURE_CMDS > + echo "PREFIX=/" > $(@D)/config.mk > + echo "CFLAGS=$(TARGET_CFLAGS)" >> $(@D)/config.mk > + echo "CPPFLAGS=-D_GNU_SOURCE $(TARGET_CPPFLAGS)" >> $(@D)/config.mk > + echo "CXXFLAGS=$(TARGET_CXXFLAGS)" >> $(@D)/config.mk > + echo "LDFLAGS=$(TARGET_LDFLAGS)" >> $(@D)/config.mk > + echo "LDLIBS+=$(TARGET_LDLIBS)" >> $(@D)/config.mk > + echo "CC=$(TARGET_CC)" >> $(@D)/config.mk > + echo "CXX=$(TARGET_CXX)" >> $(@D)/config.mk > + echo "LD=$(TARGET_LD)" >> $(@D)/config.mk > + echo "AS=$(TARGET_AS)" >> $(@D)/config.mk > + > + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) clean How about passing $(TARGET_CONFIGURE_OPTS) to make instead of writing this config.mk? Looking at the Makefile, I see it tries to figure out the version by calling git. When this is built in a buildroot git checkout (and inputevent is gotten from a github tarball) this will most likely use version info from the Buildroot git repo which doesn't sound correct. > + > +define INPUTEVENT_BUILD_CMDS > + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) > +endef > + > +define INPUTEVENT_INSTALL_TARGET_CMDS > + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR="$(TARGET_DIR)" > +endef > + > +$(eval $(generic-package)) > +#$(eval $(configmk-package)) Please don't leave commented out code in the files.
> > > Inputevent is an input-device to ascii tranlator. > > Its output is of the format 'TIME CODE VALUE' and it's easy > > to pipe it into a shell script. > > > Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> > > I see you are the author of this tool, but does this tool provide > anything more than evtest (besides perhaps a bit easier to parse > output)? The easier to parse output is helps to pipe it in scripts like: while read TIME TYPE VALUE; do case "$TYPE:$VALUE" in KEY_PLAY:0) mpc play ;; esac second, it supports to control such script as child, making it easy to integrate in a service monitor that just monitors the inputevent program, without the need to monitor the child script. So I combined evtest-like functionality with a focus on deployment, integrating the tool in a functional system. evtest is meant as an interactive tool or query a state. I evalutated input-event-daemon and found that it distracts focus from the overall functionality that I want. input-event-daemon is focused on desktop-like systems, I target embedded systems that perform tasks on GPIO inputs, who are delivered as input events. Is it different enough? If you look at how it integrates, then yes. If you look at what it does, I agree that it appears very much alike. > > > +################################################################################ > > +# > > +# inputevent > > +# > > +################################################################################ > > + > > +INPUTEVENT_VERSION = r8 > > +INPUTEVENT_SITE = git://github.com/kurt-vd/inputevent.git > > We have a github macro to handle this (see E.G. input-event-daemon.mk > for an example). The first iterations of my patch didn't like the macro very well. I forgot the precise reason. I will re-evaluate now. > > > > +INPUTEVENT_LICENSE = GPLv3 > > +INPUTEVENT_LICENSE_FILES = LICENSE > > + > > +define INPUTEVENT_CONFIGURE_CMDS > > + echo "PREFIX=/" > $(@D)/config.mk > > + echo "CFLAGS=$(TARGET_CFLAGS)" >> $(@D)/config.mk > > + echo "CPPFLAGS=-D_GNU_SOURCE $(TARGET_CPPFLAGS)" >> $(@D)/config.mk > > + echo "CXXFLAGS=$(TARGET_CXXFLAGS)" >> $(@D)/config.mk > > + echo "LDFLAGS=$(TARGET_LDFLAGS)" >> $(@D)/config.mk > > + echo "LDLIBS+=$(TARGET_LDLIBS)" >> $(@D)/config.mk > > + echo "CC=$(TARGET_CC)" >> $(@D)/config.mk > > + echo "CXX=$(TARGET_CXX)" >> $(@D)/config.mk > > + echo "LD=$(TARGET_LD)" >> $(@D)/config.mk > > + echo "AS=$(TARGET_AS)" >> $(@D)/config.mk > > + > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) clean > > How about passing $(TARGET_CONFIGURE_OPTS) to make instead of writing > this config.mk? Building outside of toplevel make, although I admit it is a bad reason. I dropped autoconf long time ago, and use such config.mk includes, where necessary. Is Target_CONFIGURE_OPTS available for non-autotools packages? > > Looking at the Makefile, I see it tries to figure out the version by > calling git. When this is built in a buildroot git checkout (and > inputevent is gotten from a github tarball) this will most likely use > version info from the Buildroot git repo which doesn't sound correct. Now that is a true problem. I'll rework. > > > + > > +define INPUTEVENT_BUILD_CMDS > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) > > +endef > > + > > +define INPUTEVENT_INSTALL_TARGET_CMDS > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR="$(TARGET_DIR)" > > +endef > > + > > +$(eval $(generic-package)) > > +#$(eval $(configmk-package)) > > Please don't leave commented out code in the files. Ack, I totally agree. Kind regards, Kurt
>>>>> "Kurt" == Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> writes: Hi, >> I see you are the author of this tool, but does this tool provide >> anything more than evtest (besides perhaps a bit easier to parse >> output)? > The easier to parse output is helps to pipe it in scripts like: > while read TIME TYPE VALUE; do > case "$TYPE:$VALUE" in > KEY_PLAY:0) > mpc play > ;; > esac True. evtest is not too bad to parse either though: while read EVENT T TIME T T TYPE T T CODE T VALUE; do case "$EVENT" in Event:) echo TIME=$TIME TYPE=$TYPE CODE=$CODE VALUE=$VALUE ;; esac done > second, it supports to control such script as child, > making it easy to integrate in a service monitor that just > monitors the inputevent program, without the need to monitor > the child script. > So I combined evtest-like functionality with a focus on deployment, > integrating the tool in a functional system. > evtest is meant as an interactive tool or query a state. > I evalutated input-event-daemon and found that it distracts focus from the > overall functionality that I want. input-event-daemon is focused on > desktop-like systems, I target embedded systems that perform tasks > on GPIO inputs, who are delivered as input events. > Is it different enough? > If you look at how it integrates, then yes. > If you look at what it does, I agree that it appears very much alike. I don't have any problems adding it, I just wanted to understand what it does differently then evtest, which wasn't clear to me from your commit message / help text. >> > + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) clean >> >> How about passing $(TARGET_CONFIGURE_OPTS) to make instead of writing >> this config.mk? > Building outside of toplevel make, although I admit it is a bad reason. > I dropped autoconf long time ago, and use such config.mk includes, where > necessary. Is Target_CONFIGURE_OPTS available for non-autotools > packages? Yes, have a look at package/Makefile.in. TARGET_CONFIGURE_OPTS is simply a variable containing CC=.. CFLAGS=.. LD=.. that we also use to pass to configure. >> Looking at the Makefile, I see it tries to figure out the version by >> calling git. When this is built in a buildroot git checkout (and >> inputevent is gotten from a github tarball) this will most likely use >> version info from the Buildroot git repo which doesn't sound correct. > Now that is a true problem. > I'll rework. Thanks!
diff --git a/package/Config.in b/package/Config.in index 529ad33..112e516 100644 --- a/package/Config.in +++ b/package/Config.in @@ -383,6 +383,7 @@ endif source "package/i2c-tools/Config.in" source "package/input-event-daemon/Config.in" source "package/input-tools/Config.in" + source "package/inputevent/Config.in" source "package/intel-microcode/Config.in" source "package/iostat/Config.in" source "package/ipmitool/Config.in" diff --git a/package/inputevent/Config.in b/package/inputevent/Config.in new file mode 100644 index 0000000..44422a3 --- /dev/null +++ b/package/inputevent/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_INPUTEVENT + bool "inputevent" + help + inputevent is a simple program that traces input events. + When piped to a another program or script, you get similar + functionality as input-event-daemon. diff --git a/package/inputevent/inputevent.mk b/package/inputevent/inputevent.mk new file mode 100644 index 0000000..14a8d31 --- /dev/null +++ b/package/inputevent/inputevent.mk @@ -0,0 +1,36 @@ +################################################################################ +# +# inputevent +# +################################################################################ + +INPUTEVENT_VERSION = r8 +INPUTEVENT_SITE = git://github.com/kurt-vd/inputevent.git +INPUTEVENT_LICENSE = GPLv3 +INPUTEVENT_LICENSE_FILES = LICENSE + +define INPUTEVENT_CONFIGURE_CMDS + echo "PREFIX=/" > $(@D)/config.mk + echo "CFLAGS=$(TARGET_CFLAGS)" >> $(@D)/config.mk + echo "CPPFLAGS=-D_GNU_SOURCE $(TARGET_CPPFLAGS)" >> $(@D)/config.mk + echo "CXXFLAGS=$(TARGET_CXXFLAGS)" >> $(@D)/config.mk + echo "LDFLAGS=$(TARGET_LDFLAGS)" >> $(@D)/config.mk + echo "LDLIBS+=$(TARGET_LDLIBS)" >> $(@D)/config.mk + echo "CC=$(TARGET_CC)" >> $(@D)/config.mk + echo "CXX=$(TARGET_CXX)" >> $(@D)/config.mk + echo "LD=$(TARGET_LD)" >> $(@D)/config.mk + echo "AS=$(TARGET_AS)" >> $(@D)/config.mk + + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) clean +endef + +define INPUTEVENT_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) +endef + +define INPUTEVENT_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR="$(TARGET_DIR)" +endef + +$(eval $(generic-package)) +#$(eval $(configmk-package))
Inputevent is an input-device to ascii tranlator. Its output is of the format 'TIME CODE VALUE' and it's easy to pipe it into a shell script. Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> --- package/Config.in | 1 + package/inputevent/Config.in | 6 ++++++ package/inputevent/inputevent.mk | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 package/inputevent/Config.in create mode 100644 package/inputevent/inputevent.mk