-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3e221b
commit aa54eb0
Showing
2 changed files
with
221 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 2f7b83da..66b5e8c8 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -16,6 +16,7 @@ ExternalProject_Add(EP_${PROJECT_NAME} | ||
|
||
CONFIGURE_COMMAND "./configure" | ||
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/libphidgets22-1.6.20200417-fix-warnings.patch | ||
+ COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/libusb.patch | ||
SOURCE_DIR ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-src | ||
BUILD_IN_SOURCE 1 | ||
BUILD_COMMAND make "CFLAGS=-g -O2 -Wno-incompatible-pointer-types -Wno-deprecated-declarations -Wno-format-truncation" | ||
diff --git a/patch/libusb.patch b/patch/libusb.patch | ||
new file mode 100644 | ||
index 00000000..93c9d526 | ||
--- /dev/null | ||
+++ b/patch/libusb.patch | ||
@@ -0,0 +1,201 @@ | ||
+diff -urp libphidget22-1.6.20200417.orig/configure libphidget22-1.6.20200417/configure | ||
+--- libphidget22-1.6.20200417.orig/configure 2020-04-17 21:51:11.000000000 +0000 | ||
++++ libphidget22-1.6.20200417/configure 2020-06-02 13:31:26.487312313 +0000 | ||
+@@ -738,6 +738,7 @@ | ||
+ docdir | ||
+ oldincludedir | ||
+ includedir | ||
++runstatedir | ||
+ localstatedir | ||
+ sharedstatedir | ||
+ sysconfdir | ||
+@@ -823,6 +824,7 @@ | ||
+ sysconfdir='${prefix}/etc' | ||
+ sharedstatedir='${prefix}/com' | ||
+ localstatedir='${prefix}/var' | ||
++runstatedir='${localstatedir}/run' | ||
+ includedir='${prefix}/include' | ||
+ oldincludedir='/usr/include' | ||
+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' | ||
+@@ -1075,6 +1077,15 @@ | ||
+ | -silent | --silent | --silen | --sile | --sil) | ||
+ silent=yes ;; | ||
+ | ||
++ -runstatedir | --runstatedir | --runstatedi | --runstated \ | ||
++ | --runstate | --runstat | --runsta | --runst | --runs \ | ||
++ | --run | --ru | --r) | ||
++ ac_prev=runstatedir ;; | ||
++ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | ||
++ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | ||
++ | --run=* | --ru=* | --r=*) | ||
++ runstatedir=$ac_optarg ;; | ||
++ | ||
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) | ||
+ ac_prev=sbindir ;; | ||
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | ||
+@@ -1212,7 +1223,7 @@ | ||
+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ | ||
+ datadir sysconfdir sharedstatedir localstatedir includedir \ | ||
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ | ||
+- libdir localedir mandir | ||
++ libdir localedir mandir runstatedir | ||
+ do | ||
+ eval ac_val=\$$ac_var | ||
+ # Remove trailing slashes. | ||
+@@ -1365,6 +1376,7 @@ | ||
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] | ||
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] | ||
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var] | ||
++ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] | ||
+ --libdir=DIR object code libraries [EPREFIX/lib] | ||
+ --includedir=DIR C header files [PREFIX/include] | ||
+ --oldincludedir=DIR C header files for non-gcc [/usr/include] | ||
+@@ -5678,7 +5690,7 @@ | ||
+ fi | ||
+ | ||
+ : ${AR=ar} | ||
+-: ${AR_FLAGS=cr} | ||
++: ${AR_FLAGS=cru} | ||
+ | ||
+ | ||
+ | ||
+@@ -12261,9 +12273,9 @@ | ||
+ as_fn_error $? "Missing libpthread!" "$LINENO" 5 | ||
+ fi | ||
+ | ||
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing libusb_init" >&5 | ||
+-$as_echo_n "checking for library containing libusb_init... " >&6; } | ||
+-if ${ac_cv_search_libusb_init+:} false; then : | ||
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing usb-1.0" >&5 | ||
++$as_echo_n "checking for library containing usb-1.0... " >&6; } | ||
++if ${ac_cv_search_usb_1_0+:} false; then : | ||
+ $as_echo_n "(cached) " >&6 | ||
+ else | ||
+ ac_func_search_save_LIBS=$LIBS | ||
+@@ -12276,16 +12288,16 @@ | ||
+ #ifdef __cplusplus | ||
+ extern "C" | ||
+ #endif | ||
+-char libusb_init (); | ||
++char usb-1.0 (); | ||
+ int | ||
+ main () | ||
+ { | ||
+-return libusb_init (); | ||
++return usb-1.0 (); | ||
+ ; | ||
+ return 0; | ||
+ } | ||
+ _ACEOF | ||
+-for ac_lib in '' usb-1.0; do | ||
++for ac_lib in '' ; do | ||
+ if test -z "$ac_lib"; then | ||
+ ac_res="none required" | ||
+ else | ||
+@@ -12293,29 +12305,27 @@ | ||
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" | ||
+ fi | ||
+ if ac_fn_c_try_link "$LINENO"; then : | ||
+- ac_cv_search_libusb_init=$ac_res | ||
++ ac_cv_search_usb_1_0=$ac_res | ||
+ fi | ||
+ rm -f core conftest.err conftest.$ac_objext \ | ||
+ conftest$ac_exeext | ||
+- if ${ac_cv_search_libusb_init+:} false; then : | ||
++ if ${ac_cv_search_usb_1_0+:} false; then : | ||
+ break | ||
+ fi | ||
+ done | ||
+-if ${ac_cv_search_libusb_init+:} false; then : | ||
++if ${ac_cv_search_usb_1_0+:} false; then : | ||
+ | ||
+ else | ||
+- ac_cv_search_libusb_init=no | ||
++ ac_cv_search_usb_1_0=no | ||
+ fi | ||
+ rm conftest.$ac_ext | ||
+ LIBS=$ac_func_search_save_LIBS | ||
+ fi | ||
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_libusb_init" >&5 | ||
+-$as_echo "$ac_cv_search_libusb_init" >&6; } | ||
+-ac_res=$ac_cv_search_libusb_init | ||
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_usb_1_0" >&5 | ||
++$as_echo "$ac_cv_search_usb_1_0" >&6; } | ||
++ac_res=$ac_cv_search_usb_1_0 | ||
+ if test "$ac_res" != no; then : | ||
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | ||
+- | ||
+-else | ||
+ as_fn_error $? "Missing libusb!" "$LINENO" 5 | ||
+ fi | ||
+ | ||
+@@ -12446,9 +12456,9 @@ | ||
+ as_fn_error $? "Missing libpthread!" "$LINENO" 5 | ||
+ fi | ||
+ | ||
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing libusb_init" >&5 | ||
+-$as_echo_n "checking for library containing libusb_init... " >&6; } | ||
+-if ${ac_cv_search_libusb_init+:} false; then : | ||
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing usb" >&5 | ||
++$as_echo_n "checking for library containing usb... " >&6; } | ||
++if ${ac_cv_search_usb+:} false; then : | ||
+ $as_echo_n "(cached) " >&6 | ||
+ else | ||
+ ac_func_search_save_LIBS=$LIBS | ||
+@@ -12461,16 +12471,16 @@ | ||
+ #ifdef __cplusplus | ||
+ extern "C" | ||
+ #endif | ||
+-char libusb_init (); | ||
++char usb (); | ||
+ int | ||
+ main () | ||
+ { | ||
+-return libusb_init (); | ||
++return usb (); | ||
+ ; | ||
+ return 0; | ||
+ } | ||
+ _ACEOF | ||
+-for ac_lib in '' usb; do | ||
++for ac_lib in '' ; do | ||
+ if test -z "$ac_lib"; then | ||
+ ac_res="none required" | ||
+ else | ||
+@@ -12478,29 +12488,27 @@ | ||
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" | ||
+ fi | ||
+ if ac_fn_c_try_link "$LINENO"; then : | ||
+- ac_cv_search_libusb_init=$ac_res | ||
++ ac_cv_search_usb=$ac_res | ||
+ fi | ||
+ rm -f core conftest.err conftest.$ac_objext \ | ||
+ conftest$ac_exeext | ||
+- if ${ac_cv_search_libusb_init+:} false; then : | ||
++ if ${ac_cv_search_usb+:} false; then : | ||
+ break | ||
+ fi | ||
+ done | ||
+-if ${ac_cv_search_libusb_init+:} false; then : | ||
++if ${ac_cv_search_usb+:} false; then : | ||
+ | ||
+ else | ||
+- ac_cv_search_libusb_init=no | ||
++ ac_cv_search_usb=no | ||
+ fi | ||
+ rm conftest.$ac_ext | ||
+ LIBS=$ac_func_search_save_LIBS | ||
+ fi | ||
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_libusb_init" >&5 | ||
+-$as_echo "$ac_cv_search_libusb_init" >&6; } | ||
+-ac_res=$ac_cv_search_libusb_init | ||
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_usb" >&5 | ||
++$as_echo "$ac_cv_search_usb" >&6; } | ||
++ac_res=$ac_cv_search_usb | ||
+ if test "$ac_res" != no; then : | ||
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | ||
+- | ||
+-else | ||
+ as_fn_error $? "Missing libusb!" "$LINENO" 5 | ||
+ fi | ||
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters