Change mingw-w64-usbview to mingw-w64-usbview-git.
It's better to compile code from Microsoft's GitHub account than some hidden ZIP file that they removed from their site.
This commit is contained in:
1
mingw-w64-usbview-git/.gitignore
vendored
Normal file
1
mingw-w64-usbview-git/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/wds
|
||||
@@ -1,7 +1,6 @@
|
||||
diff --binary -u -r C++/uvcview.h C++fix/uvcview.h
|
||||
--- C++/uvcview.h 2014-04-04 18:10:36.000000000 -0700
|
||||
+++ C++fix/uvcview.h 2015-04-22 20:42:54.355211400 -0700
|
||||
@@ -34,7 +34,6 @@
|
||||
--- a/uvcview.h
|
||||
+++ b/uvcview.h
|
||||
@@ -34,10 +34,10 @@ Revision History:
|
||||
#include <usbioctl.h>
|
||||
#include <usbiodef.h>
|
||||
#include <intsafe.h>
|
||||
@@ -9,12 +8,16 @@ diff --binary -u -r C++/uvcview.h C++fix/uvcview.h
|
||||
#include <specstrings.h>
|
||||
#include <usb.h>
|
||||
#include <usbuser.h>
|
||||
@@ -50,6 +49,7 @@
|
||||
+#include <usbspec.h>
|
||||
#include <basetyps.h>
|
||||
#include <wtypes.h>
|
||||
#include <objbase.h>
|
||||
@@ -50,6 +50,8 @@ Revision History:
|
||||
#include <winioctl.h>
|
||||
#include <devpkey.h>
|
||||
#include <math.h>
|
||||
+#include <strsafe.h>
|
||||
+#include <sal.h>
|
||||
|
||||
// This is mostly a private USB Audio descriptor header
|
||||
#include "usbdesc.h"
|
||||
|
||||
21
mingw-w64-usbview-git/04-redefinition.patch
Normal file
21
mingw-w64-usbview-git/04-redefinition.patch
Normal file
@@ -0,0 +1,21 @@
|
||||
--- a/usbdesc.h
|
||||
+++ b/usbdesc.h
|
||||
@@ -81,7 +81,6 @@ Revision History:
|
||||
#define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07
|
||||
#define USB_INTERFACE_POWER_DESCRIPTOR_TYPE 0x08
|
||||
#define USB_OTG_DESCRIPTOR_TYPE 0x09
|
||||
-#define USB_DEBUG_DESCRIPTOR_TYPE 0x0A
|
||||
#define USB_IAD_DESCRIPTOR_TYPE 0x0B
|
||||
|
||||
//
|
||||
--- a/uvcdesc.h
|
||||
+++ b/uvcdesc.h
|
||||
@@ -14,8 +14,6 @@
|
||||
#define ___UVCDESC_H___
|
||||
|
||||
|
||||
-// USB Video Device Class Code
|
||||
-#define USB_DEVICE_CLASS_VIDEO 0x0E
|
||||
|
||||
// Video sub-classes
|
||||
#define SUBCLASS_UNDEFINED 0x00
|
||||
11
mingw-w64-usbview-git/05-connection-statuses.patch
Normal file
11
mingw-w64-usbview-git/05-connection-statuses.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
--- a/uvcview.h
|
||||
+++ b/uvcview.h
|
||||
@@ -382,7 +382,7 @@
|
||||
// ENUM.C
|
||||
//
|
||||
|
||||
-PCHAR ConnectionStatuses[];
|
||||
+extern PCHAR ConnectionStatuses[];
|
||||
|
||||
//
|
||||
// DISPVID.C
|
||||
88
mingw-w64-usbview-git/PKGBUILD
Normal file
88
mingw-w64-usbview-git/PKGBUILD
Normal file
@@ -0,0 +1,88 @@
|
||||
# Maintainer: David Grayson <davidegrayson@gmail.com>
|
||||
|
||||
_realname=usbview
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-git"
|
||||
provides="${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
conflicts="${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
replaces=("${MINGW_PACKAGE_PREFIX}-${_realname}")
|
||||
pkgver=39.5b815f8
|
||||
pkgrel=1
|
||||
pkgdesc='GUI for browsing all USB controllers and connected USB devices on your computer (mingw-w64)'
|
||||
arch=('any')
|
||||
url=''
|
||||
license=('custom')
|
||||
makedepends=(
|
||||
"${MINGW_PACKAGE_PREFIX}-gcc"
|
||||
'patch'
|
||||
)
|
||||
depends=()
|
||||
options=('strip')
|
||||
source=(
|
||||
"wds::git+https://github.com/Microsoft/Windows-driver-samples"
|
||||
'my_xmlhelper.c'
|
||||
'01-uvcview-includes.patch'
|
||||
'03-resource-fix.patch'
|
||||
'04-redefinition.patch'
|
||||
'05-connection-statuses.patch'
|
||||
)
|
||||
|
||||
sha256sums=('SKIP'
|
||||
'c753691eea14e4cd267cc9a8e1afbf97648e9fda57cf68011384e4a5b1421c2e'
|
||||
'36173cc353ca4901c23f971980a1ff59c007b952dd602d4faa5a34c7d7fc3518'
|
||||
'2be3167e95f8d5d8abf91e43a49fac4593b8264df5c20478f476bdbe1bae89a3'
|
||||
'017bcb16508f6496e227dce96bd547ed1be20f2712742a05bafd4460924d3aad'
|
||||
'edcbf4392677934b21234e57a0094ce46f34053b51509719b186a18d7bdddc8e')
|
||||
|
||||
pkgver() {
|
||||
cd "${srcdir}/wds"
|
||||
printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/wds/usb/usbview"
|
||||
|
||||
# strsafe.h must be after tchar.h in mingw-w64.
|
||||
# sal.h and usbspec.h are needed.
|
||||
patch -p1 -i "${srcdir}/01-uvcview-includes.patch"
|
||||
|
||||
# We exclude the XML stuff because it requires Visual C++ (.NET).
|
||||
rm usbschema.hpp xmlhelper.cpp
|
||||
cp "${srcdir}/my_xmlhelper.c" .
|
||||
|
||||
# Fix some syntax errors that windres complains about
|
||||
patch -p1 -i "${srcdir}/03-resource-fix.patch"
|
||||
|
||||
# Fix warnings about macro redefinitions.
|
||||
patch -p1 -i "${srcdir}/04-redefinition.patch"
|
||||
|
||||
# Fix bad definition of array without a length.
|
||||
patch -p1 -i "${srcdir}/05-connection-statuses.patch"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}"
|
||||
mkdir -p "build-${MINGW_CHOST}/include"
|
||||
cd "build-${MINGW_CHOST}"
|
||||
|
||||
# Make sure mingw-w64's usb.h takes precedence over libusb-compat's.
|
||||
cp ${MINGW_PREFIX}/${MINGW_CHOST}/include/usb.h include
|
||||
|
||||
windres ../wds/usb/usbview/uvcview.rc rc.so
|
||||
|
||||
gcc -mwindows --std=c99 ${CFLAGS} ${LDFLAGS} \
|
||||
-Iinclude \
|
||||
-DNTDDI_VERSION=0x06020000 -D_WIN32_WINNT=0x0602 \
|
||||
-DSTRSAFE_NO_DEPRECATE \
|
||||
../wds/usb/usbview/*.c rc.so \
|
||||
-lcomctl32 -lcomdlg32 -lsetupapi -lshell32 -lshlwapi -lole32 -lgdi32 \
|
||||
-o usbview.exe
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/wds"
|
||||
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
|
||||
cd "${srcdir}/build-${MINGW_CHOST}"
|
||||
mkdir "${pkgdir}${MINGW_PREFIX}/bin"
|
||||
install -Dm755 usbview.exe "${pkgdir}${MINGW_PREFIX}/bin"
|
||||
}
|
||||
@@ -44,5 +44,4 @@ EXTERN_C HRESULT XmlAddUsbDevice(PSTR devName, PUSBDEVICEINFO deviceInfo)
|
||||
|
||||
EXTERN_C VOID XmlNotifyEndOfNodeList(PVOID pContext)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
--- orig/uvcview.h 2015-08-28 11:07:16.380217500 -0400
|
||||
+++ new/uvcview.h 2015-08-28 11:07:28.123146100 -0400
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <devpkey.h>
|
||||
#include <math.h>
|
||||
#include <strsafe.h>
|
||||
+#include <sal.h>
|
||||
|
||||
// This is mostly a private USB Audio descriptor header
|
||||
#include "usbdesc.h"
|
||||
@@ -1,83 +0,0 @@
|
||||
# Maintainer: David Grayson <davidegrayson@gmail.com>
|
||||
|
||||
# Note: We currently build an older version of usbview from a ZIP file
|
||||
# that was on a page that Microsoft has since unpublished. We are not
|
||||
# yet able to build the version of usbview from github because
|
||||
# mingw-w64 is missing some new structs/typedefs.
|
||||
#
|
||||
# https://github.com/Microsoft/Windows-driver-samples/tree/master/usb/usbview
|
||||
|
||||
_realname=usbview
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
pkgver=0.1.20140402
|
||||
pkgrel=1
|
||||
pkgdesc='GUI for browsing all USB controllers and connected USB devices on your computer (mingw-w64)'
|
||||
arch=('any')
|
||||
url='https://web.archive.org/web/20140824072648/http://code.msdn.microsoft.com/windowshardware/USBView-sample-application-e3241039'
|
||||
license=('custom')
|
||||
makedepends=(
|
||||
"${MINGW_PACKAGE_PREFIX}-gcc"
|
||||
'patch'
|
||||
)
|
||||
depends=()
|
||||
options=('strip')
|
||||
source=(
|
||||
"https://code.msdn.microsoft.com/windowshardware/USBView-sample-application-e3241039/file/51333/38/USBView%20sample%20application.zip"
|
||||
'my_xmlhelper.c'
|
||||
'01-strsafe-after-tchar.patch'
|
||||
'02-sal.patch'
|
||||
'03-resource-fix.patch'
|
||||
)
|
||||
|
||||
sha256sums=('fd07e8b20f9cff7efd8c01bf2b9cc9ac39ba85c76e56287b80d8abf38ec92287'
|
||||
'b3d551683be0398bca58e67bf7c91b22d88283e10292c9cda5ab367921511ebf'
|
||||
'dd0dade894b612cc0d30b0cbe1c47647de3697c9feeff65b866c32b01430154e'
|
||||
'b6959253bde6fd85af82cdd74c0993d0e9c82871f95cb507811b1fd8528cd301'
|
||||
'2be3167e95f8d5d8abf91e43a49fac4593b8264df5c20478f476bdbe1bae89a3')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/C++"
|
||||
|
||||
# dos2unix -q *.c *.h *.rc
|
||||
|
||||
# strsafe.h must be after tchar.h in mingw-w64
|
||||
patch -p1 -i "../01-strsafe-after-tchar.patch"
|
||||
|
||||
# Include sal.h in some places it is needed.
|
||||
patch -p1 -i "../02-sal.patch"
|
||||
|
||||
# We exclude the XML stuff because it requires Visual C++ (.NET).
|
||||
rm usbschema.hpp xmlhelper.cpp
|
||||
cp "../my_xmlhelper.c" .
|
||||
|
||||
# Fix some syntax errors that windres complains about
|
||||
patch -p1 -i "../03-resource-fix.patch"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}"
|
||||
mkdir -p "build-${MINGW_CHOST}/include"
|
||||
cd "build-${MINGW_CHOST}"
|
||||
|
||||
# Make sure mingw-w64's usb.h takes precedence over libusb-compat's.
|
||||
cp ${MINGW_PREFIX}/${MINGW_CHOST}/include/usb.h include
|
||||
|
||||
windres ../C++/uvcview.rc rc.so
|
||||
|
||||
gcc -mwindows --std=c99 ${CFLAGS} ${LDFLAGS} \
|
||||
-Iinclude \
|
||||
-DNTDDI_VERSION=0x06020000 -D_WIN32_WINNT=0x0602 \
|
||||
-DSTRSAFE_NO_DEPRECATE \
|
||||
../C++/*.c rc.so \
|
||||
-lcomctl32 -lcomdlg32 -lsetupapi -lshell32 -lshlwapi -lole32 -lgdi32 \
|
||||
-o usbview.exe
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}"
|
||||
install -Dm644 license.rtf "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/license.rtf"
|
||||
cd "build-${MINGW_CHOST}"
|
||||
mkdir "${pkgdir}${MINGW_PREFIX}/bin"
|
||||
install -Dm755 usbview.exe "${pkgdir}${MINGW_PREFIX}/bin"
|
||||
}
|
||||
Reference in New Issue
Block a user