todbot / blink1-tool

Command-line tools and C library for blink(1) USB RGB LED
https://blink1.thingm.com/
Other
84 stars 15 forks source link

Remove -D option from FreeBSD Makefile install target to match NetBSD and OpenBSD behavior. #27

Closed ccammack closed 3 years ago

ccammack commented 4 years ago

Removing the -D option for FreeBSD seems to solve the install problem I reported in #654, assuming that libblink1.so and blink1-tool are the only two files involved.

Here's the build output on FreeBSD after making the change:

# gmake clean
[...]

# ls /usr/local/lib/libblink1.so
ls: /usr/local/lib/libblink1.so: No such file or directory

# ls /usr/local/bin/blink1-tool
ls: /usr/local/bin/blink1-tool: No such file or directory
# gmake install
Building blink1-tool for OS=freebsd BLINK1_VERSION=v2.1.0-freebsd-amd64 USBLIB_TYPE=HIDAPI
Type 'make help' for other build products
patching hidapi
patch -N < patches/freebsd-hidapi-libusb-hid.c.patch || echo "patch already applied"
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- hidapi/libusb/hid.c.orig   2018-11-14 21:19:07.488832000 -0800
|+++ hidapi/libusb/hid.c        2018-11-14 21:29:55.513507000 -0800
--------------------------
Patching file hidapi/libusb/hid.c using Plan A...
Ignoring previously applied (or reversed) patch.
Hunk #1 ignored at 339.
Hunk #2 ignored at 401.
2 out of 2 hunks ignored--saving rejects to hidapi/libusb/hid.c.rej
done
patch already applied
gcc -DUSE_HIDAPI -I./hidapi/hidapi -I/usr/local/include -fPIC -Wall -std=gnu99 -DBLINK1_VERSION=\"""v2.1.0"-freebsd-"amd64""\" -c hidapi/libusb/hid.c -o hidapi/libusb/hid.o
gcc -DUSE_HIDAPI -I./hidapi/hidapi -I/usr/local/include -fPIC -Wall -std=gnu99 -DBLINK1_VERSION=\"""v2.1.0"-freebsd-"amd64""\" -c blink1-lib.c -o blink1-lib.o
gcc -DUSE_HIDAPI -I./hidapi/hidapi -I/usr/local/include -fPIC -Wall -std=gnu99 -DBLINK1_VERSION=\"""v2.1.0"-freebsd-"amd64""\"   -c -o blink1-tool.o blink1-tool.c
gcc -DUSE_HIDAPI -I./hidapi/hidapi -I/usr/local/include -fPIC -Wall -std=gnu99 -DBLINK1_VERSION=\"""v2.1.0"-freebsd-"amd64""\" -c blink1-tool.c -o blink1-tool.o
gcc -DUSE_HIDAPI -I./hidapi/hidapi -I/usr/local/include -fPIC -Wall -std=gnu99 -DBLINK1_VERSION=\"""v2.1.0"-freebsd-"amd64""\" -static ./hidapi/libusb/hid.o blink1-lib.o -lusb -lrt -lpthread -L/usr/local/lib -liconv blink1-tool.o -o blink1-tool
gcc -shared -o libblink1.so -lusb -lrt -lpthread -L/usr/local/lib -liconv -DUSE_HIDAPI -I./hidapi/hidapi -I/usr/local/include -fPIC -Wall -std=gnu99 -DBLINK1_VERSION=\"""v2.1.0"-freebsd-"amd64""\" ./hidapi/libusb/hid.o blink1-lib.o -lusb -lrt -lpthread -L/usr/local/lib -liconv
install libblink1.so /usr/local/lib/libblink1.so
install blink1-tool /usr/local/bin/blink1-tool
# ls /usr/local/lib/libblink1.so
/usr/local/lib/libblink1.so

# ls /usr/local/bin/blink1-tool
/usr/local/bin/blink1-tool

# which blink1-tool
/usr/local/bin/blink1-tool

# blink1-tool --version
blink1-tool version: v2.1.0-freebsd-amd64
normanr commented 3 years ago

Based on the install man page the option should probably be replaced with -d. You should rebase and retry the checks because it looks like the linux one only timed out, and should succeed if retried.