Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Thingm's BLINK(1) tool
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ferg
Guru
Guru


Joined: 15 Nov 2002
Posts: 536
Location: Cambridge, UK

PostPosted: Thu May 23, 2013 7:29 am    Post subject: Thingm's BLINK(1) tool Reply with quote

Thingm produce a small USB LED dongle that blinks (Blink(1)!). It was a Kickstarter project that sold really well and is brilliant to use as a notification device. There are many apps to use it, from a small command line tool to GUI ones (e.g. a twitter notifier etc...).

http://thingm.com/products/blink-1.html

Unfortunately I'm having issues getting the executable compiled under Gentoo:

https://getsatisfaction.com/thingm/topics/connected_no_devices_found

Check out the posts towards the bottom of the above thread.

Basically make cannot find the USB libraries.

Code:
chris@scotgate> ~/src/Blink1/blink1/commandline$  LIBS+=-L/usr/lib/ make
building for OS=linux
gcc `pkg-config libusb-1.0 --cflags` -fPIC -std=gnu99 -I ../hardware/firmware  -I./hidapi/hidapi -I./mongoose -g -c blink1-tool.c -o blink1-tool.o
gcc `pkg-config libusb-1.0 --cflags` -fPIC -std=gnu99 -I ../hardware/firmware  -I./hidapi/hidapi -I./mongoose -g -static -g ./hidapi/libusb/hid.o blink1-lib.o  -L/usr/lib/ `pkg-config libusb-1.0 --libs` -lrt -lpthread -ldl blink1-tool.o -o blink1-tool
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lusb-1.0
collect2: ld returned 1 exit status
make: *** [blink1-tool] Error 1
chris@scotgate> ~/src/Blink1/blink1/commandline$


One of the Thingm Support said the following:

Quote:
Okay, I think I see the issue. I guess Gentoo doesn't use "pkg-config", which is what the Makefile is currently using to determine how libusb was installed.

In that case, try building with:
LIBS+=-L/usr/lib make

That will force "/usr/lib" into the library search path during linking.

If anyone reading this is a Gentoo hacker, what's the preferred way of determining package compilation options, a la "pkg-config"?


That does not work. However, are they on the right tracks?
_________________
Climb up it, kayak down it + make sure it runs on GNU/Linux
"cease to exist, giving my goodbye, drive my car into the ocean,
you think I'm dead, but i sail away, on a wave of mutilation!"
Back to top
View user's profile Send private message
etimmons
n00b
n00b


Joined: 31 Jul 2013
Posts: 1

PostPosted: Wed Jul 31, 2013 10:51 pm    Post subject: Thingm's BLINK(1) tool Reply with quote

Hi ferg, if you haven't figured it out already part of the problem is that the Makefile ThingM provides builds a statically linked binary. I think very few things in Portage require a static version of libusb, so it's unlikely you have the necessary files.

Try either emerging libusb with the static-libs USE flag enabled or give this patch a try:

Code:
diff --git a/commandline/Makefile b/commandline/Makefile
index b8d2568..dca48de 100644
--- a/commandline/Makefile
+++ b/commandline/Makefile
@@ -124,7 +124,7 @@ LIBS   += `pkg-config libusb-1.0 --libs` -lrt -lpthread -ldl
 
 OBJS = ./hidapi/libusb/hid.o
 
-EXEFLAGS = -static
+EXEFLAGS =
 LIBFLAGS = -shared -o $(LIBTARGET) $(LIBS)
 
 EXE=


Hope that helps!
Back to top
View user's profile Send private message
ferg
Guru
Guru


Joined: 15 Nov 2002
Posts: 536
Location: Cambridge, UK

PostPosted: Thu Aug 01, 2013 8:27 am    Post subject: Reply with quote

Nice one, thanks!

I started using blink1raw instead. That works OKish.

I did:

/etc/portage/package.use/libusb

Code:
dev-libs/libusb static-libs


Now for blinking goodness! I'm using it to alert me when a person walks past a motion detecting camera.
_________________
Climb up it, kayak down it + make sure it runs on GNU/Linux
"cease to exist, giving my goodbye, drive my car into the ocean,
you think I'm dead, but i sail away, on a wave of mutilation!"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum