mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-12 23:00:10 +02:00
142 lines
3.3 KiB
Bash
142 lines
3.3 KiB
Bash
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="2"
|
|
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 --disable-static
|
|
# 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
|
|
}
|