[arch-commits] Commit in sdl2/repos/extra-x86_64 (4 files)

Sven-Hendrik Haase svenstaro at archlinux.org
Tue Nov 3 17:05:18 UTC 2020


    Date: Tuesday, November 3, 2020 @ 17:05:17
  Author: svenstaro
Revision: 399213

archrelease: copy trunk to extra-x86_64

Added:
  sdl2/repos/extra-x86_64/PKGBUILD
    (from rev 399212, sdl2/trunk/PKGBUILD)
  sdl2/repos/extra-x86_64/fix-hidapi.patch
    (from rev 399212, sdl2/trunk/fix-hidapi.patch)
Deleted:
  sdl2/repos/extra-x86_64/PKGBUILD
  sdl2/repos/extra-x86_64/fix-hidapi.patch

------------------+
 PKGBUILD         |  124 +++++++++----------
 fix-hidapi.patch |  330 ++++++++++++++++++++++++++---------------------------
 2 files changed, 227 insertions(+), 227 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2020-11-03 17:05:10 UTC (rev 399212)
+++ PKGBUILD	2020-11-03 17:05:17 UTC (rev 399213)
@@ -1,62 +0,0 @@
-# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
-
-pkgname=sdl2
-pkgver=2.0.12
-pkgrel=2
-pkgdesc="A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 2)"
-arch=('x86_64')
-url="https://www.libsdl.org"
-license=('MIT')
-depends=('glibc' 'libxext' 'libxrender' 'libx11' 'libgl' 'libxcursor' 'libibus' 'hidapi')
-makedepends=('alsa-lib' 'mesa' 'libpulse' 'libxrandr' 'libxinerama' 'wayland' 'libxkbcommon'
-             'wayland-protocols' 'ibus' 'fcitx' 'libxss' 'cmake' 'jack' 'ninja')
-optdepends=('alsa-lib: ALSA audio driver'
-            'libpulse: PulseAudio audio driver'
-            'jack: JACK audio driver')
-source=("https://www.libsdl.org/release/SDL2-${pkgver}.tar.gz"{,.sig}
-        fix-hidapi.patch)
-sha512sums=('3f1f04af0f3d9dda9c84a2e9274ae8d83ea0da3fc367970a820036cc4dc1dbf990cfc37e4975ae05f0b45a4ffa739c6c19e470c00bf3f2bce9b8b63717b8b317'
-            'SKIP'
-            '69b2e8857dd514cbef3aad60717bb7b2a4621124cd3b90158bf439ee91f301ad847fbde0fd9f08f245f921c285a62e458a4b0e0f7faddf7f2a4d8681c189443a')
-validpgpkeys=('1528635D8053A57F77D1E08630A59377A7763BE6') # Sam Lantinga
-
-prepare() {
-  cd SDL2-${pkgver}
-  # For until https://bugzilla.libsdl.org/show_bug.cgi?id=5221 is fixed
-  sed -i "s/LIBUSB libusb/LIBUSB libusb-1.0/g" cmake/sdlchecks.cmake
-
-  # https://bugzilla.libsdl.org/show_bug.cgi?id=5222
-  patch -Np1 -i "${srcdir}"/fix-hidapi.patch
-}
-
-build() {
-  cd SDL2-${pkgver}
-  cmake . \
-      -Bbuild \
-      -GNinja \
-      -DCMAKE_INSTALL_PREFIX=/usr \
-      -DSDL_STATIC=OFF \
-      -DSDL_DLOPEN=ON \
-      -DARTS=OFF \
-      -DESD=OFF \
-      -DNAS=OFF \
-      -DALSA=ON \
-      -DHIDAPI=ON \
-      -DPULSEAUDIO_SHARED=ON \
-      -DVIDEO_WAYLAND=ON \
-      -DRPATH=OFF \
-      -DCLOCK_GETTIME=ON \
-      -DJACK_SHARED=ON
-  ninja -C build
-}
-
-package() {
-  cd SDL2-${pkgver}
-  DESTDIR="${pkgdir}" ninja -C build install
-
-  sed -i "s/libSDL2\.a/libSDL2main.a/g" "$pkgdir"/usr/lib/cmake/SDL2/SDL2Targets-noconfig.cmake
-
-  install -Dm644 COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}
-
-# vim: ts=2 sw=2 et:

Copied: sdl2/repos/extra-x86_64/PKGBUILD (from rev 399212, sdl2/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2020-11-03 17:05:17 UTC (rev 399213)
@@ -0,0 +1,62 @@
+# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
+
+pkgname=sdl2
+pkgver=2.0.12
+pkgrel=3
+pkgdesc="A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 2)"
+arch=('x86_64')
+url="https://www.libsdl.org"
+license=('MIT')
+depends=('glibc' 'libxext' 'libxrender' 'libx11' 'libgl' 'libxcursor' 'libibus' 'hidapi' 'libusb')
+makedepends=('alsa-lib' 'mesa' 'libpulse' 'libxrandr' 'libxinerama' 'wayland' 'libxkbcommon'
+             'wayland-protocols' 'ibus' 'fcitx' 'libxss' 'cmake' 'jack' 'ninja')
+optdepends=('alsa-lib: ALSA audio driver'
+            'libpulse: PulseAudio audio driver'
+            'jack: JACK audio driver')
+source=("https://www.libsdl.org/release/SDL2-${pkgver}.tar.gz"{,.sig}
+        fix-hidapi.patch)
+sha512sums=('3f1f04af0f3d9dda9c84a2e9274ae8d83ea0da3fc367970a820036cc4dc1dbf990cfc37e4975ae05f0b45a4ffa739c6c19e470c00bf3f2bce9b8b63717b8b317'
+            'SKIP'
+            '69b2e8857dd514cbef3aad60717bb7b2a4621124cd3b90158bf439ee91f301ad847fbde0fd9f08f245f921c285a62e458a4b0e0f7faddf7f2a4d8681c189443a')
+validpgpkeys=('1528635D8053A57F77D1E08630A59377A7763BE6') # Sam Lantinga
+
+prepare() {
+  cd SDL2-${pkgver}
+  # For until https://bugzilla.libsdl.org/show_bug.cgi?id=5221 is fixed
+  sed -i "s/LIBUSB libusb/LIBUSB libusb-1.0/g" cmake/sdlchecks.cmake
+
+  # https://bugzilla.libsdl.org/show_bug.cgi?id=5222
+  patch -Np1 -i "${srcdir}"/fix-hidapi.patch
+}
+
+build() {
+  cd SDL2-${pkgver}
+  cmake . \
+      -Bbuild \
+      -GNinja \
+      -DCMAKE_INSTALL_PREFIX=/usr \
+      -DSDL_STATIC=OFF \
+      -DSDL_DLOPEN=ON \
+      -DARTS=OFF \
+      -DESD=OFF \
+      -DNAS=OFF \
+      -DALSA=ON \
+      -DHIDAPI=ON \
+      -DPULSEAUDIO_SHARED=ON \
+      -DVIDEO_WAYLAND=ON \
+      -DRPATH=OFF \
+      -DCLOCK_GETTIME=ON \
+      -DJACK_SHARED=ON
+  ninja -C build
+}
+
+package() {
+  cd SDL2-${pkgver}
+  DESTDIR="${pkgdir}" ninja -C build install
+
+  sed -i "s/libSDL2\.a/libSDL2main.a/g" "$pkgdir"/usr/lib/cmake/SDL2/SDL2Targets-noconfig.cmake
+
+  install -Dm644 COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+# vim: ts=2 sw=2 et:

Deleted: fix-hidapi.patch
===================================================================
--- fix-hidapi.patch	2020-11-03 17:05:10 UTC (rev 399212)
+++ fix-hidapi.patch	2020-11-03 17:05:17 UTC (rev 399213)
@@ -1,165 +0,0 @@
---- a/src/hidapi/SDL_hidapi.c	Sun Jun 28 17:45:07 2020 -0400
-+++ a/src/hidapi/SDL_hidapi.c	Mon Jul 06 10:47:27 2020 +0200
-@@ -301,7 +301,7 @@ 
- #include "hidapi.h"
- 
- struct hidapi_backend {
--#define F(x) typeof(x) *x
-+#define F(x) __typeof__(x) *x
-     F(hid_write);
-     F(hid_read_timeout);
-     F(hid_read);
-@@ -458,8 +458,9 @@ 
- #ifdef SDL_LIBUSB_DYNAMIC
-     libusb_ctx.libhandle = SDL_LoadObject(SDL_LIBUSB_DYNAMIC);
-     if (libusb_ctx.libhandle != NULL) {
-+        SDL_bool loaded = SDL_TRUE;
-         #define LOAD_LIBUSB_SYMBOL(func) \
--            libusb_ctx.func = SDL_LoadFunction(libusb_ctx.libhandle, "libusb_" #func);
-+            if (!(libusb_ctx.func = SDL_LoadFunction(libusb_ctx.libhandle, "libusb_" #func))) {loaded = SDL_FALSE;}
-         LOAD_LIBUSB_SYMBOL(init)
-         LOAD_LIBUSB_SYMBOL(exit)
-         LOAD_LIBUSB_SYMBOL(get_device_list)
-@@ -488,9 +489,17 @@ 
-         LOAD_LIBUSB_SYMBOL(handle_events_completed)
-         #undef LOAD_LIBUSB_SYMBOL
- 
--        if ((err = LIBUSB_hid_init()) < 0) {
-+        if (loaded == SDL_TRUE) {
-+            if ((err = LIBUSB_hid_init()) < 0) {
-+                SDL_UnloadObject(libusb_ctx.libhandle);
-+                libusb_ctx.libhandle = NULL;
-+                return err;
-+            }
-+        } else {
-             SDL_UnloadObject(libusb_ctx.libhandle);
--            return err;
-+            libusb_ctx.libhandle = NULL;
-+            /* SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, SDL_LIBUSB_DYNAMIC " found but could not load function."); */
-+            /* ignore error: continue without libusb */
-         }
-     }
- #endif /* SDL_LIBUSB_DYNAMIC */
-@@ -502,13 +511,16 @@ 
-     if (udev_ctx && (err = PLATFORM_hid_init()) < 0) {
- #ifdef SDL_LIBUSB_DYNAMIC
-         if (libusb_ctx.libhandle) {
-+            LIBUSB_hid_exit();
-             SDL_UnloadObject(libusb_ctx.libhandle);
-+            libusb_ctx.libhandle = NULL;
-         }
- #endif /* SDL_LIBUSB_DYNAMIC */
-         return err;
-     }
- #endif /* HAVE_PLATFORM_BACKEND */
- 
-+    SDL_hidapi_wasinit = SDL_TRUE;
-     return 0;
- }
- 
-@@ -519,6 +531,7 @@ 
-     if (SDL_hidapi_wasinit == SDL_FALSE) {
-         return 0;
-     }
-+    SDL_hidapi_wasinit = SDL_FALSE;
- 
- #if HAVE_PLATFORM_BACKEND
-     if (udev_ctx) {
-@@ -529,6 +542,7 @@ 
-     if (libusb_ctx.libhandle) {
-         err |= LIBUSB_hid_exit(); /* Ehhhhh */
-         SDL_UnloadObject(libusb_ctx.libhandle);
-+        libusb_ctx.libhandle = NULL;
-     }
- #endif /* SDL_LIBUSB_DYNAMIC */
-     return err;
-@@ -546,16 +560,30 @@ 
- #endif
-     struct hid_device_info *devs = NULL, *last = NULL, *new_dev;
- 
--    if (SDL_hidapi_wasinit == SDL_FALSE) {
--        hid_init();
-+    if (hid_init() != 0) {
-+        return NULL;
-     }
- 
- #ifdef SDL_LIBUSB_DYNAMIC
-     if (libusb_ctx.libhandle) {
-         usb_devs = LIBUSB_hid_enumerate(vendor_id, product_id);
-+  #ifdef DEBUG_HIDAPI
-+        SDL_Log("libusb devices found:");
-+  #endif
-         for (usb_dev = usb_devs; usb_dev; usb_dev = usb_dev->next) {
-             new_dev = (struct hid_device_info*) SDL_malloc(sizeof(struct hid_device_info));
-+            if (!new_dev) {
-+                LIBUSB_hid_free_enumeration(usb_devs);
-+                hid_free_enumeration(devs);
-+                SDL_OutOfMemory();
-+                return NULL;
-+            }
-             LIBUSB_CopyHIDDeviceInfo(usb_dev, new_dev);
-+  #ifdef DEBUG_HIDAPI
-+            SDL_Log(" - %ls %ls 0x%.4hx 0x%.4hx",
-+                    usb_dev->manufacturer_string, usb_dev->product_string,
-+                    usb_dev->vendor_id, usb_dev->product_id);
-+  #endif
- 
-             if (last != NULL) {
-                 last->next = new_dev;
-@@ -570,8 +598,16 @@ 
- #if HAVE_PLATFORM_BACKEND
-     if (udev_ctx) {
-         raw_devs = PLATFORM_hid_enumerate(vendor_id, product_id);
-+#ifdef DEBUG_HIDAPI
-+        SDL_Log("hidraw devices found:");
-+#endif
-         for (raw_dev = raw_devs; raw_dev; raw_dev = raw_dev->next) {
-             SDL_bool bFound = SDL_FALSE;
-+#ifdef DEBUG_HIDAPI
-+            SDL_Log(" - %ls %ls 0x%.4hx 0x%.4hx",
-+                    raw_dev->manufacturer_string, raw_dev->product_string,
-+                    raw_dev->vendor_id, raw_dev->product_id);
-+#endif
- #ifdef SDL_LIBUSB_DYNAMIC
-             for (usb_dev = usb_devs; usb_dev; usb_dev = usb_dev->next) {
-                 if (raw_dev->vendor_id == usb_dev->vendor_id &&
-@@ -584,6 +620,17 @@ 
- #endif
-             if (!bFound) {
-                 new_dev = (struct hid_device_info*) SDL_malloc(sizeof(struct hid_device_info));
-+                if (!new_dev) {
-+#ifdef SDL_LIBUSB_DYNAMIC
-+                    if (libusb_ctx.libhandle) {
-+                        LIBUSB_hid_free_enumeration(usb_devs);
-+                    }
-+#endif
-+                    PLATFORM_hid_free_enumeration(raw_devs);
-+                    hid_free_enumeration(devs);
-+                    SDL_OutOfMemory();
-+                    return NULL;
-+                }
-                 PLATFORM_CopyHIDDeviceInfo(raw_dev, new_dev);
-                 new_dev->next = NULL;
- 
-@@ -624,8 +671,8 @@ 
- {
-     hid_device *pDevice = NULL;
- 
--    if (SDL_hidapi_wasinit == SDL_FALSE) {
--        hid_init();
-+    if (hid_init() != 0) {
-+        return NULL;
-     }
- 
- #if HAVE_PLATFORM_BACKEND
-@@ -651,8 +698,8 @@ 
- {
-     hid_device *pDevice = NULL;
- 
--    if (SDL_hidapi_wasinit == SDL_FALSE) {
--        hid_init();
-+    if (hid_init() != 0) {
-+        return NULL;
-     }
- 
- #if HAVE_PLATFORM_BACKEND

Copied: sdl2/repos/extra-x86_64/fix-hidapi.patch (from rev 399212, sdl2/trunk/fix-hidapi.patch)
===================================================================
--- fix-hidapi.patch	                        (rev 0)
+++ fix-hidapi.patch	2020-11-03 17:05:17 UTC (rev 399213)
@@ -0,0 +1,165 @@
+--- a/src/hidapi/SDL_hidapi.c	Sun Jun 28 17:45:07 2020 -0400
++++ a/src/hidapi/SDL_hidapi.c	Mon Jul 06 10:47:27 2020 +0200
+@@ -301,7 +301,7 @@ 
+ #include "hidapi.h"
+ 
+ struct hidapi_backend {
+-#define F(x) typeof(x) *x
++#define F(x) __typeof__(x) *x
+     F(hid_write);
+     F(hid_read_timeout);
+     F(hid_read);
+@@ -458,8 +458,9 @@ 
+ #ifdef SDL_LIBUSB_DYNAMIC
+     libusb_ctx.libhandle = SDL_LoadObject(SDL_LIBUSB_DYNAMIC);
+     if (libusb_ctx.libhandle != NULL) {
++        SDL_bool loaded = SDL_TRUE;
+         #define LOAD_LIBUSB_SYMBOL(func) \
+-            libusb_ctx.func = SDL_LoadFunction(libusb_ctx.libhandle, "libusb_" #func);
++            if (!(libusb_ctx.func = SDL_LoadFunction(libusb_ctx.libhandle, "libusb_" #func))) {loaded = SDL_FALSE;}
+         LOAD_LIBUSB_SYMBOL(init)
+         LOAD_LIBUSB_SYMBOL(exit)
+         LOAD_LIBUSB_SYMBOL(get_device_list)
+@@ -488,9 +489,17 @@ 
+         LOAD_LIBUSB_SYMBOL(handle_events_completed)
+         #undef LOAD_LIBUSB_SYMBOL
+ 
+-        if ((err = LIBUSB_hid_init()) < 0) {
++        if (loaded == SDL_TRUE) {
++            if ((err = LIBUSB_hid_init()) < 0) {
++                SDL_UnloadObject(libusb_ctx.libhandle);
++                libusb_ctx.libhandle = NULL;
++                return err;
++            }
++        } else {
+             SDL_UnloadObject(libusb_ctx.libhandle);
+-            return err;
++            libusb_ctx.libhandle = NULL;
++            /* SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, SDL_LIBUSB_DYNAMIC " found but could not load function."); */
++            /* ignore error: continue without libusb */
+         }
+     }
+ #endif /* SDL_LIBUSB_DYNAMIC */
+@@ -502,13 +511,16 @@ 
+     if (udev_ctx && (err = PLATFORM_hid_init()) < 0) {
+ #ifdef SDL_LIBUSB_DYNAMIC
+         if (libusb_ctx.libhandle) {
++            LIBUSB_hid_exit();
+             SDL_UnloadObject(libusb_ctx.libhandle);
++            libusb_ctx.libhandle = NULL;
+         }
+ #endif /* SDL_LIBUSB_DYNAMIC */
+         return err;
+     }
+ #endif /* HAVE_PLATFORM_BACKEND */
+ 
++    SDL_hidapi_wasinit = SDL_TRUE;
+     return 0;
+ }
+ 
+@@ -519,6 +531,7 @@ 
+     if (SDL_hidapi_wasinit == SDL_FALSE) {
+         return 0;
+     }
++    SDL_hidapi_wasinit = SDL_FALSE;
+ 
+ #if HAVE_PLATFORM_BACKEND
+     if (udev_ctx) {
+@@ -529,6 +542,7 @@ 
+     if (libusb_ctx.libhandle) {
+         err |= LIBUSB_hid_exit(); /* Ehhhhh */
+         SDL_UnloadObject(libusb_ctx.libhandle);
++        libusb_ctx.libhandle = NULL;
+     }
+ #endif /* SDL_LIBUSB_DYNAMIC */
+     return err;
+@@ -546,16 +560,30 @@ 
+ #endif
+     struct hid_device_info *devs = NULL, *last = NULL, *new_dev;
+ 
+-    if (SDL_hidapi_wasinit == SDL_FALSE) {
+-        hid_init();
++    if (hid_init() != 0) {
++        return NULL;
+     }
+ 
+ #ifdef SDL_LIBUSB_DYNAMIC
+     if (libusb_ctx.libhandle) {
+         usb_devs = LIBUSB_hid_enumerate(vendor_id, product_id);
++  #ifdef DEBUG_HIDAPI
++        SDL_Log("libusb devices found:");
++  #endif
+         for (usb_dev = usb_devs; usb_dev; usb_dev = usb_dev->next) {
+             new_dev = (struct hid_device_info*) SDL_malloc(sizeof(struct hid_device_info));
++            if (!new_dev) {
++                LIBUSB_hid_free_enumeration(usb_devs);
++                hid_free_enumeration(devs);
++                SDL_OutOfMemory();
++                return NULL;
++            }
+             LIBUSB_CopyHIDDeviceInfo(usb_dev, new_dev);
++  #ifdef DEBUG_HIDAPI
++            SDL_Log(" - %ls %ls 0x%.4hx 0x%.4hx",
++                    usb_dev->manufacturer_string, usb_dev->product_string,
++                    usb_dev->vendor_id, usb_dev->product_id);
++  #endif
+ 
+             if (last != NULL) {
+                 last->next = new_dev;
+@@ -570,8 +598,16 @@ 
+ #if HAVE_PLATFORM_BACKEND
+     if (udev_ctx) {
+         raw_devs = PLATFORM_hid_enumerate(vendor_id, product_id);
++#ifdef DEBUG_HIDAPI
++        SDL_Log("hidraw devices found:");
++#endif
+         for (raw_dev = raw_devs; raw_dev; raw_dev = raw_dev->next) {
+             SDL_bool bFound = SDL_FALSE;
++#ifdef DEBUG_HIDAPI
++            SDL_Log(" - %ls %ls 0x%.4hx 0x%.4hx",
++                    raw_dev->manufacturer_string, raw_dev->product_string,
++                    raw_dev->vendor_id, raw_dev->product_id);
++#endif
+ #ifdef SDL_LIBUSB_DYNAMIC
+             for (usb_dev = usb_devs; usb_dev; usb_dev = usb_dev->next) {
+                 if (raw_dev->vendor_id == usb_dev->vendor_id &&
+@@ -584,6 +620,17 @@ 
+ #endif
+             if (!bFound) {
+                 new_dev = (struct hid_device_info*) SDL_malloc(sizeof(struct hid_device_info));
++                if (!new_dev) {
++#ifdef SDL_LIBUSB_DYNAMIC
++                    if (libusb_ctx.libhandle) {
++                        LIBUSB_hid_free_enumeration(usb_devs);
++                    }
++#endif
++                    PLATFORM_hid_free_enumeration(raw_devs);
++                    hid_free_enumeration(devs);
++                    SDL_OutOfMemory();
++                    return NULL;
++                }
+                 PLATFORM_CopyHIDDeviceInfo(raw_dev, new_dev);
+                 new_dev->next = NULL;
+ 
+@@ -624,8 +671,8 @@ 
+ {
+     hid_device *pDevice = NULL;
+ 
+-    if (SDL_hidapi_wasinit == SDL_FALSE) {
+-        hid_init();
++    if (hid_init() != 0) {
++        return NULL;
+     }
+ 
+ #if HAVE_PLATFORM_BACKEND
+@@ -651,8 +698,8 @@ 
+ {
+     hid_device *pDevice = NULL;
+ 
+-    if (SDL_hidapi_wasinit == SDL_FALSE) {
+-        hid_init();
++    if (hid_init() != 0) {
++        return NULL;
+     }
+ 
+ #if HAVE_PLATFORM_BACKEND



More information about the arch-commits mailing list