From a76d6609b40e245977095e03e736800ae916e27c7b1c5b7e489a951e59f4ae1d Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Mon, 7 Oct 2024 13:00:21 +0000 Subject: [PATCH 1/2] - Update to version 1.5.42+git.de9f01e: * CMake: bump the minimal required version to 3.5 * python: move from distutils to sysconfig * CMake: use ${PC_LIBUSB_LIBRARIES} instead of a library name * CMake: fix multiarch support * CMake: make the project compatible with building as a subproject * ftdipp/CMakeLists.txt: remove VIM modline settings * CMake: rework subdirectory handling * CMake: rework findlibusb module * CMake: report CMake version * CMake: use dedicated recipe for documentation generation OBS-URL: https://build.opensuse.org/package/show/hardware/libftdi1?expand=0&rev=36 --- .gitattributes | 23 ++ .gitignore | 1 + ...race-during-build-of-python-bindings.patch | 34 +++ _service | 17 ++ _servicedata | 4 + libftdi1-1.5.12+git.0684c1b.obscpio | 3 + libftdi1-1.5.42+git.de9f01e.obscpio | 3 + libftdi1.changes | 230 ++++++++++++++++++ libftdi1.obsinfo | 4 + libftdi1.spec | 122 ++++++++++ 10 files changed, 441 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-Fix-race-during-build-of-python-bindings.patch create mode 100644 _service create mode 100644 _servicedata create mode 100644 libftdi1-1.5.12+git.0684c1b.obscpio create mode 100644 libftdi1-1.5.42+git.de9f01e.obscpio create mode 100644 libftdi1.changes create mode 100644 libftdi1.obsinfo create mode 100644 libftdi1.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-Fix-race-during-build-of-python-bindings.patch b/0001-Fix-race-during-build-of-python-bindings.patch new file mode 100644 index 0000000..7dcd965 --- /dev/null +++ b/0001-Fix-race-during-build-of-python-bindings.patch @@ -0,0 +1,34 @@ +From 579f5cb2df5e337df2848f686af3308e45950b81 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Thu, 16 Mar 2023 10:55:18 +0100 +Subject: [PATCH] Fix race during build of python bindings + +The CMake documentation says about add_custom_command that the output must +not be used as dependency in more than one target, but this was the case +here: Both the doc_i target and the SWIG target depended on ftdi1_doc.i. +Make the SWIG target depend on doc_i instead. + +This fixes that ftdi1_doc.i was built twice with parallel builds, leading +to random errors. + +Signed-off-by: Fabian Vogt +--- + python/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt +index 5b6f420..1a8142b 100644 +--- a/python/CMakeLists.txt ++++ b/python/CMakeLists.txt +@@ -25,7 +25,7 @@ link_directories ( ${CMAKE_CURRENT_BINARY_DIR}/../src ) + if ( DOCUMENTATION ) + set(CMAKE_SWIG_FLAGS -DDOXYGEN=${DOXYGEN_FOUND}) + # manually add dependency for new cmake / swig versions +- set_property(SOURCE ftdi1.i PROPERTY DEPENDS ftdi1_doc.i) ++ set_property(SOURCE ftdi1.i PROPERTY DEPENDS doc_i) + endif() + if(NOT CMAKE_VERSION VERSION_LESS 3.8.0) + swig_add_library ( ftdi1 LANGUAGE python SOURCES ftdi1.i ) +-- +2.39.2 + diff --git a/_service b/_service new file mode 100644 index 0000000..815daa3 --- /dev/null +++ b/_service @@ -0,0 +1,17 @@ + + + git://developer.intra2net.com/libftdi + git + enable + libftdi1 + refs/heads/master + @PARENT_TAG@.@TAG_OFFSET@+git.%h + v(.*) + + + + + *.tar + xz + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..d6a42cf --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + git://developer.intra2net.com/libftdi + de9f01ece34d2fe6e842e0250a38f4b16eda2429 \ No newline at end of file diff --git a/libftdi1-1.5.12+git.0684c1b.obscpio b/libftdi1-1.5.12+git.0684c1b.obscpio new file mode 100644 index 0000000..1e0a37d --- /dev/null +++ b/libftdi1-1.5.12+git.0684c1b.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2128536ffe8f5792c662736c40b828c6e48cfcabc844a47c4463cba71dc643b +size 590860 diff --git a/libftdi1-1.5.42+git.de9f01e.obscpio b/libftdi1-1.5.42+git.de9f01e.obscpio new file mode 100644 index 0000000..716cd45 --- /dev/null +++ b/libftdi1-1.5.42+git.de9f01e.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a6b5ef0fd28178aa53d8a1ab4e4e112bc557e0b429b417f1671e6f10afd3412 +size 591372 diff --git a/libftdi1.changes b/libftdi1.changes new file mode 100644 index 0000000..4d24d8e --- /dev/null +++ b/libftdi1.changes @@ -0,0 +1,230 @@ +------------------------------------------------------------------- +Mon May 13 13:19:55 UTC 2024 - trenn@suse.de + +- Update to version 1.5.42+git.de9f01e: + * CMake: bump the minimal required version to 3.5 + * python: move from distutils to sysconfig + * CMake: use ${PC_LIBUSB_LIBRARIES} instead of a library name + * CMake: fix multiarch support + * CMake: make the project compatible with building as a subproject + * ftdipp/CMakeLists.txt: remove VIM modline settings + * CMake: rework subdirectory handling + * CMake: rework findlibusb module + * CMake: report CMake version + * CMake: use dedicated recipe for documentation generation + +------------------------------------------------------------------- +Thu Mar 16 10:02:33 UTC 2023 - Fabian Vogt + +- Add patch to fix random build failures: + * 0001-Fix-race-during-build-of-python-bindings.patch + +------------------------------------------------------------------- +Mon Sep 27 14:01:32 UTC 2021 - Thomas Renninger + +- Update to version 1.5.12+git.0684c1b: + * Don't set EEPROM serial when it's not used. + * Remove legacy EEPROM fields from FT4232H. + * Don't fail reading missing strings. + * Don't spam stderr when flashing FT232H eeprom + * examples/bitbang_cbus.c: Check return value of fgets() + ... +- Integrated mainline: +D Fix-building-unit-tests-without-FTDIPP.patch + +------------------------------------------------------------------- +Fri Jan 15 14:06:47 UTC 2021 - Stefan BrĂ¼ns + +- Update to version 1.5: + * Implement tc[io]flush methods & deprecate broken + purge_buffers methods + * Add program to test buffer flush (purge) functionality + * Add kernel driver auto attach/detach. + See new AUTO_DETACH_REATACH_SIO_MODULE option + * Add ftdi_setflowctrl_xonxoff() + * ftdi_eeprom / eeprom handling: + + Unify handling of all boolean eeprom flags + + Add device release number support + + Add channel_a_driver support for type xxR chips + + Add support for group0 drive levels on x232H chips + + Fix handling of high_current_drive parameter + + Fix inverted handling of VCP driver field for TYPE_R chips + + New --verbose option for eeprom decode operation + * Add example code for async mode + * Add SPDX license identifiers to the core library & + ftdi_eeprom + * Various python SWIG wrapper improvements + * Various cmake file improvements + * Fix small bugs in error code paths +- Drop upstream libftdi-cmake.patch +- Correct License, the library is LGPL-2.1-only (see SPDX headers), + while various other parts are GPL-2.0-only (with and without + linking exceptions). +- Add Fix-building-unit-tests-without-FTDIPP.patch + +------------------------------------------------------------------- +Wed Mar 25 08:53:42 UTC 2020 - Martin Pluskal + +- Cleanup spec file - drop obsolete conditionals and use modern + macros +- Run tests +- Dont build static libraries + +------------------------------------------------------------------- +Tue Jun 12 17:35:10 UTC 2018 - msuchanek@suse.com + +- Fix Leap 42.3 build - do not apply cmake 3.11 compat patch. + +------------------------------------------------------------------- +Fri May 11 14:25:33 UTC 2018 - tchvatal@suse.com + +- Smash libftdi-cmake.patch to make it work with cmake-3.11 + * Not to upstream the changes I did are pretty ugly + +------------------------------------------------------------------- +Sat Apr 7 20:10:15 UTC 2018 - foss@grueninger.de + +- Added patch libftdi-cmake.patch from upstream to make package + compatible with CMake 3.11 + +------------------------------------------------------------------- +Tue Nov 7 13:39:39 UTC 2017 - mpluskal@suse.com + +- Update to version 1.4: + * New ftdi_usb_open_bus_addr() open function + * Use BM/R series baud rate computation for FT230X + * ftdi_get_error_string() now returns const char* + * C++ API: Ability to open devices with empty descriptor strings + * C++ API: Fix enumerations for buffer purge and modem controls + * small build fixes and improvements in the python examples + * ftdi_eeprom / eeprom handling: + + New API function: ftdi_eeprom_get_strings() + + Fix USE_SERIAL handling for 230X type chips + + Make ftdi_read_eeprom_location() endianness independent + + Fix flashing of FT245R +- Build python3 version of bindings on Factory +- Rename python bindings subpackage to match singlespec conventions +- Run spec-cleaner + +------------------------------------------------------------------- +Thu Jul 6 18:17:15 UTC 2017 - mardnh@gmx.de + +- Minor package cleanup + +------------------------------------------------------------------- +Wed Feb 1 12:52:25 UTC 2017 - adam.majer@suse.de + +- use individual libboost-*-devel packages instead of boost-devel + +------------------------------------------------------------------- +Fri May 27 13:56:14 UTC 2016 - p.drouand@gmail.com + +- Update to version 1.3 + * Added ftdi_usb_get_strings2() to prevent automatic device close + * Added ftdi_transfer_data_cancel() for cancellation of a submitted + transfer, avoided resubmittion of a canceled transfer in the callbacks, + replaced calls to libusb_handle_events with + libusb_handle_events_timeout_completed + * ftdi_eeprom / eeprom handling: + + Add support for arbitrary user data + + Add --build-eeprom support + + Fix use_usb_version config file option + + Ability to include other config files in EEPROM config file + + Add external oscillator enable bit + + Support channel configuration + + Added --device option to ftdi_eeprom to specify FTDI device + + Fixed EEPROM user-area space checks for FT232R and FT245R chips + * Various improvements to CBUS handling, including the EEPROM + * swig wrapper: Fix handling of binary strings in ftdi_write_data() + for python 3 + * cbus python example code + * ftdi_stream: fix timeout setting + * Fixed typo in CBUS defines: CBUSG_DRIVE1 -> CBUSH_DRIVE1 +- Build python binding + * Add a libftdi1-binding-python + * Add python-devel, python-xml and swig dependencies +- Add libconfuse-devel build dependency + +------------------------------------------------------------------- +Mon Dec 15 20:18:12 UTC 2014 - mardnh@gmx.de + +- updated to 1.2 + * Support for FT230X devices (Uwe Bonnes) + * ftdi_usb_get_strings(): Don't try to open an already open device (Denis Sirotkin) + * Support for finding devices bricked by the Windows driver (Forest Crossman) + * cmake build system: New LibFTDI1ConfigVersion.cmake file (xantares09) + * Fix a typo in the MPSSE command CLK_BYTES_OR_LOW (Benjamin Vanheuverzwijn) + * Minor fixes for MSVC++ (Andrei Errapart) + * Various small code improvements (Florian Preinstorfer, Jochen Sprickerhof, xantares09) +- updated to 1.1 + * Fix FT232H eeprom suspend pulldown setting (Davide Michelizza) + * Fix FT232H eeprom user area size (Davide Michelizza) + * Improved mingw build (Paul Fertser and Michel Zou) + * C++ wrapper: Get/set functions for USB timeouts (Jochen Sprickerhof) + * Partial support for FT230X (Nathael Pajani) + * New API function: ftdi_eeprom_set_strings() (Nathael Pajani) + * Prevent possible segfault in ftdi_eeprom_decode() (Nathael Pajani) + * Save device release number in eeprom (Jarkko Sonninen) + * Fix "self powered" eeprom flag (Jarkko Sonninen) + * Improved python wrapper (Michel Zou) + * Many buildsystem improvements (Michel Zou and Mike Frysinger) + * See the git history for more changes and fixes +- run spec-cleaner + +------------------------------------------------------------------- +Wed Oct 30 16:19:35 UTC 2013 - rw@suse.de + +- updated to 1.0 + * Ported to libusb 1.x (initial work by Jie Zhang) + * Many eeprom handling improvements (Uwe Bonnes, Anders Larsen) + * Renamed pkconfig, library .so etc. files to "libftdi1" (Intra2net) + * ftdi_eeprom is part of libftdi now (Intra2net) + * New baudrate calculation code + unit tests (Uwe Bonnes and Intra2net) + * Improved python bindings including python3 support (Michel Zou) + * Switched completely to cmake build system (Intra2net) + * cmake: Easy libftdi discovery via find_package() (Michel Zou) + * eeprom handling now done via get()/set() functions (Uwe Bonnes) + * C++ wrapper: Fixed use-after-free in List::find_all() (Intra2net) + * Documentation updates (Xiaofan Chen) + * See the git history for more changes and fixes +- removed buildfixes.diff + +------------------------------------------------------------------- +Wed Jan 2 22:06:35 UTC 2013 - prusnak@opensuse.org + +- updated to 0.20 + * Support for FT232H (Uwe Bonnes) + * Fixed install location of header files (Uwe Bonnes and Intra2net) + * Backported serial_test tool from libftdi 1.x (Uwe Bonnes) +- updated to 0.19 + * Make kernel driver detach configurable (Thomas Klose) + * Correct ftdi_poll_modem_status() result code (Tom Saunders) + * cmake build system improvements (Evgeny Sinelnikov) + * Fix uninitialized memory access in async mode (Intra2net) + * Support for FT232R eeprom features (Hermann Kraus) + * Fix size returned by ftdi_read_data (Hermann Kraus) + * C++ wrapper: Fix infinite recursion in set_bitmode (Intra2net) + * Improvements to the python wrapper (Flynn Marquardt and Chris Zeh) + +------------------------------------------------------------------- +Thu May 3 16:21:44 UTC 2012 - cfarrell@suse.com + +- license update: LGPL-2.1+ and GPL-2.0-with-classpath-exception + Use SPDX format (http://www.spdx.org/licenses) + +------------------------------------------------------------------- +Fri Jan 21 23:08:09 CET 2011 - stepan@coresystems.de + +- Update to 0.18 +- Add COPYING.GPL and LICENSE files, too + +------------------------------------------------------------------- +Mon Dec 21 10:18:44 CET 2009 - stepan@coresystems.de + +- Update to 0.17 + +------------------------------------------------------------------- +Sun Oct 26 14:37:10 CET 2008 - jblunck@suse.de + +- Initial page submission + diff --git a/libftdi1.obsinfo b/libftdi1.obsinfo new file mode 100644 index 0000000..2607c0a --- /dev/null +++ b/libftdi1.obsinfo @@ -0,0 +1,4 @@ +name: libftdi1 +version: 1.5.42+git.de9f01e +mtime: 1703171675 +commit: de9f01ece34d2fe6e842e0250a38f4b16eda2429 diff --git a/libftdi1.spec b/libftdi1.spec new file mode 100644 index 0000000..e3e320a --- /dev/null +++ b/libftdi1.spec @@ -0,0 +1,122 @@ +# +# spec file for package libftdi1 +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define sover -2 +%define libname %{name}%{sover} +Name: libftdi1 +Version: 1.5.42+git.de9f01e +Release: 0 +Summary: Library to program and control the FTDI USB controller +License: LGPL-2.1-only AND GPL-2.0-only AND GPL-2.0-with-classpath-exception +Group: Hardware/Other +URL: https://www.intra2net.com/en/developer/libftdi +Source: libftdi1-%{version}.tar.xz +BuildRequires: cmake >= 2.8 +BuildRequires: doxygen +BuildRequires: gcc-c++ +BuildRequires: libboost_headers-devel +BuildRequires: libboost_test-devel +BuildRequires: pkgconfig +BuildRequires: python3-xml +BuildRequires: swig +BuildRequires: pkgconfig(libconfuse) +BuildRequires: pkgconfig(libusb-1.0) +BuildRequires: pkgconfig(python3) + +%description +Library to program and control the FTDI USB controller. +This library is used by many programs accessing FTDI USB-to-RS232 converters. + +%package -n %{libname} +Summary: Library to program and control the FTDI USB controller +License: LGPL-2.1-only +Group: System/Libraries + +%description -n %{libname} +Library to program and control the FTDI USB controller. +This library is used by many programs accessing FTDI USB-to-RS232 converters. + +%package -n python3-%{name} +Summary: Python 3 binding for libftdi1 +License: LGPL-2.1-only AND GPL-2.0-only AND GPL-2.0-with-classpath-exception +Group: Development/Languages/Python + +%description -n python3-%{name} +Library to program and control the FTDI USB controller. +This library is used by many programs accessing FTDI USB-to-RS232 converters. + +This package provides the python binding for libftdi. + +%package devel +Summary: Header files for libftdi1 +License: LGPL-2.1-only AND GPL-2.0-only AND GPL-2.0-with-classpath-exception +Group: Development/Libraries/C and C++ +Requires: %{libname} = %{version} +Requires: pkgconfig(libusb-1.0) + +%description devel +Header files and static libraries for libftdi. +This library is used by many programs accessing FTDI USB-to-RS232 converters. + +%prep +%autosetup -p1 + +%build +%cmake \ + -DDOCUMENTATION=ON \ + -DFTDI_EEPROM=ON \ + -DPYTHON_BINDINGS=ON \ + -DBUILD_TESTS=ON \ + -DSTATICLIBS=OFF \ + -Wno-dev +%cmake_build + +%install +%cmake_install +rm -rf %{buildroot}%{_datadir} +mkdir -p %{buildroot}%{_mandir}/man3 +install -pm 0644 build/doc/man/man3/[^_]*.3 \ + %{buildroot}%{_mandir}/man3 + +%check +%ctest + +%post -n %{libname} -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig + +%files -n %{libname} +%license COPYING* LICENSE +%doc AUTHORS README +%{_libdir}/libftdi*.so.* + +%files -n python3-%{name} +%doc python/examples/*.py +%{python3_sitearch}/_ftdi1.so +%{python3_sitearch}/ftdi1.py + +%files devel +%doc ftdi_eeprom/example.conf +%{_bindir}/libftdi*-config +%{_bindir}/ftdi_eeprom +%{_includedir}/%{name} +%{_libdir}/libftdi*.so +%{_libdir}/pkgconfig/libftdi*.pc +%{_libdir}/cmake/%{name} +%{_mandir}/man3/*%{ext_man} + +%changelog From 35c49a436a45ac5c080a01e107ad619310dfd3d6dca69304c47960c175a7a78d Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Mon, 14 Oct 2024 14:06:06 +0000 Subject: [PATCH 2/2] D 0001-Fix-race-during-build-of-python-bindings.patch Patch got integrated mainline OBS-URL: https://build.opensuse.org/package/show/hardware/libftdi1?expand=0&rev=37 --- libftdi1.changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libftdi1.changes b/libftdi1.changes index 4d24d8e..a5457f6 100644 --- a/libftdi1.changes +++ b/libftdi1.changes @@ -12,6 +12,8 @@ Mon May 13 13:19:55 UTC 2024 - trenn@suse.de * CMake: rework findlibusb module * CMake: report CMake version * CMake: use dedicated recipe for documentation generation +D 0001-Fix-race-during-build-of-python-bindings.patch +Patch got integrated mainline ------------------------------------------------------------------- Thu Mar 16 10:02:33 UTC 2023 - Fabian Vogt