mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 11:40:06 +02:00
libusb, bump version (#7035)
This commit is contained in:
141
dev-libs/libusb/libusb-1.0.26.recipe
Normal file
141
dev-libs/libusb/libusb-1.0.26.recipe
Normal file
@@ -0,0 +1,141 @@
|
||||
SUMMARY="A library that provides generic access to USB devices"
|
||||
DESCRIPTION="libusb is meant to facilitate the communication with USB hardware.
|
||||
|
||||
- portable: Using a single cross-platform API, it provides access to USB \
|
||||
devices on Linux, Windows, Android, macOS, BSD, Haiku, etc.
|
||||
- user-mode: No special privilege or elevation is required for the \
|
||||
application to communicate with a device.
|
||||
- version-agnostic: All versions of the USB protocol, from 1.0 to 3.1 \
|
||||
(latest), are supported."
|
||||
HOMEPAGE="https://libusb.info/"
|
||||
COPYRIGHT="2001 Johannes Erdfelt
|
||||
2007-2009 Daniel Drake
|
||||
2010-2012 Peter Stuge
|
||||
2008-2016 Nathan Hjelm
|
||||
2009-2013 Pete Batard
|
||||
2009-2013 Ludovic Rousseau
|
||||
2010-2012 Michael Plante
|
||||
2011-2013 Hans de Goede
|
||||
2012-2013 Martin Pieuchot
|
||||
2012-2013 Toby Gray
|
||||
2013-2018 Chris Dickens"
|
||||
LICENSE="GNU LGPL v2.1"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/libusb/libusb/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="a09bff99c74e03e582aa30759cada218ea8fa03580517e52d463c59c0b25e240"
|
||||
SOURCE_FILENAME="libusb-$portVersion.tar.gz"
|
||||
PATCHES="libusb-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
libVersion="0.3.0"
|
||||
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
|
||||
portVers="${portVersion%.*}"
|
||||
|
||||
PROVIDES="
|
||||
libusb$secondaryArchSuffix = $portVersion
|
||||
lib:libusb_$portVers$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libatomic$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
libusb${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libusb_$portVers$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES_devel="
|
||||
libusb$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
PROVIDES_docs="
|
||||
libusb${secondaryArchSuffix}_docs = $portVersion
|
||||
"
|
||||
REQUIRES_docs="
|
||||
libusb$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
PROVIDES_examples="
|
||||
libusb${secondaryArchSuffix}_examples = $portVersion
|
||||
cmd:libusb_example_fxload
|
||||
cmd:libusb_example_listdevs
|
||||
cmd:libusb_example_xusb
|
||||
cmd:libusb_test_libusb
|
||||
cmd:libusb_test_stress
|
||||
"
|
||||
REQUIRES_examples="
|
||||
libusb$secondaryArchSuffix == $portVersion base
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libatomic$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:autoconf
|
||||
cmd:automake
|
||||
cmd:doxygen
|
||||
cmd:find
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:libtoolize$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:sed
|
||||
"
|
||||
|
||||
defineDebugInfoPackage libusb$secondaryArchSuffix \
|
||||
"$libDir"/libusb-$portVers.so.$libVersion
|
||||
|
||||
BUILD()
|
||||
{
|
||||
sh bootstrap.sh
|
||||
runConfigure ./configure
|
||||
# multiple jobs are not reliable
|
||||
make
|
||||
make -C doc docs
|
||||
make -C examples
|
||||
make -C tests
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install
|
||||
rm -f "$libDir"/libusb-$portVers.la
|
||||
|
||||
mkdir -p $prefix/bin $docDir/examples
|
||||
|
||||
cp -r doc/api-1.0 $docDir
|
||||
cp -r examples/*.c $docDir/examples
|
||||
|
||||
install -m 755 tests/.libs/stress $prefix/bin/libusb-test-stress
|
||||
install -m 755 examples/.libs/testlibusb $prefix/bin/libusb-test-libusb
|
||||
for i in fxload listdevs xusb; do
|
||||
install -m 755 examples/.libs/$i \
|
||||
$prefix/bin/libusb-example-$i
|
||||
done
|
||||
|
||||
# set up the develop directory correctly
|
||||
prepareInstalledDevelLib libusb-$portVers
|
||||
fixPkgconfig
|
||||
|
||||
# devel package
|
||||
packageEntries devel \
|
||||
$developDir
|
||||
|
||||
# docs package
|
||||
packageEntries docs \
|
||||
$docDir
|
||||
|
||||
# examples package
|
||||
packageEntries examples \
|
||||
$prefix/bin
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
tests/stress
|
||||
}
|
||||
32
dev-libs/libusb/patches/libusb-1.0.26.patchset
Normal file
32
dev-libs/libusb/patches/libusb-1.0.26.patchset
Normal file
@@ -0,0 +1,32 @@
|
||||
From dfc4ae87b0acb62b1df85c212648b0fd63586d33 Mon Sep 17 00:00:00 2001
|
||||
From: begasus <begasus@gmail.com>
|
||||
Date: Wed, 6 Jul 2022 13:02:42 +0200
|
||||
Subject: Revert upstream commit:
|
||||
https://github.com/libusb/libusb/commit/eed8a371ea53939096ba94d44001e0637d042572
|
||||
|
||||
|
||||
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
|
||||
index b1fc88c..63ed314 100644
|
||||
--- a/libusb/libusbi.h
|
||||
+++ b/libusb/libusbi.h
|
||||
@@ -103,12 +103,11 @@ typedef volatile LONG usbi_atomic_t;
|
||||
#define usbi_atomic_inc(a) InterlockedIncrement((a))
|
||||
#define usbi_atomic_dec(a) InterlockedDecrement((a))
|
||||
#else
|
||||
-#include <stdatomic.h>
|
||||
-typedef atomic_long usbi_atomic_t;
|
||||
-#define usbi_atomic_load(a) atomic_load((a))
|
||||
-#define usbi_atomic_store(a, v) atomic_store((a), (v))
|
||||
-#define usbi_atomic_inc(a) (atomic_fetch_add((a), 1) + 1)
|
||||
-#define usbi_atomic_dec(a) (atomic_fetch_add((a), -1) - 1)
|
||||
+typedef long usbi_atomic_t;
|
||||
+#define usbi_atomic_load(a) __atomic_load_n((a), __ATOMIC_SEQ_CST)
|
||||
+#define usbi_atomic_store(a, v) __atomic_store_n((a), (v), __ATOMIC_SEQ_CST)
|
||||
+#define usbi_atomic_inc(a) __atomic_add_fetch((a), 1, __ATOMIC_SEQ_CST)
|
||||
+#define usbi_atomic_dec(a) __atomic_sub_fetch((a), 1, __ATOMIC_SEQ_CST)
|
||||
#endif
|
||||
|
||||
/* Internal abstractions for event handling and thread synchronization */
|
||||
--
|
||||
2.36.1
|
||||
|
||||
Reference in New Issue
Block a user