libftdi{0,1} related work
v2 cover libftdi{0,1} related work
Hi all,
The short series does:
- bump libftdi and add libftdi1
- use libftdi1 for the 2 packages explicitly dependending on libftdi (only build tests, runtime test feedback is welcome).
It seems ola also depends on libftdi, but does not support libftdi1. Who knows how many other packages silently depend on libftdi depending on the buildroot configuration...
Regards,
Samuel
--
Daniel Sangue (1):
package/libftdi1: new package
Samuel Martin (3):
package/libftdi: bump to version 0.20 package/avrdude: depends on libftdi1 instead of libftdi package/openocd: depends on libftdi1 instead of libftdi
package/Config.in | 1 + package/avrdude/avrdude.mk | 4 +- package/libftdi/libftdi.hash | 2 + package/libftdi/libftdi.mk | 2 +- ...he-standard-CMake-flag-to-drive-the-share.patch | 96 ++++++++++++++++++++++ .../libftdi1/0002-cmake-fix-FindUSB1.cmake.patch | 34 ++++++++ ...o-not-check-for-g-when-FTDIPP-is-disabled.patch | 46 +++++++++++ package/libftdi1/Config.in | 37 +++++++++ package/libftdi1/libftdi1.hash | 2 + package/libftdi1/libftdi1.mk | 37 +++++++++ package/openocd/Config.in | 8 +- package/openocd/openocd.mk | 2 +- 12 files changed, 263 insertions(+), 8 deletions(-) create mode 100644 package/libftdi/libftdi.hash create mode 100644 package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch create mode 100644 package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch create mode 100644 package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch create mode 100644 package/libftdi1/Config.in create mode 100644 package/libftdi1/libftdi1.hash create mode 100644 package/libftdi1/libftdi1.mk
--
2.3.2
PATCH v2 1/4 package/libftdi: bump to version 0.20
Also add *.hash file.
---
changes v1->v2:
- rebase
--- package/libftdi/libftdi.hash | 2 ++ package/libftdi/libftdi.mk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 package/libftdi/libftdi.hash
package/libftdi/libftdi.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally computed (after checking the signature from http://www.intra2net.com/en/developer/libftdi/download.php) +sha256 3176d5b5986438f33f5208e690a8bfe90941be501cc0a72118ce3d338d4b838e libftdi-0.20.tar.gz
package/libftdi/libftdi.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -LIBFTDI_VERSION = 0.19 +LIBFTDI_VERSION = 0.20 LIBFTDI_SITE = http://www.intra2net.com/en/developer/libftdi/download LIBFTDI_DEPENDENCIES = libusb-compat libusb LIBFTDI_INSTALL_STAGING = YES
Signature · 1 line
2.3.2
Thomas Petazzoni
AppliedPATCH v2 1/4 package/libftdi: bump to version 0.20
Dear Samuel Martin,
Quoted 4 lines · Samuel Martin
Also add *.hash file.
Cc "Yann E. MORIN" <[email protected]>Signed-off-by Samuel Martin <[email protected]>
Applied, thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 2/4 package/libftdi1: new package
In reply to Samuel MartinFrom: Daniel Sangue <[email protected]>
This version of libftdi can coexists beside the 0.x version.
[Samuel Martin:
- libftdi1.mk: bump to version 1.2 and add hash
- cleanup uneeded libusb-compat stuff
- Config.in: add comment when ftdipp1 deps are not met
- fix typos in variable names and legit CMake options for *_CONF_OPTS
- add support for python bindings and ftdi_eeprom
- fix static build
- fix build with toolchain w/o C++ support
]
---
change v1->v2
- rebase on top of master
- libftdi1.mk: bump to version 1.2
- add hash
- Config.in: cleanup deps for ftdipp1
- Config.in: add comment when ftdipp1 deps are not met
- libftdi1.mk: fix typos in LIBFTDI1_CONF_OPTS variable name
- libftdi1.mk: use proper CMake options for *_CONF_OPTS
- libftdi1.mk: update libftdi1 deps and conf. opts.
- libftdi1.mk: add support for python bindings and ftdi_eeprom
- libftdi1.mk: add patch fixing static build
- libftdi1.mk: add patch fixing FindUSB1.cmake module (for static build)
- libftdi1.mk: add patch correctly disabling ftdipp when the toolchain does not install libstdc++
- reword commit message
--- package/Config.in | 1 + ...he-standard-CMake-flag-to-drive-the-share.patch | 96 ++++++++++++++++++++++ .../libftdi1/0002-cmake-fix-FindUSB1.cmake.patch | 34 ++++++++ ...o-not-check-for-g-when-FTDIPP-is-disabled.patch | 46 +++++++++++ package/libftdi1/Config.in | 37 +++++++++ package/libftdi1/libftdi1.hash | 2 + package/libftdi1/libftdi1.mk | 37 +++++++++ 7 files changed, 253 insertions(+) create mode 100644 package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch create mode 100644 package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch create mode 100644 package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch create mode 100644 package/libftdi1/Config.in create mode 100644 package/libftdi1/libftdi1.hash create mode 100644 package/libftdi1/libftdi1.mk
package/Config.in +1 -0
@@ -752,6 +752,7 @@ menu "Hardware handling" source "package/libcec/Config.in" source "package/libfreefare/Config.in" source "package/libftdi/Config.in" + source "package/libftdi1/Config.in" source "package/libhid/Config.in" source "package/libiio/Config.in" source "package/libinput/Config.in"
package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch new file +96 -0
96 lines not on this page · raw message
package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch new file +34 -0
@@ -0,0 +1,34 @@ +From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 10:01:17 +0100 +Subject: [PATCH 2/2] cmake: fix FindUSB1.cmake + +Make sure all ldflags are correctly set, especially for static build. + +Signed-off-by: Samuel Martin <[email protected]> +--- + cmake/FindUSB1.cmake | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/cmake/FindUSB1.cmake b/cmake/FindUSB1.cmake +index b90e297..e7f1b3c 100644 +--- a/cmake/FindUSB1.cmake ++++ b/cmake/FindUSB1.cmake +@@ -26,8 +26,12 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + PATH_SUFFIXES libusb-1.0 + PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS}) + +- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 +- PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) ++ set(LIBUSB_LIBRARIES ${PC_LIBUSB_STATIC_LDFLAGS} ${PC_LIBUSB_STATIC_LDFLAGS_OTHER}) ++ foreach(libname ${PC_LIBUSB_STATIC_LIBRARIES}) ++ FIND_LIBRARY(lib NAMES ${libname} ++ PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) ++ list(APPEND LIBUSB_LIBRARIES ${lib}) ++ endforeach() + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR) +-- +2.2.2 +
package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch new file +46 -0
46 lines not on this page · raw message
package/libftdi1/Config.in new file +37 -0
@@ -0,0 +1,37 @@ +config BR2_PACKAGE_LIBFTDI1 + bool "libftdi1" + depends on BR2_TOOLCHAIN_HAS_THREADS # libusb + select BR2_PACKAGE_LIBUSB + help + Userspace access to FTDI USB interface chips (version 1.x) + + http://www.intra2net.com/en/developer/libftdi/index.php + +if BR2_PACKAGE_LIBFTDI1 + +config BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1 + depends on BR2_INSTALL_LIBSTDCPP # boost + depends on BR2_LARGEFILE # boost + depends on BR2_TOOLCHAIN_HAS_THREADS # boost + select BR2_PACKAGE_BOOST + bool "libfdtipp1" + help + C++ bindings for libftdi + +comment "libfdtipp1 needs a toolchain w/ C++, largefile, threads" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS + +config BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS + depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 + bool "python bindings" + help + Python bindings for libftdi + +config BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM + select BR2_PACKAGE_LIBCONFUSE + bool "ftdi_eeprom tool" + +endif # BR2_PACKAGE_LIBFTDI1 + +comment "libftdi1 needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS
package/libftdi1/libftdi1.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally computed (after checking the signature from http://www.intra2net.com/en/developer/libftdi/download.php) +sha256 a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6 libftdi1-1.2.tar.bz2
package/libftdi1/libftdi1.mk new file +37 -0
@@ -0,0 +1,37 @@ +################################################################################ +# +# libftdi1 +# +################################################################################ + +LIBFTDI1_VERSION = 1.2 +LIBFTDI1_SOURCE = libftdi1-$(LIBFTDI1_VERSION).tar.bz2 +LIBFTDI1_SITE = http://www.intra2net.com/en/developer/libftdi/download/ +LIBFTDI1_INSTALL_STAGING = YES +LIBFTDI1_DEPENDENCIES = libusb +LIBFTDI1_CONF_OPTS = -DDOCUMENTATION=OFF -DEXAMPLES=OFF + +ifeq ($(BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1),y) +LIBFTDI1_DEPENDENCIES += boost +LIBFTDI1_CONF_OPTS += -DFTDIPP=ON +else +LIBFTDI1_CONF_OPTS += -DFTDIPP=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS),y) +LIBFTDI1_DEPENDENCIES += $(if BR2_PACKAGE_PYTHON,python,python3) host-swig +LIBFTDI1_CONF_OPTS += -DPYTHON_BINDINGS=ON +else +LIBFTDI1_CONF_OPTS += -DPYTHON_BINDINGS=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM),y) +# ftdi_eeprom optionally depends on libintl, so make sure gettext is built +# _before_ libfitdi1 when gettext is enbaled. +LIBFTDI1_DEPENDENCIES += libconfuse $(if $(BR2_PACKAGE_GETTEXT),gettext) +LIBFTDI1_CONF_OPTS += -DFTDI_EEPROM=ON +else +LIBFTDI1_CONF_OPTS += -DFTDI_EEPROM=OFF +endif + +$(eval $(cmake-package))
Signature · 1 line
2.3.2
PATCH v2 2/4 package/libftdi1: new package
Quoted 338 lines · Samuel Martin
From: Daniel Sangue <[email protected]>
This version of libftdi can coexists beside the 0.x version.
Signed-off-by Daniel Sangue <[email protected]>[Samuel Martin:
- libftdi1.mk: bump to version 1.2 and add hash
- cleanup uneeded libusb-compat stuff
- Config.in: add comment when ftdipp1 deps are not met
- fix typos in variable names and legit CMake options for*_CONF_OPTS
- add support for python bindings andftdi_eeprom
- fix static build
- fix build with toolchain w/o C++ support
]Signed-off-by Samuel Martin <[email protected]>---
changev1->v2
- rebase on top of master
- libftdi1.mk: bump to version 1.2
- add hash
- Config.in: cleanup deps for ftdipp1
- Config.in: add comment when ftdipp1 deps are not met
- libftdi1.mk: fix typos inLIBFTDI1_CONF_OPTSvariable name
- libftdi1.mk: use proper CMake options for*_CONF_OPTS
- libftdi1.mk: update libftdi1 deps and conf. opts.
- libftdi1.mk: add support for python bindings andftdi_eeprom
- libftdi1.mk: add patch fixing static build
- libftdi1.mk: add patch fixing FindUSB1.cmake module (for static build)
- libftdi1.mk: add patch correctly disabling ftdipp when the toolchain does not install libstdc++
- reword commit message--- package/Config.in | 1 + ...he-standard-CMake-flag-to-drive-the-share.patch | 96 ++++++++++++++++++++++ .../libftdi1/0002-cmake-fix-FindUSB1.cmake.patch | 34 ++++++++ ...o-not-check-for-g-when-FTDIPP-is-disabled.patch | 46 +++++++++++ package/libftdi1/Config.in | 37 +++++++++ package/libftdi1/libftdi1.hash | 2 + package/libftdi1/libftdi1.mk | 37 +++++++++ 7 files changed, 253 insertions(+) create mode 100644 package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch create mode 100644 package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch create mode 100644 package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch create mode 100644 package/libftdi1/Config.in create mode 100644 package/libftdi1/libftdi1.hash create mode 100644 package/libftdi1/libftdi1.mkpackage/Config.in +1
-0@@ -752,6 +752,7 @@ menu "Hardware handling" source "package/libcec/Config.in" source "package/libfreefare/Config.in" source "package/libftdi/Config.in" + source "package/libftdi1/Config.in" source "package/libhid/Config.in" source "package/libiio/Config.in" source "package/libinput/Config.in"package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch new file +96
-0@@ -0,0 +1,96 @@ +From 7e57ff280b55b45e74329b9988279e8831d32eab Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 09:45:04 +0100 +Subject: [PATCH 1/2] cmake: use the standard CMake flag to drive the shared + object build + +Remove the STATICLIBS CMake option (and the code handling it) and let +the standard CMake flags drive the shared object build. + +Signed-off-by: Samuel Martin <[email protected]> +--- + CMakeLists.txt | 2 -- + ftdipp/CMakeLists.txt | 15 +-------------- + src/CMakeLists.txt | 13 +------------ + 3 files changed, 2 insertions(+), 28 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74f80f4..0ba0b08 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,8 +46,6 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development") + set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") + set(CPACK_COMPONENT_HEADERS_GROUP "Development") + +-option ( STATICLIBS "Build static libraries" ON ) +- + # guess LIB_SUFFIX, don't take debian multiarch into account + if ( NOT DEFINED LIB_SUFFIX ) + if( CMAKE_SYSTEM_NAME MATCHES "Linux" +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt +index 7500211..27e7884 100644 +--- a/ftdipp/CMakeLists.txt ++++ b/ftdipp/CMakeLists.txt +@@ -23,8 +23,7 @@ if (FTDIPP) + set(FTDI_BUILD_CPP True PARENT_SCOPE) + message(STATUS "Building libftdi1++") + +- # Shared library +- add_library(ftdipp1 SHARED ${cpp_sources}) ++ add_library(ftdipp1 ${cpp_sources}) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases + set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) +@@ -41,18 +40,6 @@ if (FTDIPP) + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) +- +- # Static library +- if ( STATICLIBS ) +- add_library(ftdipp1-static STATIC ${cpp_sources}) +- set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") +- set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +- +- install ( TARGETS ftdipp1-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} +- COMPONENT staticlibs +- ) +- endif () + + install ( FILES ${cpp_headers} + DESTINATION include/${PROJECT_NAME} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9fd86a6..501d4a8 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,7 +21,7 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h + set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" ) + set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" ) + +-add_library(ftdi1 SHARED ${c_sources}) ++add_library(ftdi1 ${c_sources}) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases + set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) +@@ -38,17 +38,6 @@ install ( TARGETS ftdi1 + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) + +-if ( STATICLIBS ) +- add_library(ftdi1-static STATIC ${c_sources}) +- target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES}) +- set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1") +- set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +- install ( TARGETS ftdi1-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} +- COMPONENT staticlibs +- ) +-endif () +- + install ( FILES ${c_headers} + DESTINATION include/${PROJECT_NAME} + COMPONENT headers +-- +2.2.2 +package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch new file +34
-0@@ -0,0 +1,34 @@ +From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 10:01:17 +0100 +Subject: [PATCH 2/2] cmake: fix FindUSB1.cmake + +Make sure all ldflags are correctly set, especially for static build. + +Signed-off-by: Samuel Martin <[email protected]> +--- + cmake/FindUSB1.cmake | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/cmake/FindUSB1.cmake b/cmake/FindUSB1.cmake +index b90e297..e7f1b3c 100644 +--- a/cmake/FindUSB1.cmake ++++ b/cmake/FindUSB1.cmake +@@ -26,8 +26,12 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + PATH_SUFFIXES libusb-1.0 + PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS}) + +- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 +- PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) ++ set(LIBUSB_LIBRARIES ${PC_LIBUSB_STATIC_LDFLAGS} ${PC_LIBUSB_STATIC_LDFLAGS_OTHER}) ++ foreach(libname ${PC_LIBUSB_STATIC_LIBRARIES}) ++ FIND_LIBRARY(lib NAMES ${libname} ++ PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) ++ list(APPEND LIBUSB_LIBRARIES ${lib}) ++ endforeach() + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR) +-- +2.2.2 +package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch new file +46
-0@@ -0,0 +1,46 @@ +From c215d5ecd985b57700e817920d0e99112b4a571b Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 13:35:24 +0100 +Subject: [PATCH] cmake: do not check for g++ when FTDIPP is disabled + +Signed-off-by: Samuel Martin <[email protected]> +--- + CMakeLists.txt | 6 ++++-- + ftdipp/CMakeLists.txt | 1 + + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0ba0b08..e880211 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ + # Project +-project(libftdi1) ++project(libftdi1 C) + set(MAJOR_VERSION 1) + set(MINOR_VERSION 2) + set(PACKAGE libftdi1) +@@ -145,7 +145,9 @@ else(DOCUMENTATION AND DOXYGEN_FOUND) + endif(DOCUMENTATION AND DOXYGEN_FOUND) + + add_subdirectory(src) +-add_subdirectory(ftdipp) ++if(FTDIPP) ++ add_subdirectory(ftdipp) ++endif() + add_subdirectory(python) + add_subdirectory(ftdi_eeprom) + add_subdirectory(examples) +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt +index 27e7884..2d080f4 100644 +--- a/ftdipp/CMakeLists.txt ++++ b/ftdipp/CMakeLists.txt +@@ -1,4 +1,5 @@ + # Check ++project(libftdipp1 C CXX) + set(FTDI_BUILD_CPP False PARENT_SCOPE) + + option ( FTDIPP "Build C++ binding library libftdi1++" ON ) +-- +2.2.2 +package/libftdi1/Config.in new file +37
-0@@ -0,0 +1,37 @@ +config BR2_PACKAGE_LIBFTDI1 + bool "libftdi1" + depends on BR2_TOOLCHAIN_HAS_THREADS # libusb + select BR2_PACKAGE_LIBUSB + help + Userspace access to FTDI USB interface chips (version 1.x) + + http://www.intra2net.com/en/developer/libftdi/index.php + +if BR2_PACKAGE_LIBFTDI1 + +config BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1 + depends on BR2_INSTALL_LIBSTDCPP # boost + depends on BR2_LARGEFILE # boost + depends on BR2_TOOLCHAIN_HAS_THREADS # boost + select BR2_PACKAGE_BOOST + bool "libfdtipp1" + help + C++ bindings for libftdi + +comment "libfdtipp1 needs a toolchain w/ C++, largefile, threads" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS + +config BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS + depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 + bool "python bindings" + help + Python bindings for libftdi + +config BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM + select BR2_PACKAGE_LIBCONFUSE + bool "ftdi_eeprom tool" + +endif # BR2_PACKAGE_LIBFTDI1 + +comment "libftdi1 needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADSpackage/libftdi1/libftdi1.hash new file +2
-0@@ -0,0 +1,2 @@ +# Locally computed (after checking the signature from http://www.intra2net.com/en/developer/libftdi/download.php) +sha256 a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6 libftdi1-1.2.tar.bz2package/libftdi1/libftdi1.mk new file +27
-0@@ -0,0 +1,37 @@ +################################################################################ +# +# libftdi1 +# +################################################################################ + +LIBFTDI1_VERSION = 1.2 +LIBFTDI1_SOURCE = libftdi1-$(LIBFTDI1_VERSION).tar.bz2 +LIBFTDI1_SITE = http://www.intra2net.com/en/developer/libftdi/download/ +LIBFTDI1_INSTALL_STAGING = YES +LIBFTDI1_DEPENDENCIES = libusb +LIBFTDI1_CONF_OPTS = -DDOCUMENTATION=OFF -DEXAMPLES=OFF + +ifeq ($(BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1),y) +LIBFTDI1_DEPENDENCIES += boost +LIBFTDI1_CONF_OPTS += -DFTDIPP=ON +else +LIBFTDI1_CONF_OPTS += -DFTDIPP=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS),y) +LIBFTDI1_DEPENDENCIES += $(if BR2_PACKAGE_PYTHON,python,python3) host-swig +LIBFTDI1_CONF_OPTS += -DPYTHON_BINDINGS=ON +else +LIBFTDI1_CONF_OPTS += -DPYTHON_BINDINGS=OFF +endif +
package/libftdi1/libftdi1.mk line 37
Quoted 10 lines
package/libftdi1/libftdi1.mk new file +10
-0+ifeq ($(BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM),y) +# ftdi_eeprom optionally depends on libintl, so make sure gettext is built +# _before_ libfitdi1 when gettext is enbaled. +LIBFTDI1_DEPENDENCIES += libconfuse $(if $(BR2_PACKAGE_GETTEXT),gettext) +LIBFTDI1_CONF_OPTS += -DFTDI_EEPROM=ON +else +LIBFTDI1_CONF_OPTS += -DFTDI_EEPROM=OFF +endif + +$(eval $(cmake-package))
I've applied two first patches: libftdi bump and libfdti1 package. During compiling I get following error:
libftdi1-1.2.tar.bz2: OK (sha256:a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6)
Quoted 1 line
Quoted 1 line
Quoted 1 line
libftdi1 1.2 Extracting
bzcat /home/YegorYefremov/MyProjects/versioned/br-latest/dl/libftdi1-1.2.tar.bz2 | tar --strip-components=1 -C /home/YegorYefremov/MyProjects/versioned/br-latest/prod-s1/build/libftdi1-1.2
-xf -
Quoted 1 line
Quoted 1 line
Quoted 1 line
libftdi1 1.2 Patching
Applying 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch using patch:
patching file CMakeLists.txt
Hunk #1 FAILED at 46.
1 out of 1 hunk FAILED -- saving rejects to file CMakeLists.txt.rej patching file ftdipp/CMakeLists.txt
Hunk #2 FAILED at 40.
1 out of 2 hunks FAILED -- saving rejects to file ftdipp/CMakeLists.txt.rej patching file src/CMakeLists.txt
Patch failed! Please fix 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch!
I've made git pull today, so I'm on the newest state.
First reject file:
CMakeLists.txt +0 -2
@@ -46,8 +46,6 @@ set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") set(CPACK_COMPONENT_HEADERS_GROUP "Development") -option ( STATICLIBS "Build static libraries" ON ) - # guess LIB_SUFFIX, don't take debian multiarch into account if ( NOT DEFINED LIB_SUFFIX ) if( CMAKE_SYSTEM_NAME MATCHES "Linux"
Second:
CMakeLists.txt +0 -12
@@ -40,18 +39,6 @@ LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} ) - - # Static library - if ( STATICLIBS ) - add_library(ftdipp1-static STATIC ${cpp_sources}) - set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") - set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) - - install ( TARGETS ftdipp1-static - ARCHIVE DESTINATION lib${LIB_SUFFIX} - COMPONENT staticlibs - ) - endif () install ( FILES ${cpp_headers} DESTINATION include/${PROJECT_NAME}
Am I missing some other patches?
Yegor
PATCH v2 2/4 package/libftdi1: new package
Quoted 414 lines · Yegor Yefremov
Quoted 338 lines · Samuel Martin
From: Daniel Sangue <[email protected]>
This version of libftdi can coexists beside the 0.x version.
Signed-off-by Daniel Sangue <[email protected]>[Samuel Martin:
- libftdi1.mk: bump to version 1.2 and add hash
- cleanup uneeded libusb-compat stuff
- Config.in: add comment when ftdipp1 deps are not met
- fix typos in variable names and legit CMake options for*_CONF_OPTS
- add support for python bindings andftdi_eeprom
- fix static build
- fix build with toolchain w/o C++ support
]Signed-off-by Samuel Martin <[email protected]>---
changev1->v2
- rebase on top of master
- libftdi1.mk: bump to version 1.2
- add hash
- Config.in: cleanup deps for ftdipp1
- Config.in: add comment when ftdipp1 deps are not met
- libftdi1.mk: fix typos inLIBFTDI1_CONF_OPTSvariable name
- libftdi1.mk: use proper CMake options for*_CONF_OPTS
- libftdi1.mk: update libftdi1 deps and conf. opts.
- libftdi1.mk: add support for python bindings andftdi_eeprom
- libftdi1.mk: add patch fixing static build
- libftdi1.mk: add patch fixing FindUSB1.cmake module (for static build)
- libftdi1.mk: add patch correctly disabling ftdipp when the toolchain does not install libstdc++
- reword commit message--- package/Config.in | 1 + ...he-standard-CMake-flag-to-drive-the-share.patch | 96 ++++++++++++++++++++++ .../libftdi1/0002-cmake-fix-FindUSB1.cmake.patch | 34 ++++++++ ...o-not-check-for-g-when-FTDIPP-is-disabled.patch | 46 +++++++++++ package/libftdi1/Config.in | 37 +++++++++ package/libftdi1/libftdi1.hash | 2 + package/libftdi1/libftdi1.mk | 37 +++++++++ 7 files changed, 253 insertions(+) create mode 100644 package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch create mode 100644 package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch create mode 100644 package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch create mode 100644 package/libftdi1/Config.in create mode 100644 package/libftdi1/libftdi1.hash create mode 100644 package/libftdi1/libftdi1.mkpackage/Config.in +1
-0@@ -752,6 +752,7 @@ menu "Hardware handling" source "package/libcec/Config.in" source "package/libfreefare/Config.in" source "package/libftdi/Config.in" + source "package/libftdi1/Config.in" source "package/libhid/Config.in" source "package/libiio/Config.in" source "package/libinput/Config.in"package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch new file +96
-0@@ -0,0 +1,96 @@ +From 7e57ff280b55b45e74329b9988279e8831d32eab Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 09:45:04 +0100 +Subject: [PATCH 1/2] cmake: use the standard CMake flag to drive the shared + object build + +Remove the STATICLIBS CMake option (and the code handling it) and let +the standard CMake flags drive the shared object build. + +Signed-off-by: Samuel Martin <[email protected]> +--- + CMakeLists.txt | 2 -- + ftdipp/CMakeLists.txt | 15 +-------------- + src/CMakeLists.txt | 13 +------------ + 3 files changed, 2 insertions(+), 28 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74f80f4..0ba0b08 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,8 +46,6 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development") + set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") + set(CPACK_COMPONENT_HEADERS_GROUP "Development") + +-option ( STATICLIBS "Build static libraries" ON ) +- + # guess LIB_SUFFIX, don't take debian multiarch into account + if ( NOT DEFINED LIB_SUFFIX ) + if( CMAKE_SYSTEM_NAME MATCHES "Linux" +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt +index 7500211..27e7884 100644 +--- a/ftdipp/CMakeLists.txt ++++ b/ftdipp/CMakeLists.txt +@@ -23,8 +23,7 @@ if (FTDIPP) + set(FTDI_BUILD_CPP True PARENT_SCOPE) + message(STATUS "Building libftdi1++") + +- # Shared library +- add_library(ftdipp1 SHARED ${cpp_sources}) ++ add_library(ftdipp1 ${cpp_sources}) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases + set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) +@@ -41,18 +40,6 @@ if (FTDIPP) + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) +- +- # Static library +- if ( STATICLIBS ) +- add_library(ftdipp1-static STATIC ${cpp_sources}) +- set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") +- set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +- +- install ( TARGETS ftdipp1-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} +- COMPONENT staticlibs +- ) +- endif () + + install ( FILES ${cpp_headers} + DESTINATION include/${PROJECT_NAME} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9fd86a6..501d4a8 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,7 +21,7 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h + set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" ) + set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" ) + +-add_library(ftdi1 SHARED ${c_sources}) ++add_library(ftdi1 ${c_sources}) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases + set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) +@@ -38,17 +38,6 @@ install ( TARGETS ftdi1 + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) + +-if ( STATICLIBS ) +- add_library(ftdi1-static STATIC ${c_sources}) +- target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES}) +- set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1") +- set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +- install ( TARGETS ftdi1-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} +- COMPONENT staticlibs +- ) +-endif () +- + install ( FILES ${c_headers} + DESTINATION include/${PROJECT_NAME} + COMPONENT headers +-- +2.2.2 +package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch new file +34
-0@@ -0,0 +1,34 @@ +From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 10:01:17 +0100 +Subject: [PATCH 2/2] cmake: fix FindUSB1.cmake + +Make sure all ldflags are correctly set, especially for static build. + +Signed-off-by: Samuel Martin <[email protected]> +--- + cmake/FindUSB1.cmake | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/cmake/FindUSB1.cmake b/cmake/FindUSB1.cmake +index b90e297..e7f1b3c 100644 +--- a/cmake/FindUSB1.cmake ++++ b/cmake/FindUSB1.cmake +@@ -26,8 +26,12 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + PATH_SUFFIXES libusb-1.0 + PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS}) + +- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 +- PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) ++ set(LIBUSB_LIBRARIES ${PC_LIBUSB_STATIC_LDFLAGS} ${PC_LIBUSB_STATIC_LDFLAGS_OTHER}) ++ foreach(libname ${PC_LIBUSB_STATIC_LIBRARIES}) ++ FIND_LIBRARY(lib NAMES ${libname} ++ PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) ++ list(APPEND LIBUSB_LIBRARIES ${lib}) ++ endforeach() + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR) +-- +2.2.2 +package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch new file +46
-0@@ -0,0 +1,46 @@ +From c215d5ecd985b57700e817920d0e99112b4a571b Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 13:35:24 +0100 +Subject: [PATCH] cmake: do not check for g++ when FTDIPP is disabled + +Signed-off-by: Samuel Martin <[email protected]> +--- + CMakeLists.txt | 6 ++++-- + ftdipp/CMakeLists.txt | 1 + + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0ba0b08..e880211 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ + # Project +-project(libftdi1) ++project(libftdi1 C) + set(MAJOR_VERSION 1) + set(MINOR_VERSION 2) + set(PACKAGE libftdi1) +@@ -145,7 +145,9 @@ else(DOCUMENTATION AND DOXYGEN_FOUND) + endif(DOCUMENTATION AND DOXYGEN_FOUND) + + add_subdirectory(src) +-add_subdirectory(ftdipp) ++if(FTDIPP) ++ add_subdirectory(ftdipp) ++endif() + add_subdirectory(python) + add_subdirectory(ftdi_eeprom) + add_subdirectory(examples) +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt +index 27e7884..2d080f4 100644 +--- a/ftdipp/CMakeLists.txt ++++ b/ftdipp/CMakeLists.txt +@@ -1,4 +1,5 @@ + # Check ++project(libftdipp1 C CXX) + set(FTDI_BUILD_CPP False PARENT_SCOPE) + + option ( FTDIPP "Build C++ binding library libftdi1++" ON ) +-- +2.2.2 +package/libftdi1/Config.in new file +37
-0@@ -0,0 +1,37 @@ +config BR2_PACKAGE_LIBFTDI1 + bool "libftdi1" + depends on BR2_TOOLCHAIN_HAS_THREADS # libusb + select BR2_PACKAGE_LIBUSB + help + Userspace access to FTDI USB interface chips (version 1.x) + + http://www.intra2net.com/en/developer/libftdi/index.php + +if BR2_PACKAGE_LIBFTDI1 + +config BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1 + depends on BR2_INSTALL_LIBSTDCPP # boost + depends on BR2_LARGEFILE # boost + depends on BR2_TOOLCHAIN_HAS_THREADS # boost + select BR2_PACKAGE_BOOST + bool "libfdtipp1" + help + C++ bindings for libftdi + +comment "libfdtipp1 needs a toolchain w/ C++, largefile, threads" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS + +config BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS + depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 + bool "python bindings" + help + Python bindings for libftdi + +config BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM + select BR2_PACKAGE_LIBCONFUSE + bool "ftdi_eeprom tool" + +endif # BR2_PACKAGE_LIBFTDI1 + +comment "libftdi1 needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADSpackage/libftdi1/libftdi1.hash new file +2
-0@@ -0,0 +1,2 @@ +# Locally computed (after checking the signature from http://www.intra2net.com/en/developer/libftdi/download.php) +sha256 a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6 libftdi1-1.2.tar.bz2package/libftdi1/libftdi1.mk new file +27
-0@@ -0,0 +1,37 @@ +################################################################################ +# +# libftdi1 +# +################################################################################ + +LIBFTDI1_VERSION = 1.2 +LIBFTDI1_SOURCE = libftdi1-$(LIBFTDI1_VERSION).tar.bz2 +LIBFTDI1_SITE = http://www.intra2net.com/en/developer/libftdi/download/ +LIBFTDI1_INSTALL_STAGING = YES +LIBFTDI1_DEPENDENCIES = libusb +LIBFTDI1_CONF_OPTS = -DDOCUMENTATION=OFF -DEXAMPLES=OFF + +ifeq ($(BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1),y) +LIBFTDI1_DEPENDENCIES += boost +LIBFTDI1_CONF_OPTS += -DFTDIPP=ON +else +LIBFTDI1_CONF_OPTS += -DFTDIPP=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS),y) +LIBFTDI1_DEPENDENCIES += $(if BR2_PACKAGE_PYTHON,python,python3) host-swig +LIBFTDI1_CONF_OPTS += -DPYTHON_BINDINGS=ON +else +LIBFTDI1_CONF_OPTS += -DPYTHON_BINDINGS=OFF +endif +package/libftdi1/libftdi1.mk line 37
Quoted 10 lines
package/libftdi1/libftdi1.mk new file +10
-0+ifeq ($(BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM),y) +# ftdi_eeprom optionally depends on libintl, so make sure gettext is built +# _before_ libfitdi1 when gettext is enbaled. +LIBFTDI1_DEPENDENCIES += libconfuse $(if $(BR2_PACKAGE_GETTEXT),gettext) +LIBFTDI1_CONF_OPTS += -DFTDI_EEPROM=ON +else +LIBFTDI1_CONF_OPTS += -DFTDI_EEPROM=OFF +endif + +$(eval $(cmake-package))I've applied two first patches: libftdi bump and libfdti1 package. During compiling I get following error:
libftdi1-1.2.tar.bz2: OK (sha256:
a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6)Quoted 1 line
Quoted 1 line
Quoted 1 line
libftdi1 1.2 Extracting
bzcat
/home/YegorYefremov/MyProjects/versioned/br-latest/dl/libftdi1-1.2.tar.bz2| tar --strip-components=1 -C/home/YegorYefremov/MyProjects/versioned/br-latest/prod-s1/build/libftdi1-1.2
-xf -Quoted 1 line
Quoted 1 line
Quoted 1 line
libftdi1 1.2 Patching
Applying 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch using patch:
patching file CMakeLists.txt
Hunk #1 FAILED at 46.
1 out of 1 hunk FAILED -- saving rejects to file CMakeLists.txt.rej patching fileftdipp/CMakeLists.txt
Hunk #2 FAILED at 40.
1 out of 2 hunks FAILED -- saving rejects to file ftdipp/CMakeLists.txt.rej patching filesrc/CMakeLists.txt
Patch failed! Please fix 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch!I've made git pull today, so I'm on the newest state.
First reject file:
CMakeLists.txt +0
-2@@ -46,8 +46,6 @@ set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") set(CPACK_COMPONENT_HEADERS_GROUP "Development") -option ( STATICLIBS "Build static libraries" ON ) - # guess LIB_SUFFIX, don't take debian multiarch into account if ( NOT DEFINED LIB_SUFFIX ) if( CMAKE_SYSTEM_NAME MATCHES "Linux"Second:
CMakeLists.txt +0
-12@@ -40,18 +39,6 @@ LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} ) - - # Static library - if ( STATICLIBS ) - add_library(ftdipp1-static STATIC ${cpp_sources}) - set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") - set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) - - install ( TARGETS ftdipp1-static - ARCHIVE DESTINATION lib${LIB_SUFFIX} - COMPONENT staticlibs - ) - endif () install ( FILES ${cpp_headers} DESTINATION include/${PROJECT_NAME}
Quoted 1 line
Am I missing some other patches?
When applying the libftdi1 patch via "git am" I get following warnings:
Applying: package/libftdi1: new package /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:74:
trailing whitespace.
/home/user/Documents/versioned/br-test/.git/rebase-apply/patch:77:
trailing whitespace.
# guess LIB_SUFFIX, don't take debian multiarch into account /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:87: trailing whitespace.
/home/user/Documents/versioned/br-test/.git/rebase-apply/patch:91:
trailing whitespace.
/home/user/Documents/versioned/br-test/.git/rebase-apply/patch:98:
trailing whitespace.
-
warning: squelched 14 whitespace errors
warning: 16 lines applied after fixing whitespace errors.
The problem seems to be e-mail version of a patch. I've tried both mbox variant from patchwork and saving the patch from my web gmail. But direct cherry-picking was successful.
Yegor
PATCH v2 2/4 package/libftdi1: new package
Quoted 439 lines · Yegor Yefremov
Quoted 414 lines · Yegor Yefremov
Quoted 338 lines · Samuel Martin
From: Daniel Sangue <[email protected]>
This version of libftdi can coexists beside the 0.x version.
Signed-off-by Daniel Sangue <[email protected]>[Samuel Martin:
- libftdi1.mk: bump to version 1.2 and add hash
- cleanup uneeded libusb-compat stuff
- Config.in: add comment when ftdipp1 deps are not met
- fix typos in variable names and legit CMake options for*_CONF_OPTS
- add support for python bindings andftdi_eeprom
- fix static build
- fix build with toolchain w/o C++ support
]Signed-off-by Samuel Martin <[email protected]>---
changev1->v2
- rebase on top of master
- libftdi1.mk: bump to version 1.2
- add hash
- Config.in: cleanup deps for ftdipp1
- Config.in: add comment when ftdipp1 deps are not met
- libftdi1.mk: fix typos inLIBFTDI1_CONF_OPTSvariable name
- libftdi1.mk: use proper CMake options for*_CONF_OPTS
- libftdi1.mk: update libftdi1 deps and conf. opts.
- libftdi1.mk: add support for python bindings andftdi_eeprom
- libftdi1.mk: add patch fixing static build
- libftdi1.mk: add patch fixing FindUSB1.cmake module (for static build)
- libftdi1.mk: add patch correctly disabling ftdipp when the toolchain does not install libstdc++
- reword commit message--- package/Config.in | 1 + ...he-standard-CMake-flag-to-drive-the-share.patch | 96 ++++++++++++++++++++++ .../libftdi1/0002-cmake-fix-FindUSB1.cmake.patch | 34 ++++++++ ...o-not-check-for-g-when-FTDIPP-is-disabled.patch | 46 +++++++++++ package/libftdi1/Config.in | 37 +++++++++ package/libftdi1/libftdi1.hash | 2 + package/libftdi1/libftdi1.mk | 37 +++++++++ 7 files changed, 253 insertions(+) create mode 100644 package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch create mode 100644 package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch create mode 100644 package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch create mode 100644 package/libftdi1/Config.in create mode 100644 package/libftdi1/libftdi1.hash create mode 100644 package/libftdi1/libftdi1.mkpackage/Config.in +1
-0@@ -752,6 +752,7 @@ menu "Hardware handling" source "package/libcec/Config.in" source "package/libfreefare/Config.in" source "package/libftdi/Config.in" + source "package/libftdi1/Config.in" source "package/libhid/Config.in" source "package/libiio/Config.in" source "package/libinput/Config.in"package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch new file +96
-0@@ -0,0 +1,96 @@ +From 7e57ff280b55b45e74329b9988279e8831d32eab Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 09:45:04 +0100 +Subject: [PATCH 1/2] cmake: use the standard CMake flag to drive the shared + object build + +Remove the STATICLIBS CMake option (and the code handling it) and let +the standard CMake flags drive the shared object build. + +Signed-off-by: Samuel Martin <[email protected]> +--- + CMakeLists.txt | 2 -- + ftdipp/CMakeLists.txt | 15 +-------------- + src/CMakeLists.txt | 13 +------------ + 3 files changed, 2 insertions(+), 28 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74f80f4..0ba0b08 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,8 +46,6 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development") + set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") + set(CPACK_COMPONENT_HEADERS_GROUP "Development") + +-option ( STATICLIBS "Build static libraries" ON ) +- + # guess LIB_SUFFIX, don't take debian multiarch into account + if ( NOT DEFINED LIB_SUFFIX ) + if( CMAKE_SYSTEM_NAME MATCHES "Linux" +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt +index 7500211..27e7884 100644 +--- a/ftdipp/CMakeLists.txt ++++ b/ftdipp/CMakeLists.txt +@@ -23,8 +23,7 @@ if (FTDIPP) + set(FTDI_BUILD_CPP True PARENT_SCOPE) + message(STATUS "Building libftdi1++") + +- # Shared library +- add_library(ftdipp1 SHARED ${cpp_sources}) ++ add_library(ftdipp1 ${cpp_sources}) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases + set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) +@@ -41,18 +40,6 @@ if (FTDIPP) + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) +- +- # Static library +- if ( STATICLIBS ) +- add_library(ftdipp1-static STATIC ${cpp_sources}) +- set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") +- set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +- +- install ( TARGETS ftdipp1-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} +- COMPONENT staticlibs +- ) +- endif () + + install ( FILES ${cpp_headers} + DESTINATION include/${PROJECT_NAME} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9fd86a6..501d4a8 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,7 +21,7 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h + set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" ) + set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" ) + +-add_library(ftdi1 SHARED ${c_sources}) ++add_library(ftdi1 ${c_sources}) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases + set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) +@@ -38,17 +38,6 @@ install ( TARGETS ftdi1 + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) + +-if ( STATICLIBS ) +- add_library(ftdi1-static STATIC ${c_sources}) +- target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES}) +- set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1") +- set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +- install ( TARGETS ftdi1-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} +- COMPONENT staticlibs +- ) +-endif () +- + install ( FILES ${c_headers} + DESTINATION include/${PROJECT_NAME} + COMPONENT headers +-- +2.2.2 +package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch new file +34
-0@@ -0,0 +1,34 @@ +From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 10:01:17 +0100 +Subject: [PATCH 2/2] cmake: fix FindUSB1.cmake + +Make sure all ldflags are correctly set, especially for static build. + +Signed-off-by: Samuel Martin <[email protected]> +--- + cmake/FindUSB1.cmake | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/cmake/FindUSB1.cmake b/cmake/FindUSB1.cmake +index b90e297..e7f1b3c 100644 +--- a/cmake/FindUSB1.cmake ++++ b/cmake/FindUSB1.cmake +@@ -26,8 +26,12 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + PATH_SUFFIXES libusb-1.0 + PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS}) + +- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 +- PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) ++ set(LIBUSB_LIBRARIES ${PC_LIBUSB_STATIC_LDFLAGS} ${PC_LIBUSB_STATIC_LDFLAGS_OTHER}) ++ foreach(libname ${PC_LIBUSB_STATIC_LIBRARIES}) ++ FIND_LIBRARY(lib NAMES ${libname} ++ PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) ++ list(APPEND LIBUSB_LIBRARIES ${lib}) ++ endforeach() + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR) +-- +2.2.2 +package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch new file +46
-0@@ -0,0 +1,46 @@ +From c215d5ecd985b57700e817920d0e99112b4a571b Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 13:35:24 +0100 +Subject: [PATCH] cmake: do not check for g++ when FTDIPP is disabled + +Signed-off-by: Samuel Martin <[email protected]> +--- + CMakeLists.txt | 6 ++++-- + ftdipp/CMakeLists.txt | 1 + + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0ba0b08..e880211 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ + # Project +-project(libftdi1) ++project(libftdi1 C) + set(MAJOR_VERSION 1) + set(MINOR_VERSION 2) + set(PACKAGE libftdi1) +@@ -145,7 +145,9 @@ else(DOCUMENTATION AND DOXYGEN_FOUND) + endif(DOCUMENTATION AND DOXYGEN_FOUND) + + add_subdirectory(src) +-add_subdirectory(ftdipp) ++if(FTDIPP) ++ add_subdirectory(ftdipp) ++endif() + add_subdirectory(python) + add_subdirectory(ftdi_eeprom) + add_subdirectory(examples) +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt +index 27e7884..2d080f4 100644 +--- a/ftdipp/CMakeLists.txt ++++ b/ftdipp/CMakeLists.txt +@@ -1,4 +1,5 @@ + # Check ++project(libftdipp1 C CXX) + set(FTDI_BUILD_CPP False PARENT_SCOPE) + + option ( FTDIPP "Build C++ binding library libftdi1++" ON ) +-- +2.2.2 +package/libftdi1/Config.in new file +37
-0@@ -0,0 +1,37 @@ +config BR2_PACKAGE_LIBFTDI1 + bool "libftdi1" + depends on BR2_TOOLCHAIN_HAS_THREADS # libusb + select BR2_PACKAGE_LIBUSB + help + Userspace access to FTDI USB interface chips (version 1.x) + + http://www.intra2net.com/en/developer/libftdi/index.php + +if BR2_PACKAGE_LIBFTDI1 + +config BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1 + depends on BR2_INSTALL_LIBSTDCPP # boost + depends on BR2_LARGEFILE # boost + depends on BR2_TOOLCHAIN_HAS_THREADS # boost + select BR2_PACKAGE_BOOST + bool "libfdtipp1" + help + C++ bindings for libftdi + +comment "libfdtipp1 needs a toolchain w/ C++, largefile, threads" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS + +config BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS + depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 + bool "python bindings" + help + Python bindings for libftdi + +config BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM + select BR2_PACKAGE_LIBCONFUSE + bool "ftdi_eeprom tool" + +endif # BR2_PACKAGE_LIBFTDI1 + +comment "libftdi1 needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADSpackage/libftdi1/libftdi1.hash new file +2
-0@@ -0,0 +1,2 @@ +# Locally computed (after checking the signature from http://www.intra2net.com/en/developer/libftdi/download.php) +sha256 a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6 libftdi1-1.2.tar.bz2package/libftdi1/libftdi1.mk new file +27
-0@@ -0,0 +1,37 @@ +################################################################################ +# +# libftdi1 +# +################################################################################ + +LIBFTDI1_VERSION = 1.2 +LIBFTDI1_SOURCE = libftdi1-$(LIBFTDI1_VERSION).tar.bz2 +LIBFTDI1_SITE = http://www.intra2net.com/en/developer/libftdi/download/ +LIBFTDI1_INSTALL_STAGING = YES +LIBFTDI1_DEPENDENCIES = libusb +LIBFTDI1_CONF_OPTS = -DDOCUMENTATION=OFF -DEXAMPLES=OFF + +ifeq ($(BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1),y) +LIBFTDI1_DEPENDENCIES += boost +LIBFTDI1_CONF_OPTS += -DFTDIPP=ON +else +LIBFTDI1_CONF_OPTS += -DFTDIPP=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS),y) +LIBFTDI1_DEPENDENCIES += $(if BR2_PACKAGE_PYTHON,python,python3) host-swig +LIBFTDI1_CONF_OPTS += -DPYTHON_BINDINGS=ON +else +LIBFTDI1_CONF_OPTS += -DPYTHON_BINDINGS=OFF +endif +package/libftdi1/libftdi1.mk line 37
Quoted 10 lines
package/libftdi1/libftdi1.mk new file +10
-0+ifeq ($(BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM),y) +# ftdi_eeprom optionally depends on libintl, so make sure gettext is built +# _before_ libfitdi1 when gettext is enbaled. +LIBFTDI1_DEPENDENCIES += libconfuse $(if $(BR2_PACKAGE_GETTEXT),gettext) +LIBFTDI1_CONF_OPTS += -DFTDI_EEPROM=ON +else +LIBFTDI1_CONF_OPTS += -DFTDI_EEPROM=OFF +endif + +$(eval $(cmake-package))I've applied two first patches: libftdi bump and libfdti1 package. During compiling I get following error:
libftdi1-1.2.tar.bz2: OK (sha256:
a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6)Quoted 1 line
Quoted 1 line
Quoted 1 line
libftdi1 1.2 Extracting
bzcat
/home/YegorYefremov/MyProjects/versioned/br-latest/dl/libftdi1-1.2.tar.bz2| tar --strip-components=1 -C/home/YegorYefremov/MyProjects/versioned/br-latest/prod-s1/build/libftdi1-1.2
-xf -Quoted 1 line
Quoted 1 line
Quoted 1 line
libftdi1 1.2 Patching
Applying 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch using patch:
patching file CMakeLists.txt
Hunk #1 FAILED at 46.
1 out of 1 hunk FAILED -- saving rejects to file CMakeLists.txt.rej patching fileftdipp/CMakeLists.txt
Hunk #2 FAILED at 40.
1 out of 2 hunks FAILED -- saving rejects to file ftdipp/CMakeLists.txt.rej patching filesrc/CMakeLists.txt
Patch failed! Please fix 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch!I've made git pull today, so I'm on the newest state.
First reject file:
CMakeLists.txt +0
-2@@ -46,8 +46,6 @@ set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") set(CPACK_COMPONENT_HEADERS_GROUP "Development") -option ( STATICLIBS "Build static libraries" ON ) - # guess LIB_SUFFIX, don't take debian multiarch into account if ( NOT DEFINED LIB_SUFFIX ) if( CMAKE_SYSTEM_NAME MATCHES "Linux"Second:
CMakeLists.txt +0
-12@@ -40,18 +39,6 @@ LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} ) - - # Static library - if ( STATICLIBS ) - add_library(ftdipp1-static STATIC ${cpp_sources}) - set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") - set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) - - install ( TARGETS ftdipp1-static - ARCHIVE DESTINATION lib${LIB_SUFFIX} - COMPONENT staticlibs - ) - endif () install ( FILES ${cpp_headers} DESTINATION include/${PROJECT_NAME}Quoted 1 line
Am I missing some other patches?
When applying the libftdi1 patch via "git am" I get following warnings:
Applying: package/libftdi1: new package
/home/user/Documents/versioned/br-test/.git/rebase-apply/patch:74:
trailing whitespace.
/home/user/Documents/versioned/br-test/.git/rebase-apply/patch:77:
trailing whitespace.# guess LIB_SUFFIX, don't take debian multiarch into account /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:87: trailing whitespace.
/home/user/Documents/versioned/br-test/.git/rebase-apply/patch:91:
trailing whitespace.
/home/user/Documents/versioned/br-test/.git/rebase-apply/patch:98:
trailing whitespace.
-
warning: squelched 14 whitespace errors
warning: 16 lines applied after fixing whitespace errors.
Quoted 3 lines
The problem seems to be e-mail version of a patch. I've tried both mbox variant from patchwork and saving the patch from my web gmail. But direct cherry-picking was successful.
Python wrapper has installation issue:
install step copies both *.so and *.py files to site-packages make step finalizing the rootfs removes ftdi1.py from site-packages
Other than that, "import ftdi1" is successful
Any idea?
Thomas Petazzoni
AppliedPATCH v2 2/4 package/libftdi1: new package
In reply to Samuel MartinDear Samuel Martin,
Quoted 14 lines · Samuel Martin
From: Daniel Sangue <[email protected]>
This version of libftdi can coexists beside the 0.x version.
Signed-off-by Daniel Sangue <[email protected]>[Samuel Martin:
- libftdi1.mk: bump to version 1.2 and add hash
- cleanup uneeded libusb-compat stuff
- Config.in: add comment when ftdipp1 deps are not met
- fix typos in variable names and legit CMake options for*_CONF_OPTS
- add support for python bindings andftdi_eeprom
- fix static build
- fix build with toolchain w/o C++ support
]
Quoted 1 line
Signed-off-by Samuel Martin <[email protected]>
I've applied. But to be honest, I have *way* too many changes to make to patches you send. Please be more careful. See below.
package/libftdi1/Config.in line 17
Quoted 6 lines
package/libftdi1/Config.in new file +6
-0+config BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1 + depends on BR2_INSTALL_LIBSTDCPP # boost + depends on BR2_LARGEFILE # boost + depends on BR2_TOOLCHAIN_HAS_THREADS # boost + select BR2_PACKAGE_BOOST + bool "libfdtipp1"
We usually always have the "bool" property first, then the "selects" then the "depends on".
package/libftdi1/Config.in line 22
Quoted 5 lines
package/libftdi1/Config.in new file +5
-0+ help + C++ bindings for libftdi + +comment "libfdtipp1 needs a toolchain w/ C++, largefile, threads" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS
Comment about thread not needed, since the whole package depends on threads anyway.
package/libftdi1/Config.in line 26
Quoted 4 lines
package/libftdi1/Config.in new file +4
-0+ +config BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS + depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 + bool "python bindings"
Ditto bool vs. depends on ordering.
package/libftdi1/Config.in line 32
Quoted 6 lines
package/libftdi1/Config.in new file +6
-0+ help + Python bindings for libftdi + +config BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM + select BR2_PACKAGE_LIBCONFUSE + bool "ftdi_eeprom tool"
Ditto.
Quoted 7 lines
package/libftdi1/libftdi1.mk new file +1
-0@@ -0,0 +1,37 @@ +################################################################################
package/libftdi1/libftdi1.mk line 11
Quoted 10 lines
package/libftdi1/libftdi1.mk new file +10
-0+# +# libftdi1 +# +################################################################################ + +LIBFTDI1_VERSION = 1.2 +LIBFTDI1_SOURCE = libftdi1-$(LIBFTDI1_VERSION).tar.bz2 +LIBFTDI1_SITE = http://www.intra2net.com/en/developer/libftdi/download/ +LIBFTDI1_INSTALL_STAGING = YES +LIBFTDI1_DEPENDENCIES = libusb
Missing license information.
package/libftdi1/libftdi1.mk line 22
Quoted 11 lines
package/libftdi1/libftdi1.mk new file +11
-0+LIBFTDI1_CONF_OPTS = -DDOCUMENTATION=OFF -DEXAMPLES=OFF + +ifeq ($(BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1),y) +LIBFTDI1_DEPENDENCIES += boost +LIBFTDI1_CONF_OPTS += -DFTDIPP=ON +else +LIBFTDI1_CONF_OPTS += -DFTDIPP=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS),y) +LIBFTDI1_DEPENDENCIES += $(if BR2_PACKAGE_PYTHON,python,python3) host-swig
How on earth can this work ? It should be:
LIBFTDI1_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON),python,python3) host-swig
Committed with these things fixed. However, please make sure to contribute your libftdi1 patches upstream.
I think you should really review your patches more carefully. Having so many issues doesn't really increase the trust we can have in your patches, which means we are less likely to apply them quickly. And I'm not talking about actual testing, I'm really talking about reviewing.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 3/4 package/avrdude: depends on libftdi1 instead of libftdi
In reply to Samuel Martin---
changes v1->v2:
- rebase
--- package/avrdude/avrdude.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
package/avrdude/avrdude.mk +2 -2
@@ -17,8 +17,8 @@ AVRDUDE_DEPENDENCIES = elfutils libusb libusb-compat ncurses \ AVRDUDE_LICENSE = GPLv2+ AVRDUDE_LICENSE_FILES = avrdude/COPYING -ifeq ($(BR2_PACKAGE_LIBFTDI),y) -AVRDUDE_DEPENDENCIES += libftdi +ifeq ($(BR2_PACKAGE_LIBFTDI1),y) +AVRDUDE_DEPENDENCIES += libftdi1 endif # if /etc/avrdude.conf exists, the installation process creates a
Signature · 1 line
2.3.2
PATCH v2 3/4 package/avrdude: depends on libftdi1 instead of libftdi
Hi Samuel,
Quoted 14 lines · Samuel Martin
Signed-off-by Samuel Martin <[email protected]>---
changesv1->v2:
- rebase--- package/avrdude/avrdude.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)package/avrdude/avrdude.mk +0
-0
package/avrdude/avrdude.mk AVRDUDE_DEPENDENCIES = elfutils libusb libusb-compat ncurses \ · line 21
Quoted 7 lines
package/avrdude/avrdude.mk +2
-2@@ -17,8 +17,8 @@ AVRDUDE_DEPENDENCIES = elfutils libusb libusb-compat ncurses \ AVRDUDE_LICENSE = GPLv2+ AVRDUDE_LICENSE_FILES = avrdude/COPYING -ifeq ($(BR2_PACKAGE_LIBFTDI),y) -AVRDUDE_DEPENDENCIES += libftdi +ifeq ($(BR2_PACKAGE_LIBFTDI1),y) +AVRDUDE_DEPENDENCIES += libftdi1
How do you tell avrdude to link with libftdi1 and not libftdi when both are built? The same question goes for openocd.
package/avrdude/avrdude.mk AVRDUDE_DEPENDENCIES = elfutils libusb libusb-compat ncurses \ · line 24
Quoted 3 lines
package/avrdude/avrdude.mk +0
-0endif # if /etc/avrdude.conf exists, the installation process creates a
baruch
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -PATCH v2 3/4 package/avrdude: depends on libftdi1 instead of libftdi
Hi Baruch,
Quoted 20 lines · Baruch Siach
Hi Samuel,
Quoted 17 lines · Samuel Martin
Signed-off-by Samuel Martin <[email protected]>---
changesv1->v2:
- rebase--- package/avrdude/avrdude.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)package/avrdude/avrdude.mk +0
-0@@ -17,8 +17,8 @@ AVRDUDE_DEPENDENCIES = elfutils libusb libusb-compat ncurses \ AVRDUDE_LICENSE = GPLv2+ AVRDUDE_LICENSE_FILES = avrdude/COPYING
Quoted 7 lines
package/avrdude/avrdude.mk AVRDUDE_DEPENDENCIES = elfutils libusb libusb-compat ncurses \ · line 21
Quoted 4 lines
package/avrdude/avrdude.mk +2
-2-ifeq ($(BR2_PACKAGE_LIBFTDI),y) -AVRDUDE_DEPENDENCIES += libftdi +ifeq ($(BR2_PACKAGE_LIBFTDI1),y) +AVRDUDE_DEPENDENCIES += libftdi1How do you tell avrdude to link with libftdi1 and not libftdi when both are built? The same question goes for openocd.
Both avrdude and openocd first check for libftdi1, and use it if any, otherwise check for libftdi.
So, unless I'm missing something this is ok; but that's true I forgot to mention this point in the commit log. :-/
Regards,
Signature · 1 line
Samuel
PATCH v2 3/4 package/avrdude: depends on libftdi1 instead of libftdi
Dear Samuel Martin,
Quoted 7 lines · Samuel Martin
Quoted 2 lines
How do you tell avrdude to link with libftdi1 and not libftdi when both are built? The same question goes for openocd.
Both avrdude and openocd first check for libftdi1, and use it if any, otherwise check for libftdi.
So, unless I'm missing something this is ok; but that's true I forgot to mention this point in the commit log. :-/
So the patch should actually be:
ifeq ($(BR2_PACKAGE_LIBFTDI1),y)AVRDUDE_DEPENDENCIES += libftdi1
else ifeq ($(BR2_PACKAGE_LIBFTDI),y)AVRDUDE_DEPENDENCIES += libftdi
endif
Can you fix and resend?
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 3/4 package/avrdude: depends on libftdi1 instead of libftdi
Hi Thomas,
Quoted 12 lines · Thomas Petazzoni
Dear Samuel Martin,
Quoted 7 lines · Samuel Martin
Quoted 2 lines
How do you tell avrdude to link with libftdi1 and not libftdi when both are built? The same question goes for openocd.
Both avrdude and openocd first check for libftdi1, and use it if any, otherwise check for libftdi.
So, unless I'm missing something this is ok; but that's true I forgot to mention this point in the commit log. :-/
Quoted 7 lines
So the patch should actually be:
ifeq ($(BR2_PACKAGE_LIBFTDI1),y)
AVRDUDE_DEPENDENCIES+= libftdi1
else ifeq ($(BR2_PACKAGE_LIBFTDI),y)AVRDUDE_DEPENDENCIES+= libftdi
endif
Well, my first thought was simply to drop the libftdi support because of the additional dependency it pulls (libusb-compat):
- with dependency on libftdi:
arvdude -> libftdi -> libusb-compat -> libusb
- with dependency on libftdi1:
arvdude -> libftdi1 -> libusb
Note that, the configure script uses libftdi1 (if found) in priority over libftdi.
Quoted 2 lines
Can you fix and resend?
On it.
Quoted 8 lines
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Regards,
Signature · 1 line
Samuel
PATCH v2 3/4 package/avrdude: depends on libftdi1 instead of libftdi
Dear Samuel Martin,
Quoted 9 lines · Samuel Martin
Well, my first thought was simply to drop the libftdi support because of the additional dependency it pulls (libusb-compat):
- with dependency on libftdi:
arvdude -> libftdi -> libusb-compat -> libusb
- with dependency on libftdi1:
arvdude -> libftdi1 -> libusbNote that, the configure script uses libftdi1 (if found) in priority over libftdi.
Yes, but what happens if the user has BR2_PACKAGE_AVRDUDE=y and BR2_PACKAGE_LIBFTDI=y ? Then with your patch, we have an "undefined behavior": if libftdi happens to be built before avrdude, avrdude will have libftdi support, otherwise not.
Unless of course you propose a patch that allows to explicitly enable/disable libftdi support in avrdude. But otherwise, if avrdude *can* use libftdi, then it should have an optional dependency on it.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 3/4 package/avrdude: depends on libftdi1 instead of libftdi
Quoted 14 lines · Thomas Petazzoni
Dear Samuel Martin,
Quoted 9 lines · Samuel Martin
Well, my first thought was simply to drop the libftdi support because of the additional dependency it pulls (libusb-compat):
- with dependency on libftdi:
arvdude -> libftdi -> libusb-compat -> libusb
- with dependency on libftdi1:
arvdude -> libftdi1 -> libusbNote that, the configure script uses libftdi1 (if found) in priority over libftdi.
Quoted 8 lines
Yes, but what happens if the user has BR2_PACKAGE_AVRDUDE=y and BR2_PACKAGE_LIBFTDI=y ? Then with your patch, we have an "undefined behavior": if libftdi happens to be built before avrdude, avrdude will have libftdi support, otherwise not.
Unless of course you propose a patch that allows to explicitly enable/disable libftdi support in avrdude. But otherwise, if avrdude *can* use libftdi, then it should have an optional dependency on it.
Nope, the behavior is not undefined: if libftdi gets built before arvdude, libftdi1 will also be built before avrdude (because it's one of its deps,), so the avrdude configure script will detect both but use libfti1 in priority over libftdi, see the arvdude confi summary:
<snip>
Configuration summary:
----------------------
DO HAVE libelf DO HAVE libusb DO HAVE libusb_1_0 DO HAVE libftdi1 DO HAVE libftdi (but prefer to use libftdi1)
</snip>
Regards,
Signature · 1 line
Samuel
PATCH v2 3/4 package/avrdude: depends on libftdi1 instead of libftdi
Dear Samuel Martin,
Quoted 3 lines · Samuel Martin
Nope, the behavior is not undefined: if libftdi gets built before arvdude, libftdi1 will also be built before avrdude (because it's one of its deps,)
Hum, I don't follow you here. I don't see where libftdi depends on libftdi1.
What prevents from doing a configuration that has libftdi and avrdude enabled, and not libftdi1 ?
Apparently nothing:
$ grep -E "(LIBFTDI|LIBFTDI1|AVRDUDE)" .config BR2_PACKAGE_AVRDUDE=y BR2_PACKAGE_LIBFTDI=y # BR2_PACKAGE_LIBFTDI1 is not set
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 3/4 package/avrdude: depends on libftdi1 instead of libftdi
Thomas,
Quoted 10 lines · Thomas Petazzoni
Dear Samuel Martin,
Quoted 3 lines · Samuel Martin
Nope, the behavior is not undefined: if libftdi gets built before arvdude, libftdi1 will also be built before avrdude (because it's one of its deps,)
Hum, I don't follow you here. I don't see where libftdi depends on libftdi1.
doh! i think we are misunderstanding each others... :-|
Quoted 3 lines
What prevents from doing a configuration that has libftdi and avrdude enabled, and not libftdi1 ?
nothing at all, this still is a legit config.
Quoted 8 lines
Apparently nothing:
$ grep -E "(LIBFTDI|LIBFTDI1|AVRDUDE)" .config BR2_PACKAGE_AVRDUDE=y BR2_PACKAGE_LIBFTDI=y # BR2_PACKAGE_LIBFTDI1 is not set
Quoted 7 lines
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Regards,
Signature · 1 line
Samuel
PATCH v2 4/4 package/openocd: depends on libftdi1 instead of libftdi
In reply to Samuel Martin---
changes v1->v2:
- rebase
--- package/openocd/Config.in | 8 ++++---- package/openocd/openocd.mk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
package/openocd/Config.in +4 -4
@@ -121,7 +121,7 @@ config BR2_PACKAGE_OPENOCD_PARPORT config BR2_PACKAGE_OPENOCD_FT2XXX bool "FT2232 based devices (DEPRECATED)" - select BR2_PACKAGE_LIBFTDI + select BR2_PACKAGE_LIBFTDI1 depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb depends on BR2_ARCH_HAS_ATOMICS help
@@ -135,7 +135,7 @@ config BR2_PACKAGE_OPENOCD_VPI config BR2_PACKAGE_OPENOCD_UBLASTER bool "Altera USB-Blaster" - select BR2_PACKAGE_LIBFTDI + select BR2_PACKAGE_LIBFTDI1 depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb depends on BR2_ARCH_HAS_ATOMICS help
@@ -176,7 +176,7 @@ config BR2_PACKAGE_OPENOCD_GW16012 config BR2_PACKAGE_OPENOCD_PRESTO bool "ASIX Presto Programmer" - select BR2_PACKAGE_LIBFTDI + select BR2_PACKAGE_LIBFTDI1 depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb depends on BR2_ARCH_HAS_ATOMICS help
@@ -185,7 +185,7 @@ config BR2_PACKAGE_OPENOCD_PRESTO config BR2_PACKAGE_OPENOCD_OPENJTAG bool "OpenJTAG Programmer" - select BR2_PACKAGE_LIBFTDI + select BR2_PACKAGE_LIBFTDI1 depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb depends on BR2_ARCH_HAS_ATOMICS help
package/openocd/openocd.mk +1 -1
@@ -23,7 +23,7 @@ OPENOCD_CONF_OPTS = \ # the dependencies they need. OPENOCD_DEPENDENCIES = \ - $(if $(BR2_PACKAGE_LIBFTDI),libftdi) \ + $(if $(BR2_PACKAGE_LIBFTDI),libftdi1) \ $(if $(BR2_PACKAGE_LIBUSB),libusb) \ $(if $(BR2_PACKAGE_LIBUSB_COMPAT),libusb-compat) \ $(if $(BR2_PACKAGE_LIBHID),libhid)
Signature · 1 line
2.3.2
PATCH v2 4/4 package/openocd: depends on libftdi1 instead of libftdi
Dear Samuel Martin,
package/openocd/openocd.mk OPENOCD_CONF_OPTS = \ · line 26
Quoted 3 lines · Samuel Martin
OPENOCD_DEPENDENCIES= \package/openocd/openocd.mk +1
-1- $(if $(BR2_PACKAGE_LIBFTDI),libftdi) \ + $(if $(BR2_PACKAGE_LIBFTDI),libftdi1) \
Again, untested patch. This should be:
$(if $(BR2_PACKAGE_LIBFTDI1),libftdi1) \
Please fix and resend.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com