mirror of
https://github.com/ivabus/pantry
synced 2024-11-22 16:35:07 +03:00
+libusb.info/compat (#5110)
* new file: projects/libusb.info/compat/package.yml * -ludev flag ? * hmm, clang? * hmm * oh... +gcc. working for me * systemd.io contains 'libudev' * more tests
This commit is contained in:
parent
e32e7c22e0
commit
bbaf2cda4e
2 changed files with 66 additions and 0 deletions
43
projects/libusb.info/compat/package.yml
Normal file
43
projects/libusb.info/compat/package.yml
Normal file
|
@ -0,0 +1,43 @@
|
|||
distributable:
|
||||
url: https://downloads.sourceforge.net/project/libusb/libusb-compat-{{version.marketing}}/libusb-compat-{{version}}/libusb-compat-{{version}}.tar.bz2
|
||||
strip-components: 1
|
||||
|
||||
display-name: libusb-compat
|
||||
|
||||
versions:
|
||||
url: https://sourceforge.net/projects/libusb/rss
|
||||
match: /libusb-compat-\d+\.\d+\.\d+\.tar\.bz2/
|
||||
strip:
|
||||
- /^libusb-compat-/
|
||||
- /\.tar\.bz2/
|
||||
|
||||
dependencies:
|
||||
libusb.info: ^1
|
||||
|
||||
build:
|
||||
dependencies:
|
||||
gnu.org/autoconf: '*'
|
||||
gnu.org/automake: '*'
|
||||
gnu.org/libtool: '*'
|
||||
linux/aarch64:
|
||||
# for libudev
|
||||
systemd.io: '*'
|
||||
script:
|
||||
- ./configure $ARGS
|
||||
- make --jobs {{hw.concurrency}} install
|
||||
- run: sed -i 's|{{prefix}}|$(dirname $0)/..|g' libusb-config
|
||||
working-directory: ${{prefix}}/bin
|
||||
env:
|
||||
ARGS:
|
||||
- --disable-debug
|
||||
- --disable-dependency-tracking
|
||||
- --prefix={{prefix}}
|
||||
- --libdir={{prefix}}/lib
|
||||
|
||||
provides:
|
||||
- bin/libusb-config
|
||||
|
||||
test:
|
||||
- libusb-config --libs | grep {{prefix}}
|
||||
- cc test.c -o test -lusb
|
||||
- ./test
|
23
projects/libusb.info/compat/test.c
Normal file
23
projects/libusb.info/compat/test.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
#include <stdio.h>
|
||||
#include <usb.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
struct usb_bus *busses;
|
||||
struct usb_bus *bus;
|
||||
|
||||
usb_init();
|
||||
usb_find_busses();
|
||||
usb_find_devices();
|
||||
|
||||
busses = usb_get_busses();
|
||||
for (bus = busses; bus; bus = bus->next) {
|
||||
struct usb_device *dev;
|
||||
for (dev = bus->devices; dev; dev = dev->next) {
|
||||
printf("%04x:%04x\n",
|
||||
dev->descriptor.idVendor, dev->descriptor.idProduct);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue