lcdapi: new package
PATCH 1/1 lcdapi: new package
From: Simon Dawson <[email protected]>
--- package/Config.in | 1 + package/lcdapi/Config.in | 11 +++ package/lcdapi/lcdapi-fix-Makefile.patch | 25 +++++++ .../lcdapi-fix-missing-cstdlib-includes.patch | 22 ++++++ .../lcdapi-fix-missing-cstring-includes.patch | 15 ++++ package/lcdapi/lcdapi-make-toString-static.patch | 19 +++++ package/lcdapi/lcdapi.mk | 73 ++++++++++++++++++++ 7 files changed, 166 insertions(+) create mode 100644 package/lcdapi/Config.in create mode 100644 package/lcdapi/lcdapi-fix-Makefile.patch create mode 100644 package/lcdapi/lcdapi-fix-missing-cstdlib-includes.patch create mode 100644 package/lcdapi/lcdapi-fix-missing-cstring-includes.patch create mode 100644 package/lcdapi/lcdapi-make-toString-static.patch create mode 100644 package/lcdapi/lcdapi.mk
package/Config.in +1 -0
@@ -385,6 +385,7 @@ endmenu menu "Hardware handling" source "package/ccid/Config.in" +source "package/lcdapi/Config.in" source "package/libaio/Config.in" source "package/libraw1394/Config.in" source "package/tslib/Config.in"
package/lcdapi/Config.in new file +11 -0
@@ -0,0 +1,11 @@ +config BR2_PACKAGE_LCDAPI + bool "lcdapi" + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_TOOLCHAIN_HAS_THREADS + help + C++ client API for lcdproc, containing a set of widget classes. + + http://www.c-sait.net/lcdapi/ + +comment "lcdapi requires a toolchain with C++ and thread support enabled" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
package/lcdapi/lcdapi-fix-Makefile.patch new file +25 -0
@@ -0,0 +1,25 @@ +Fix a presumed typo in the Makfile: $(INC_FLAGS) should be $(INCFLAGS), it +would appear. + +Also link against the stdc++ and pthread libraries explicitly. + +Signed-off-by: Simon Dawson <[email protected]> + +diff -Nurp a/Makefile b/Makefile +--- a/Makefile 2004-07-27 19:06:27.000000000 +0100 ++++ b/Makefile 2012-10-01 09:15:52.385986229 +0100 +@@ -64,12 +64,12 @@ deliver: clean doc_clean + + $(LIB_TARGET): $(LIB_OBJS) + @$(MKDIR) $(LIB_DIR) +- $(LD) $(LDFLAGS) -o $(LIB_TARGET) $(LIB_OBJS) ++ $(LD) $(LDFLAGS) -o $(LIB_TARGET) $(LIB_OBJS) -lstdc++ -lpthread + + + $(OBJ_DIR)/%.o: %.cpp + @$(MKDIR) $(OBJ_DIR)/api $(OBJ_DIR)/sensors $(OBJ_DIR)/keys +- $(CC) $(CFLAGS) $(INC_FLAGS) -c -o $@ $< ++ $(CC) $(CFLAGS) $(INCFLAGS) -c -o $@ $< + + + # DO NOT DELETE
package/lcdapi/lcdapi-fix-missing-cstdlib-includes.patch new file +22 -0
@@ -0,0 +1,22 @@ +Add some missing include directives for the cstdlib header. + +Signed-off-by: Simon Dawson <[email protected]> + +diff -Nurp a/api/LCDBar.cpp b/api/LCDBar.cpp +--- a/api/LCDBar.cpp 2004-07-27 19:06:27.000000000 +0100 ++++ b/api/LCDBar.cpp 2012-10-01 08:18:37.570139543 +0100 +@@ -1,4 +1,5 @@ + #include "LCDBar.h" ++#include <cstdlib> + #include <sstream> + #include <stdlib.h> + +diff -Nurp a/api/LCDBigNumber.cpp b/api/LCDBigNumber.cpp +--- a/api/LCDBigNumber.cpp 2004-07-27 19:06:27.000000000 +0100 ++++ b/api/LCDBigNumber.cpp 2012-10-01 08:18:13.066140468 +0100 +@@ -1,4 +1,5 @@ + #include "LCDBigNumber.h" ++#include <cstdlib> + #include <sstream> + #include <string> +
package/lcdapi/lcdapi-fix-missing-cstring-includes.patch new file +15 -0
@@ -0,0 +1,15 @@ +Add some missing include directives for the cstring header. + +Signed-off-by: Simon Dawson <[email protected]> + +diff -Nurp a/sensors/LCDSensor.cpp b/sensors/LCDSensor.cpp +--- a/sensors/LCDSensor.cpp 2004-07-27 19:06:27.000000000 +0100 ++++ b/sensors/LCDSensor.cpp 2012-10-01 08:43:13.726073554 +0100 +@@ -2,6 +2,7 @@ + #include "LCDUtils.h" + #include "LCDSensor.h" + ++#include <cstring> + #include <string> + #include <stdio.h> + #include <unistd.h>
package/lcdapi/lcdapi-make-toString-static.patch new file +19 -0
@@ -0,0 +1,19 @@ +make the toString function defined in the LCDCallback.h header into a static +function, to fix link-time errors like the following. + + multiple definition of `toString(char)' + +Signed-off-by: Simon Dawson <[email protected]> + +diff -Nurp a/keys/LCDCallback.h b/keys/LCDCallback.h +--- a/keys/LCDCallback.h 2004-07-27 19:06:27.000000000 +0100 ++++ b/keys/LCDCallback.h 2012-10-01 10:59:52.685708010 +0100 +@@ -77,7 +77,7 @@ class LCDCallback + + typedef std::map<KeyEvent, LCDCallback *> CallbackMap; + +-std::string toString(KeyEvent t) ++static std::string toString(KeyEvent t) + { + std::string s(1, (char)t); + return s;
package/lcdapi/lcdapi.mk new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 1/1 lcdapi: new package
Quoted 3 lines · spdawson at gmail.com
From: Simon Dawson<[email protected]>
Signed-off-by Simon Dawson<[email protected]>
[snip]
Quoted 12 lines
package/lcdapi/lcdapi-make-toString-static.patch new file +6
-0@@ -0,0 +1,19 @@ +make the toString function defined in the LCDCallback.h header into a static +function, to fix link-time errors like the following. + + multiple definition of `toString(char)' + +Signed-off-by: Simon Dawson<[email protected]>
package/lcdapi/lcdapi-make-toString-static.patch line 16
Quoted 10 lines
package/lcdapi/lcdapi-make-toString-static.patch new file +10
-0+ +diff -Nurp a/keys/LCDCallback.h b/keys/LCDCallback.h +--- a/keys/LCDCallback.h 2004-07-27 19:06:27.000000000 +0100 ++++ b/keys/LCDCallback.h 2012-10-01 10:59:52.685708010 +0100 +@@ -77,7 +77,7 @@ class LCDCallback + + typedef std::map<KeyEvent, LCDCallback *> CallbackMap; + +-std::string toString(KeyEvent t) ++static std::string toString(KeyEvent t)
Making it inline sounds more appropriate.
BTW, did you upstream the patches?
Quoted 9 lines
package/lcdapi/lcdapi-make-toString-static.patch new file +3
-0+ { + std::string s(1, (char)t); + return s;package/lcdapi/lcdapi.mk new file +0
-0
package/lcdapi/lcdapi.mk line 8
Quoted 8 lines
package/lcdapi/lcdapi.mk new file +8
-0@@ -0,0 +1,73 @@ +############################################################# +# +# lcdapi +# +############################################################# +LCDAPI_VERSION = 0.2 +LCDAPI_SITE = ftp://ftp2.c-sait.net/csait +LCDAPI_DEPENDENCIES = host-lcdapi
Why is this needed? Or rather: I can build without this.
If it is not needed, the whole host-lcdapi can be removed BTW.
package/lcdapi/lcdapi.mk line 17
Quoted 9 lines
package/lcdapi/lcdapi.mk new file +9
-0+LCDAPI_INSTALL_STAGING = YES + +LCDAPI_LICENSE = LGPLv2.1+ +LCDAPI_LICENSE_FILES = COPYING + +LCDAPI_MAKE_OPT = \ + $(TARGET_CONFIGURE_OPTS) \ + LD="$(TARGET_CXX)" \ + LDFLAGS="$(TARGET_LDFLAGS) -shared"
It would make sense to also add CC="$(TARGET_CXX)" (although not strictly
necessary, because gcc recognizes the .cpp extension).
More importantly, the CFLAGS overrides the CFLAGS of lcdapi'sMakefile, and that contains the all-important -fPIC. I wonder how you got it built without that... So either:
- Set CFLAGS to "$(TARGET_CFLAGS) -fPIC"
- Patch the Makefile to append to CFLAGS
- Set CC to "$(TARGET_CXX) $(TARGET_CFLAGS)" and leave CFLAGS alone
Finally, it would make sense to call it LCDAPI_MAKE_OPTS,
similar to TARGET_CONFIGURE_OPTS.
Quoted 7 lines
package/lcdapi/lcdapi.mk new file +7
-0+ +HOST_LCDAPI_MAKE_OPT = \ + $(HOST_CONFIGURE_OPTS) \ + LD="$(HOSTCXX)" \ + LDFLAGS="$(HOST_LDFLAGS) -shared" + +define LCDAPI_BUILD_CMDS
package/lcdapi/lcdapi.mk line 34
Quoted 10 lines
package/lcdapi/lcdapi.mk new file +10
-0+ $(TARGET_MAKE_ENV) $(MAKE) $(LCDAPI_MAKE_OPT) -C $(@D) +endef + +define HOST_LCDAPI_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) $(HOST_LCDAPI_MAKE_OPT) -C $(@D) +endef + +define DO_LCDAPI_INSTALL + $(INSTALL) -m 0755 -d $(1)/usr/lib + $(INSTALL) -m 0755 -t $(1)/usr/lib $(@D)/lib/liblcdapi.so
We would typically use
$(INSTALL) -m 0755 -D $(@D)/lib/liblcdapi.so $(1)/usr/lib
(which does the mkdir and the install in one shot).
package/lcdapi/lcdapi.mk line 39
Quoted 5 lines
package/lcdapi/lcdapi.mk new file +5
-0+ $(INSTALL) -m 0755 -d $(1)/usr/include/lcdapi + for i in api include keys sensors; do \ + $(INSTALL) -m 0755 -d $(1)/usr/include/lcdapi/$$i&& \ + $(INSTALL) -m 0644 -t $(1)/usr/include/lcdapi/$$i \ + $(@D)/$$i/*.h; \
Same here, but then iterating over api/*.h include/*.h keys/*.h sensors/*.h
But wouldn't it be cleaner to add (and upstream) an 'install' target
to the Makefile?
Regards,
Arnout
Quoted 34 lines
package/lcdapi/lcdapi.mk new file +34
-0+ done +endef + +define DO_LCDAPI_UNINSTALL + $(RM) $(1)/usr/lib/liblcdapi.so + $(RM) -r $(1)/usr/include/lcdapi +endef + +define HOST_LCDAPI_INSTALL_CMDS + $(call DO_LCDAPI_INSTALL,$(HOST_DIR)) +endef + +define LCDAPI_INSTALL_STAGING_CMDS + $(call DO_LCDAPI_INSTALL,$(STAGING_DIR)) +endef + +define LCDAPI_INSTALL_TARGET_CMDS + $(call DO_LCDAPI_INSTALL,$(TARGET_DIR)) +endef + +define LCDAPI_UNINSTALL_STAGING_CMDS + $(call DO_LCDAPI_UNINSTALL,$(STAGING_DIR)) +endef + +define LCDAPI_UNINSTALL_TARGET_CMDS + $(call DO_LCDAPI_UNINSTALL,$(TARGET_DIR)) +endef + +define LCDAPI_CLEAN_CMDS + $(TARGET_MAKE_ENV) $(MAKE) $(LCDAPI_MAKE_OPT) -C $(@D) clean +endef + +$(eval $(generic-package)) +$(eval $(host-generic-package))
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 lcdapi: new package
Hi Arnout. Thanks for taking the time to review this.
Quoted 1 line · Arnout Vandecappelle
Making it inline sounds more appropriate.
Okay; will do so.
Quoted 1 line
BTW, did you upstream the patches?
Unfortunately, the upstream project is no longer being actively maintained; I have attempted to contact the author, but have had no response.
I have actually started work on a fork of the project at
https://github.com/spdawson/lcdapi; but I thought it best to use the original source for the Buildroot package, at least in the first instance.
Quoted 5 lines
Quoted 1 line
+LCDAPI_DEPENDENCIES = host-lcdapi
Why is this needed? Or rather: I can build without this.
If it is not needed, the whole host-lcdapi can be removed BTW.
You're quite right: the host dependency is not required. This was committed in error; I was using the dependency to trigger a host build of the package during testing. I will remove the dependency.
Quoted 8 lines
package/lcdapi/lcdapi.mk line 17
Quoted 4 lines
package/lcdapi/lcdapi.mk new file +4
-0+LCDAPI_MAKE_OPT = \ + $(TARGET_CONFIGURE_OPTS) \ + LD="$(TARGET_CXX)" \ + LDFLAGS="$(TARGET_LDFLAGS) -shared"It would make sense to also add CC="$(TARGET_CXX)" (although not strictly
necessary, because gcc recognizes the .cpp extension).
Okay; will do.
Quoted 7 lines
More importantly, the CFLAGS overrides the CFLAGS of lcdapi's
Makefile, and that contains the all-important -fPIC. I wonder how you got it built without that... So either:- Set CFLAGS to "$(TARGET_CFLAGS) -fPIC"
- Patch theMakefileto append to CFLAGS
- Set CC to "$(TARGET_CXX) $(TARGET_CFLAGS)" and leave CFLAGS alone
Okay, will do.
Quoted 2 lines
Finally, it would make sense to call it
LCDAPI_MAKE_OPTS,
similar toTARGET_CONFIGURE_OPTS.
Okay, will do.
Quoted 3 lines
We would typically use
$(INSTALL) -m 0755 -D $(@D)/lib/liblcdapi.so $(1)/usr/lib(which does the mkdir and the install in one shot).
Okay, will do.
Quoted 2 lines
But wouldn't it be cleaner to add (and upstream) an 'install' target
to theMakefile?
Yes, okay.
Simon.
PATCH 1/1 lcdapi: new package
Quoted 9 lines · Simon Dawson
Hi Arnout. Thanks for taking the time to review this.
Quoted 1 line · Arnout Vandecappelle
Making it inline sounds more appropriate.
Okay; will do so.
Quoted 1 line
BTW, did you upstream the patches?
Quoted 8 lines
Unfortunately, the upstream project is no longer being actively maintained; I have attempted to contact the author, but have had no response.
I have actually started work on a fork of the project at
https://github.com/spdawson/lcdapi; but I thought it best to use the original source for the Buildroot package, at least in the first instance.
I don't think that's necessary. It's better if we don't have to
carry patches in buildroot!
[snip]
Quoted 10 lines
Quoted 8 lines
package/lcdapi/lcdapi.mk line 17
Quoted 4 lines
package/lcdapi/lcdapi.mk new file +4
-0+LCDAPI_MAKE_OPT = \ + $(TARGET_CONFIGURE_OPTS) \ + LD="$(TARGET_CXX)" \ + LDFLAGS="$(TARGET_LDFLAGS) -shared"It would make sense to also add CC="$(TARGET_CXX)" (although not strictly
necessary, because gcc recognizes the .cpp extension).Okay; will do.
If you're anyway taking over upstream, you could really fix the Makefiles
and use CXX instead of CC!
Quoted 9 lines
Quoted 7 lines
More importantly, the CFLAGS overrides the CFLAGS of lcdapi's
Makefile, and that contains the all-important -fPIC. I wonder how you got it built without that... So either:- Set CFLAGS to "$(TARGET_CFLAGS) -fPIC"
- Patch theMakefileto append to CFLAGS
- Set CC to "$(TARGET_CXX) $(TARGET_CFLAGS)" and leave CFLAGS aloneOkay, will do.
Again, best to patch the Makefile since you can.
Quoted 9 lines
Quoted 2 lines
Finally, it would make sense to call it
LCDAPI_MAKE_OPTS,
similar toTARGET_CONFIGURE_OPTS.Okay, will do.
Quoted 3 lines
We would typically use
$(INSTALL) -m 0755 -D $(@D)/lib/liblcdapi.so $(1)/usr/lib(which does the mkdir and the install in one shot).
Quoted 6 lines
Okay, will do.
Quoted 2 lines
But wouldn't it be cleaner to add (and upstream) an 'install' target
to theMakefile?Yes, okay.
Sorry that I'm giving you more work :-)
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 lcdapi: new package
Quoted 1 line · Arnout Vandecappelle
Sorry that I'm giving you more work :-)
Hi Arnout. No worries --- thanks for the comments and suggestions. I'll rework the patch to use the new upstream project, which should make things a lot cleaner.
Simon.