net-p2p/trezord-go is building properly again
This commit is contained in:
8
acct-user/trezord/metadata.xml
Normal file
8
acct-user/trezord/metadata.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>egger.m@protonmail.com</email>
|
||||
<name>Michael Egger</name>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
||||
12
acct-user/trezord/trezord-0.ebuild
Normal file
12
acct-user/trezord/trezord-0.ebuild
Normal file
@@ -0,0 +1,12 @@
|
||||
# Copyright 1999-2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit acct-user
|
||||
|
||||
DESCRIPTION="User for TREZOR Bridge"
|
||||
ACCT_USER_ID=-1
|
||||
ACCT_USER_GROUPS=( plugdev )
|
||||
|
||||
acct-user_add_deps
|
||||
9
metadata/md5-cache/acct-user/trezord-0
Normal file
9
metadata/md5-cache/acct-user/trezord-0
Normal file
@@ -0,0 +1,9 @@
|
||||
DEFINED_PHASES=install postinst preinst prerm pretend
|
||||
DESCRIPTION=User for TREZOR Bridge
|
||||
EAPI=8
|
||||
INHERIT=acct-user
|
||||
KEYWORDS=~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris
|
||||
RDEPEND=acct-group/plugdev
|
||||
SLOT=0
|
||||
_eclasses_=acct-user 485d9a6aa1311a8ca9da380d8a8c6c76 user-info 9951b1a0e4f026d16c33a001fd2d5cdf
|
||||
_md5_=8eedfbafd4ca454c33c683e7d56c7a55
|
||||
@@ -12,4 +12,4 @@ RESTRICT=mirror test strip
|
||||
SLOT=0
|
||||
SRC_URI=https://github.com/trezor/trezord-go/archive/v2.0.33.tar.gz -> trezord-go-2.0.33.tar.gz mirror://goproxy//github.com/!burnt!sushi/toml/@v/v0.3.1.zip -> github.com%2F!burnt!sushi%2Ftoml%2F@v%2Fv0.3.1.zip mirror://goproxy//github.com/!burnt!sushi/toml/@v/v0.3.1.mod -> github.com%2F!burnt!sushi%2Ftoml%2F@v%2Fv0.3.1.mod mirror://goproxy//github.com/felixge/httpsnoop/@v/v1.0.1.zip -> github.com%2Ffelixge%2Fhttpsnoop%2F@v%2Fv1.0.1.zip mirror://goproxy//github.com/felixge/httpsnoop/@v/v1.0.1.mod -> github.com%2Ffelixge%2Fhttpsnoop%2F@v%2Fv1.0.1.mod mirror://goproxy//github.com/gorilla/csrf/@v/v1.7.0.zip -> github.com%2Fgorilla%2Fcsrf%2F@v%2Fv1.7.0.zip mirror://goproxy//github.com/gorilla/csrf/@v/v1.7.0.mod -> github.com%2Fgorilla%2Fcsrf%2F@v%2Fv1.7.0.mod mirror://goproxy//github.com/gorilla/handlers/@v/v1.5.1.zip -> github.com%2Fgorilla%2Fhandlers%2F@v%2Fv1.5.1.zip mirror://goproxy//github.com/gorilla/handlers/@v/v1.5.1.mod -> github.com%2Fgorilla%2Fhandlers%2F@v%2Fv1.5.1.mod mirror://goproxy//github.com/gorilla/mux/@v/v1.8.0.zip -> github.com%2Fgorilla%2Fmux%2F@v%2Fv1.8.0.zip mirror://goproxy//github.com/gorilla/mux/@v/v1.8.0.mod -> github.com%2Fgorilla%2Fmux%2F@v%2Fv1.8.0.mod mirror://goproxy//github.com/gorilla/securecookie/@v/v1.1.1.zip -> github.com%2Fgorilla%2Fsecurecookie%2F@v%2Fv1.1.1.zip mirror://goproxy//github.com/gorilla/securecookie/@v/v1.1.1.mod -> github.com%2Fgorilla%2Fsecurecookie%2F@v%2Fv1.1.1.mod mirror://goproxy//github.com/pkg/errors/@v/v0.9.1.zip -> github.com%2Fpkg%2Ferrors%2F@v%2Fv0.9.1.zip mirror://goproxy//github.com/pkg/errors/@v/v0.9.1.mod -> github.com%2Fpkg%2Ferrors%2F@v%2Fv0.9.1.mod mirror://goproxy//gopkg.in/check.v1/@v/v0.0.0-20161208181325-20d25e280405.zip -> gopkg.in%2Fcheck.v1%2F@v%2Fv0.0.0-20161208181325-20d25e280405.zip mirror://goproxy//gopkg.in/check.v1/@v/v0.0.0-20161208181325-20d25e280405.mod -> gopkg.in%2Fcheck.v1%2F@v%2Fv0.0.0-20161208181325-20d25e280405.mod mirror://goproxy//gopkg.in/natefinch/lumberjack.v2/@v/v2.0.0.zip -> gopkg.in%2Fnatefinch%2Flumberjack.v2%2F@v%2Fv2.0.0.zip mirror://goproxy//gopkg.in/natefinch/lumberjack.v2/@v/v2.0.0.mod -> gopkg.in%2Fnatefinch%2Flumberjack.v2%2F@v%2Fv2.0.0.mod mirror://goproxy//gopkg.in/yaml.v2/@v/v2.4.0.zip -> gopkg.in%2Fyaml.v2%2F@v%2Fv2.4.0.zip mirror://goproxy//gopkg.in/yaml.v2/@v/v2.4.0.mod -> gopkg.in%2Fyaml.v2%2F@v%2Fv2.4.0.mod
|
||||
_eclasses_=go-env 96e1747610bbb2f5c5d3fb16f0f3a83a go-module 9e5a8f7b134fd3ed3785755097fe8ef0 multilib c19072c3cd7ac5cb21de013f7e9832e0 multiprocessing 30ead54fa2e2b5f9cd4e612ffc34d0fe systemd c8b03e8df84486aa991d4396686e8942 toolchain-funcs e56c7649b804f051623c8bc1a1c44084 udev eec0bbab06977f1cfc5597269c1fa152
|
||||
_md5_=ed37f6a5f1cffe940f0aba5e46802b4a
|
||||
_md5_=8f920d74cd9c4f3ffdf1fc124e039d41
|
||||
393
net-p2p/trezord-go/files/trezord-go-2.0.33-usblib.patch
Normal file
393
net-p2p/trezord-go/files/trezord-go-2.0.33-usblib.patch
Normal file
@@ -0,0 +1,393 @@
|
||||
From 318b01237604256b1a561b2fa57826aa0ebb218d Mon Sep 17 00:00:00 2001
|
||||
From: Pisit Wajanasara <compisit1234@gmail.com>
|
||||
Date: Wed, 3 Jan 2024 15:33:49 -0800
|
||||
Subject: [PATCH] Fix libusb for newer golang version
|
||||
|
||||
---
|
||||
usb/lowlevel/libusb/libusb.go | 121 ++++++++++++++++++++++------------
|
||||
1 file changed, 80 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/usb/lowlevel/libusb/libusb.go b/usb/lowlevel/libusb/libusb.go
|
||||
index abc289e..001a4d6 100644
|
||||
--- a/usb/lowlevel/libusb/libusb.go
|
||||
+++ b/usb/lowlevel/libusb/libusb.go
|
||||
@@ -389,8 +389,11 @@ const HOTPLUG_MATCH_ANY = C.LIBUSB_HOTPLUG_MATCH_ANY
|
||||
// A structure representing the standard USB endpoint descriptor.
|
||||
// This descriptor is documented in section 9.6.6 of the USB 3.0 specification.
|
||||
// All multiple-byte fields are represented in host-endian format.
|
||||
+
|
||||
+type Struct_Libusb_Endpoint_Descriptor = C.struct_libusb_endpoint_descriptor
|
||||
+
|
||||
type Endpoint_Descriptor struct {
|
||||
- ptr *C.struct_libusb_endpoint_descriptor
|
||||
+ ptr *Struct_Libusb_Endpoint_Descriptor
|
||||
BLength uint8
|
||||
BDescriptorType uint8
|
||||
BEndpointAddress uint8
|
||||
@@ -402,7 +405,7 @@ type Endpoint_Descriptor struct {
|
||||
Extra []byte
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_endpoint_descriptor) c2go() *Endpoint_Descriptor {
|
||||
+func (x *Struct_Libusb_Endpoint_Descriptor) c2go() *Endpoint_Descriptor {
|
||||
return &Endpoint_Descriptor{
|
||||
ptr: x,
|
||||
BLength: uint8(x.bLength),
|
||||
@@ -437,8 +440,11 @@ func (x *Endpoint_Descriptor) String() string {
|
||||
// A structure representing the standard USB interface descriptor.
|
||||
// This descriptor is documented in section 9.6.5 of the USB 3.0 specification.
|
||||
// All multiple-byte fields are represented in host-endian format.
|
||||
+
|
||||
+type Struct_Libusb_Interface_Descriptor = C.struct_libusb_interface_descriptor
|
||||
+
|
||||
type Interface_Descriptor struct {
|
||||
- ptr *C.struct_libusb_interface_descriptor
|
||||
+ ptr *Struct_Libusb_Interface_Descriptor
|
||||
BLength uint8
|
||||
BDescriptorType uint8
|
||||
BInterfaceNumber uint8
|
||||
@@ -452,8 +458,8 @@ type Interface_Descriptor struct {
|
||||
Extra []byte
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_interface_descriptor) c2go() *Interface_Descriptor {
|
||||
- var list []C.struct_libusb_endpoint_descriptor
|
||||
+func (x *Struct_Libusb_Interface_Descriptor) c2go() *Interface_Descriptor {
|
||||
+ var list []Struct_Libusb_Endpoint_Descriptor
|
||||
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&list))
|
||||
hdr.Cap = int(x.bNumEndpoints)
|
||||
hdr.Len = int(x.bNumEndpoints)
|
||||
@@ -501,14 +507,17 @@ func (x *Interface_Descriptor) String() string {
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// A collection of alternate settings for a particular USB interface.
|
||||
+
|
||||
+type Struct_Libusb_Interface = C.struct_libusb_interface
|
||||
+
|
||||
type Interface struct {
|
||||
- ptr *C.struct_libusb_interface
|
||||
+ ptr *Struct_Libusb_Interface
|
||||
Num_altsetting int
|
||||
Altsetting []*Interface_Descriptor
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_interface) c2go() *Interface {
|
||||
- var list []C.struct_libusb_interface_descriptor
|
||||
+func (x *Struct_Libusb_Interface) c2go() *Interface {
|
||||
+ var list []Struct_Libusb_Interface_Descriptor
|
||||
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&list))
|
||||
hdr.Cap = int(x.num_altsetting)
|
||||
hdr.Len = int(x.num_altsetting)
|
||||
@@ -540,8 +549,11 @@ func Interface_str(x *Interface) string {
|
||||
// A structure representing the standard USB configuration descriptor.
|
||||
// This descriptor is documented in section 9.6.3 of the USB 3.0 specification.
|
||||
// All multiple-byte fields are represented in host-endian format.
|
||||
+
|
||||
+type Struct_Libusb_Config_Descriptor = C.struct_libusb_config_descriptor
|
||||
+
|
||||
type Config_Descriptor struct {
|
||||
- ptr *C.struct_libusb_config_descriptor
|
||||
+ ptr *Struct_Libusb_Config_Descriptor
|
||||
BLength uint8
|
||||
BDescriptorType uint8
|
||||
WTotalLength uint16
|
||||
@@ -554,8 +566,8 @@ type Config_Descriptor struct {
|
||||
Extra []byte
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_config_descriptor) c2go() *Config_Descriptor {
|
||||
- var list []C.struct_libusb_interface
|
||||
+func (x *Struct_Libusb_Config_Descriptor) c2go() *Config_Descriptor {
|
||||
+ var list []Struct_Libusb_Interface
|
||||
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&list))
|
||||
hdr.Cap = int(x.bNumInterfaces)
|
||||
hdr.Len = int(x.bNumInterfaces)
|
||||
@@ -603,8 +615,11 @@ func (x *Config_Descriptor) String() string {
|
||||
// A structure representing the superspeed endpoint companion descriptor.
|
||||
// This descriptor is documented in section 9.6.7 of the USB 3.0 specification.
|
||||
// All multiple-byte fields are represented in host-endian format.
|
||||
+
|
||||
+type Struct_Libusb_SS_Endpoint_Companion_Descriptor = C.struct_libusb_ss_endpoint_companion_descriptor
|
||||
+
|
||||
type SS_Endpoint_Companion_Descriptor struct {
|
||||
- ptr *C.struct_libusb_ss_endpoint_companion_descriptor
|
||||
+ ptr *Struct_Libusb_SS_Endpoint_Companion_Descriptor
|
||||
BLength uint8
|
||||
BDescriptorType uint8
|
||||
BMaxBurst uint8
|
||||
@@ -612,7 +627,7 @@ type SS_Endpoint_Companion_Descriptor struct {
|
||||
WBytesPerInterval uint16
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_ss_endpoint_companion_descriptor) c2go() *SS_Endpoint_Companion_Descriptor {
|
||||
+func (x *Struct_Libusb_SS_Endpoint_Companion_Descriptor) c2go() *SS_Endpoint_Companion_Descriptor {
|
||||
return &SS_Endpoint_Companion_Descriptor{
|
||||
ptr: x,
|
||||
BLength: uint8(x.bLength),
|
||||
@@ -628,15 +643,18 @@ func (x *C.struct_libusb_ss_endpoint_companion_descriptor) c2go() *SS_Endpoint_C
|
||||
// A generic representation of a BOS Device Capability descriptor.
|
||||
// It is advised to check BDevCapabilityType and call the matching
|
||||
// Get_*_Descriptor function to get a structure fully matching the type.
|
||||
+
|
||||
+type Struct_Libusb_BOS_Dev_Capability_Descriptor = C.struct_libusb_bos_dev_capability_descriptor
|
||||
+
|
||||
type BOS_Dev_Capability_Descriptor struct {
|
||||
- ptr *C.struct_libusb_bos_dev_capability_descriptor
|
||||
+ ptr *Struct_Libusb_BOS_Dev_Capability_Descriptor
|
||||
BLength uint8
|
||||
BDescriptorType uint8
|
||||
BDevCapabilityType uint8
|
||||
Dev_capability_data []byte
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_bos_dev_capability_descriptor) c2go() *BOS_Dev_Capability_Descriptor {
|
||||
+func (x *Struct_Libusb_BOS_Dev_Capability_Descriptor) c2go() *BOS_Dev_Capability_Descriptor {
|
||||
return &BOS_Dev_Capability_Descriptor{
|
||||
ptr: x,
|
||||
BLength: uint8(x.bLength),
|
||||
@@ -651,16 +669,19 @@ func (x *C.struct_libusb_bos_dev_capability_descriptor) c2go() *BOS_Dev_Capabili
|
||||
// A structure representing the Binary Device Object Store (BOS) descriptor.
|
||||
// This descriptor is documented in section 9.6.2 of the USB 3.0 specification.
|
||||
// All multiple-byte fields are represented in host-endian format.
|
||||
+
|
||||
+type Struct_Libusb_BOS_Descriptor = C.struct_libusb_bos_descriptor
|
||||
+
|
||||
type BOS_Descriptor struct {
|
||||
- ptr *C.struct_libusb_bos_descriptor
|
||||
+ ptr *Struct_Libusb_BOS_Descriptor
|
||||
BLength uint8
|
||||
BDescriptorType uint8
|
||||
WTotalLength uint16
|
||||
Dev_capability []*BOS_Dev_Capability_Descriptor
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_bos_descriptor) c2go() *BOS_Descriptor {
|
||||
- var list []*C.struct_libusb_bos_dev_capability_descriptor
|
||||
+func (x *Struct_Libusb_BOS_Descriptor) c2go() *BOS_Descriptor {
|
||||
+ var list []*Struct_Libusb_BOS_Dev_Capability_Descriptor
|
||||
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&list))
|
||||
hdr.Cap = int(x.bNumDeviceCaps)
|
||||
hdr.Len = int(x.bNumDeviceCaps)
|
||||
@@ -683,15 +704,18 @@ func (x *C.struct_libusb_bos_descriptor) c2go() *BOS_Descriptor {
|
||||
// A structure representing the USB 2.0 Extension descriptor
|
||||
// This descriptor is documented in section 9.6.2.1 of the USB 3.0 specification.
|
||||
// All multiple-byte fields are represented in host-endian format.
|
||||
+
|
||||
+type Struct_Libusb_USB_2_0_Extension_Descriptor = C.struct_libusb_usb_2_0_extension_descriptor
|
||||
+
|
||||
type USB_2_0_Extension_Descriptor struct {
|
||||
- ptr *C.struct_libusb_usb_2_0_extension_descriptor
|
||||
+ ptr *Struct_Libusb_USB_2_0_Extension_Descriptor
|
||||
BLength uint8
|
||||
BDescriptorType uint8
|
||||
BDevCapabilityType uint8
|
||||
BmAttributes uint32
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_usb_2_0_extension_descriptor) c2go() *USB_2_0_Extension_Descriptor {
|
||||
+func (x *Struct_Libusb_USB_2_0_Extension_Descriptor) c2go() *USB_2_0_Extension_Descriptor {
|
||||
return &USB_2_0_Extension_Descriptor{
|
||||
ptr: x,
|
||||
BLength: uint8(x.bLength),
|
||||
@@ -706,8 +730,11 @@ func (x *C.struct_libusb_usb_2_0_extension_descriptor) c2go() *USB_2_0_Extension
|
||||
// A structure representing the SuperSpeed USB Device Capability descriptor
|
||||
// This descriptor is documented in section 9.6.2.2 of the USB 3.0 specification.
|
||||
// All multiple-byte fields are represented in host-endian format.
|
||||
+
|
||||
+type Struct_Libusb_SS_USB_Device_Capability_Descriptor = C.struct_libusb_ss_usb_device_capability_descriptor
|
||||
+
|
||||
type SS_USB_Device_Capability_Descriptor struct {
|
||||
- ptr *C.struct_libusb_ss_usb_device_capability_descriptor
|
||||
+ ptr *Struct_Libusb_SS_USB_Device_Capability_Descriptor
|
||||
BLength uint8
|
||||
BDescriptorType uint8
|
||||
BDevCapabilityType uint8
|
||||
@@ -718,7 +745,7 @@ type SS_USB_Device_Capability_Descriptor struct {
|
||||
BU2DevExitLat uint16
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_ss_usb_device_capability_descriptor) c2go() *SS_USB_Device_Capability_Descriptor {
|
||||
+func (x *Struct_Libusb_SS_USB_Device_Capability_Descriptor) c2go() *SS_USB_Device_Capability_Descriptor {
|
||||
return &SS_USB_Device_Capability_Descriptor{
|
||||
ptr: x,
|
||||
BLength: uint8(x.bLength),
|
||||
@@ -737,8 +764,11 @@ func (x *C.struct_libusb_ss_usb_device_capability_descriptor) c2go() *SS_USB_Dev
|
||||
// A structure representing the Container ID descriptor.
|
||||
// This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification.
|
||||
// All multiple-byte fields, except UUIDs, are represented in host-endian format.
|
||||
+
|
||||
+type Struct_Libusb_Container_ID_Descriptor = C.struct_libusb_container_id_descriptor
|
||||
+
|
||||
type Container_ID_Descriptor struct {
|
||||
- ptr *C.struct_libusb_container_id_descriptor
|
||||
+ ptr *Struct_Libusb_Container_ID_Descriptor
|
||||
BLength uint8
|
||||
BDescriptorType uint8
|
||||
BDevCapabilityType uint8
|
||||
@@ -746,7 +776,7 @@ type Container_ID_Descriptor struct {
|
||||
ContainerID []byte
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_container_id_descriptor) c2go() *Container_ID_Descriptor {
|
||||
+func (x *Struct_Libusb_Container_ID_Descriptor) c2go() *Container_ID_Descriptor {
|
||||
return &Container_ID_Descriptor{
|
||||
ptr: x,
|
||||
BLength: uint8(x.bLength),
|
||||
@@ -775,8 +805,11 @@ struct libusb_control_setup {
|
||||
// A structure representing the standard USB device descriptor.
|
||||
// This descriptor is documented in section 9.6.1 of the USB 3.0 specification.
|
||||
// All multiple-byte fields are represented in host-endian format.
|
||||
+
|
||||
+type Struct_Libusb_Device_Descriptor = C.struct_libusb_device_descriptor
|
||||
+
|
||||
type Device_Descriptor struct {
|
||||
- ptr *C.struct_libusb_device_descriptor
|
||||
+ ptr *Struct_Libusb_Device_Descriptor
|
||||
BLength uint8
|
||||
BDescriptorType uint8
|
||||
BcdUSB uint16
|
||||
@@ -793,7 +826,7 @@ type Device_Descriptor struct {
|
||||
BNumConfigurations uint8
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_device_descriptor) c2go() *Device_Descriptor {
|
||||
+func (x *Struct_Libusb_Device_Descriptor) c2go() *Device_Descriptor {
|
||||
return &Device_Descriptor{
|
||||
ptr: x,
|
||||
BLength: uint8(x.bLength),
|
||||
@@ -859,17 +892,20 @@ struct libusb_transfer {
|
||||
// then submits it in order to request a transfer. After the transfer has
|
||||
// completed, the library populates the transfer with the results and passes
|
||||
// it back to the user.
|
||||
+
|
||||
+type Struct_Libusb_Transfer = C.struct_libusb_transfer
|
||||
+
|
||||
type Transfer struct {
|
||||
- ptr *C.struct_libusb_transfer
|
||||
+ ptr *Struct_Libusb_Transfer
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_transfer) c2go() *Transfer {
|
||||
+func (x *Struct_Libusb_Transfer) c2go() *Transfer {
|
||||
return &Transfer{
|
||||
ptr: x,
|
||||
}
|
||||
}
|
||||
|
||||
-func (x *Transfer) go2c() *C.struct_libusb_transfer {
|
||||
+func (x *Transfer) go2c() *Struct_Libusb_Transfer {
|
||||
return x.ptr
|
||||
}
|
||||
|
||||
@@ -882,8 +918,11 @@ func (x *Transfer) String() string {
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Structure providing the version of the libusb runtime.
|
||||
+
|
||||
+type Struct_Libusb_Version = C.struct_libusb_version
|
||||
+
|
||||
type Version struct {
|
||||
- ptr *C.struct_libusb_version
|
||||
+ ptr *Struct_Libusb_Version
|
||||
Major uint16
|
||||
Minor uint16
|
||||
Micro uint16
|
||||
@@ -892,7 +931,7 @@ type Version struct {
|
||||
Describe string
|
||||
}
|
||||
|
||||
-func (x *C.struct_libusb_version) c2go() *Version {
|
||||
+func (x *Struct_Libusb_Version) c2go() *Version {
|
||||
return &Version{
|
||||
ptr: x,
|
||||
Major: uint16(x.major),
|
||||
@@ -1146,7 +1185,7 @@ func Error_Name(code int) string {
|
||||
}
|
||||
|
||||
func Get_Version() *Version {
|
||||
- ver := (*C.struct_libusb_version)(unsafe.Pointer(C.libusb_get_version()))
|
||||
+ ver := (*Struct_Libusb_Version)(unsafe.Pointer(C.libusb_get_version()))
|
||||
return ver.c2go()
|
||||
}
|
||||
|
||||
@@ -1173,7 +1212,7 @@ func Strerror(errcode int) string {
|
||||
// USB descriptors
|
||||
|
||||
func Get_Device_Descriptor(dev Device) (*Device_Descriptor, error) {
|
||||
- var desc C.struct_libusb_device_descriptor
|
||||
+ var desc Struct_Libusb_Device_Descriptor
|
||||
rc := int(C.libusb_get_device_descriptor(dev, &desc))
|
||||
if rc != 0 {
|
||||
return nil, &libusb_error{rc}
|
||||
@@ -1182,7 +1221,7 @@ func Get_Device_Descriptor(dev Device) (*Device_Descriptor, error) {
|
||||
}
|
||||
|
||||
func Get_Active_Config_Descriptor(dev Device) (*Config_Descriptor, error) {
|
||||
- var desc *C.struct_libusb_config_descriptor
|
||||
+ var desc *Struct_Libusb_Config_Descriptor
|
||||
rc := int(C.libusb_get_active_config_descriptor(dev, &desc))
|
||||
if rc != 0 {
|
||||
return nil, &libusb_error{rc}
|
||||
@@ -1191,7 +1230,7 @@ func Get_Active_Config_Descriptor(dev Device) (*Config_Descriptor, error) {
|
||||
}
|
||||
|
||||
func Get_Config_Descriptor(dev Device, config_index uint8) (*Config_Descriptor, error) {
|
||||
- var desc *C.struct_libusb_config_descriptor
|
||||
+ var desc *Struct_Libusb_Config_Descriptor
|
||||
rc := int(C.libusb_get_config_descriptor(dev, (C.uint8_t)(config_index), &desc))
|
||||
if rc != 0 {
|
||||
return nil, &libusb_error{rc}
|
||||
@@ -1200,7 +1239,7 @@ func Get_Config_Descriptor(dev Device, config_index uint8) (*Config_Descriptor,
|
||||
}
|
||||
|
||||
func Get_Config_Descriptor_By_Value(dev Device, bConfigurationValue uint8) (*Config_Descriptor, error) {
|
||||
- var desc *C.struct_libusb_config_descriptor
|
||||
+ var desc *Struct_Libusb_Config_Descriptor
|
||||
rc := int(C.libusb_get_config_descriptor_by_value(dev, (C.uint8_t)(bConfigurationValue), &desc))
|
||||
if rc != 0 {
|
||||
return nil, &libusb_error{rc}
|
||||
@@ -1213,7 +1252,7 @@ func Free_Config_Descriptor(config *Config_Descriptor) {
|
||||
}
|
||||
|
||||
func Get_SS_Endpoint_Companion_Descriptor(ctx Context, endpoint *Endpoint_Descriptor) (*SS_Endpoint_Companion_Descriptor, error) {
|
||||
- var desc *C.struct_libusb_ss_endpoint_companion_descriptor
|
||||
+ var desc *Struct_Libusb_SS_Endpoint_Companion_Descriptor
|
||||
rc := int(C.libusb_get_ss_endpoint_companion_descriptor(ctx, endpoint.ptr, &desc))
|
||||
if rc != 0 {
|
||||
return nil, &libusb_error{rc}
|
||||
@@ -1226,7 +1265,7 @@ func Free_SS_Endpoint_Companion_Descriptor(ep_comp *SS_Endpoint_Companion_Descri
|
||||
}
|
||||
|
||||
func Get_BOS_Descriptor(hdl Device_Handle) (*BOS_Descriptor, error) {
|
||||
- var desc *C.struct_libusb_bos_descriptor
|
||||
+ var desc *Struct_Libusb_BOS_Descriptor
|
||||
rc := int(C.libusb_get_bos_descriptor(hdl, &desc))
|
||||
if rc != 0 {
|
||||
return nil, &libusb_error{rc}
|
||||
@@ -1239,7 +1278,7 @@ func Free_BOS_Descriptor(bos *BOS_Descriptor) {
|
||||
}
|
||||
|
||||
func Get_USB_2_0_Extension_Descriptor(ctx Context, dev_cap *BOS_Dev_Capability_Descriptor) (*USB_2_0_Extension_Descriptor, error) {
|
||||
- var desc *C.struct_libusb_usb_2_0_extension_descriptor
|
||||
+ var desc *Struct_Libusb_USB_2_0_Extension_Descriptor
|
||||
rc := int(C.libusb_get_usb_2_0_extension_descriptor(ctx, dev_cap.ptr, &desc))
|
||||
if rc != 0 {
|
||||
return nil, &libusb_error{rc}
|
||||
@@ -1252,7 +1291,7 @@ func Free_USB_2_0_Extension_Descriptor(usb_2_0_extension *USB_2_0_Extension_Desc
|
||||
}
|
||||
|
||||
func Get_SS_USB_Device_Capability_Descriptor(ctx Context, dev_cap *BOS_Dev_Capability_Descriptor) (*SS_USB_Device_Capability_Descriptor, error) {
|
||||
- var desc *C.struct_libusb_ss_usb_device_capability_descriptor
|
||||
+ var desc *Struct_Libusb_SS_USB_Device_Capability_Descriptor
|
||||
rc := int(C.libusb_get_ss_usb_device_capability_descriptor(ctx, dev_cap.ptr, &desc))
|
||||
if rc != 0 {
|
||||
return nil, &libusb_error{rc}
|
||||
@@ -1265,7 +1304,7 @@ func Free_SS_USB_Device_Capability_Descriptor(ss_usb_device_cap *SS_USB_Device_C
|
||||
}
|
||||
|
||||
func Get_Container_ID_Descriptor(ctx Context, dev_cap *BOS_Dev_Capability_Descriptor) (*Container_ID_Descriptor, error) {
|
||||
- var desc *C.struct_libusb_container_id_descriptor
|
||||
+ var desc *Struct_Libusb_Container_ID_Descriptor
|
||||
rc := int(C.libusb_get_container_id_descriptor(ctx, dev_cap.ptr, &desc))
|
||||
if rc != 0 {
|
||||
return nil, &libusb_error{rc}
|
||||
@@ -27,6 +27,7 @@ EGO_SUM=(
|
||||
"gopkg.in/yaml.v2 v2.4.0"
|
||||
"gopkg.in/yaml.v2 v2.4.0/go.mod"
|
||||
)
|
||||
PATCHES=$FILESDIR/$P-usblib.patch
|
||||
|
||||
go-module_set_globals
|
||||
|
||||
Reference in New Issue
Block a user