Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: duckyPad_Configurator-1.6.3
@ 2024-10-03 23:24 Calandracas606
  2025-01-03  1:59 ` github-actions
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Calandracas606 @ 2024-10-03 23:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

There is a new pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages duckPad_Configurator
https://github.com/void-linux/void-packages/pull/52484

New package: duckyPad_Configurator-1.6.3
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**


#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**


<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - i686
  - aarch64 (cross)
  - aarch64-musl (cross)
  - armv7l (cross)
  - armv7l-musl (cross)
  - armv6l (cross)
  - armv6l-musl (cross)



A patch file from https://github.com/void-linux/void-packages/pull/52484.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-duckPad_Configurator-52484.patch --]
[-- Type: text/x-diff, Size: 12492 bytes --]

From 081c40c1e182344caa19fa466c48f14f9bb55c3c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 3 Oct 2024 17:31:35 -0400
Subject: [PATCH 1/3] New package: python3-PyAutoGUI-0.9.54

---
 srcpkgs/python3-PyAutoGUI/template | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/python3-PyAutoGUI/template

diff --git a/srcpkgs/python3-PyAutoGUI/template b/srcpkgs/python3-PyAutoGUI/template
new file mode 100644
index 00000000000000..c169fa181b9a2c
--- /dev/null
+++ b/srcpkgs/python3-PyAutoGUI/template
@@ -0,0 +1,18 @@
+# Template file for 'python3-PyAutoGUI'
+pkgname=python3-PyAutoGUI
+version=0.9.54
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-xlib"
+short_desc="Cross-platform GUI automation Python module for human beings"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="BSD-3-Clause"
+homepage="https://github.com/asweigart/pyautogui"
+changelog="https://raw.githubusercontent.com/asweigart/pyautogui/refs/heads/master/CHANGES.txt"
+distfiles="${PYPI_SITE}/P/PyAutoGUI/PyAutoGUI-${version}.tar.gz"
+checksum=dd1d29e8fd118941cb193f74df57e5c6ff8e9253b99c7b04f39cfc69f3ae04b2
+
+post_install() {
+	vlicense LICENSE.txt
+}

From 6f1fc156fec8d5588d0a2622ea2d11d0d836dc71 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 3 Oct 2024 19:18:45 -0400
Subject: [PATCH 2/3] python3-hid: update to 1.0.6.

---
 srcpkgs/python3-hid/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3-hid/template b/srcpkgs/python3-hid/template
index 28da3418ee4ae6..2444af5ac0f59b 100644
--- a/srcpkgs/python3-hid/template
+++ b/srcpkgs/python3-hid/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-hid'
 pkgname=python3-hid
-version=1.0.4
-revision=3
+version=1.0.6
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 depends="hidapi python3"
@@ -12,7 +12,7 @@ license="MIT"
 homepage="https://github.com/apmorton/pyhidapi"
 # Can't use PyPi as the tarball there doesn't include LICENSE
 distfiles="${homepage}/archive/refs/tags/${version}.tar.gz"
-checksum=b4a48e643cf345cf061edb287255a2cfb9778eb89756a915a5baf8eabfb3a0e0
+checksum=f2eb1228d824f41609f02681ab19d817fb3c933ba813d1134a84dc96def722f0
 
 post_install() {
 	vlicense LICENSE

From 2b3bdf3d1d34f0fbcb746a36d651e35205c8a48c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 3 Oct 2024 19:18:55 -0400
Subject: [PATCH 3/3] New package: duckyPad_Configurator-1.6.3

---
 srcpkgs/duckyPad_Configurator/INSTALL         |   7 +
 .../files/20-duckyPad.rules                   |   1 +
 .../files/duckypad.desktop                    |   7 +
 .../files/duckypad_config                     |   3 +
 .../patches/pyhidapi.patch                    | 186 ++++++++++++++++++
 srcpkgs/duckyPad_Configurator/template        |  36 ++++
 6 files changed, 240 insertions(+)
 create mode 100644 srcpkgs/duckyPad_Configurator/INSTALL
 create mode 100644 srcpkgs/duckyPad_Configurator/files/20-duckyPad.rules
 create mode 100644 srcpkgs/duckyPad_Configurator/files/duckypad.desktop
 create mode 100644 srcpkgs/duckyPad_Configurator/files/duckypad_config
 create mode 100644 srcpkgs/duckyPad_Configurator/patches/pyhidapi.patch
 create mode 100644 srcpkgs/duckyPad_Configurator/template

diff --git a/srcpkgs/duckyPad_Configurator/INSTALL b/srcpkgs/duckyPad_Configurator/INSTALL
new file mode 100644
index 00000000000000..e6ee5d5c0e6c19
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/INSTALL
@@ -0,0 +1,7 @@
+#!/bin/sh
+case "${ACTION}" in
+post)
+	udevadm trigger
+	udevadm control --reload-rules
+	;;
+esac
diff --git a/srcpkgs/duckyPad_Configurator/files/20-duckyPad.rules b/srcpkgs/duckyPad_Configurator/files/20-duckyPad.rules
new file mode 100644
index 00000000000000..de8dd95e9f1b37
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/files/20-duckyPad.rules
@@ -0,0 +1 @@
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="d11c", TAG+="uaccess", TAG+="udev-acl"
diff --git a/srcpkgs/duckyPad_Configurator/files/duckypad.desktop b/srcpkgs/duckyPad_Configurator/files/duckypad.desktop
new file mode 100644
index 00000000000000..f944948f98f227
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/files/duckypad.desktop
@@ -0,0 +1,7 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Name=DuckyPad Configurator
+Icon=/usr/share/duckypad/_icon.ico
+Exec=python3 /usr/share/duckypad/duckypad_config.py
+Terminal=false
+Type=Application
diff --git a/srcpkgs/duckyPad_Configurator/files/duckypad_config b/srcpkgs/duckyPad_Configurator/files/duckypad_config
new file mode 100644
index 00000000000000..788d2bbe05eb6f
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/files/duckypad_config
@@ -0,0 +1,3 @@
+#!/usr/bin/sh
+cd /usr/share/duckypad
+exec python3 duckypad_config.py "$@"
diff --git a/srcpkgs/duckyPad_Configurator/patches/pyhidapi.patch b/srcpkgs/duckyPad_Configurator/patches/pyhidapi.patch
new file mode 100644
index 00000000000000..6dde8dbbc3e9db
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/patches/pyhidapi.patch
@@ -0,0 +1,186 @@
+diff --git a/pc_software/hid_op.py b/pc_software/hid_op.py
+index 40bdba59..bdf85589 100644
+--- a/pc_software/hid_op.py
++++ b/pc_software/hid_op.py
+@@ -66,7 +66,10 @@ HID_COMMAND_CREATE_DIR = 18
+ HID_COMMAND_DELETE_DIR = 19
+ HID_COMMAND_SW_RESET = 20
+ 
+-h = hid.device()
++if hasattr(hid, 'device'):
++    h = hid.device()
++else:
++    h = None
+ 
+ def _check_hid_err(result):
+     """
+@@ -92,13 +95,21 @@ def _read_duckypad():
+     return []
+ 
+ def duckypad_hid_init():
+-    duckypad_path = get_duckypad_path()
+-    if duckypad_path is None:
+-        raise OSError('duckyPad Not Found!')
+-    h.open_path(duckypad_path)
++    global h
++    if h and hasattr(hid, 'device'):
++        duckypad_path = get_duckypad_path()
++        if duckypad_path is None:
++           raise OSError('duckyPad Not Found!')
++        h.open_path(duckypad_path)
++    else:
++        try:
++            h = hid.Device(0x483, 0xd11c)
++        except:
++           raise OSError('duckyPad Not Found!')
+ 
+ def duckypad_hid_close():
+-    h.close()
++    if h:
++        h.close()
+ 
+ def duckypad_list_files(root_dir = None):
+     ret = []
+@@ -110,10 +121,16 @@ def duckypad_list_files(root_dir = None):
+         for x in range(0, len(root_dir)):
+             pc_to_duckypad_buf[3+x] = ord(root_dir[x])
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
++
+     while 1:
+         time.sleep(HID_WAIT_TIME)
+         result = _read_duckypad()
++        if isinstance(result, bytes):
++            result = list(iter(result))
+         if len(result) == 0 or result[2] == HID_RESPONSE_EOF:
+             break
+         _check_hid_err(result)
+@@ -129,7 +146,10 @@ def get_dp_info():
+     try:
+         duckypad_hid_close()
+         duckypad_hid_init()
+-        h.write(pc_to_duckypad_buf)
++        if hasattr(hid, 'device'):
++            h.write(pc_to_duckypad_buf)
++        else:
++            h.write(bytes(pc_to_duckypad_buf))
+         result = _read_duckypad()
+     except Exception as e:
+         print("get_dp_info:", e)
+@@ -139,6 +159,7 @@ def get_dp_info():
+ def is_dp_ready():
+     dp_info = get_dp_info()
+     if dp_info is None:
++        print("Err1")
+         return False, 'duckyPad not Found!'
+     if dp_info[2] == 0:
+         return True, 'All good!'
+@@ -148,7 +169,10 @@ def duckypad_hid_resume():
+     pc_to_duckypad_buf = [0] * PC_TO_DUCKYPAD_HID_BUF_SIZE
+     pc_to_duckypad_buf[0] = 5   # HID Usage ID, always 5
+     pc_to_duckypad_buf[2] = HID_COMMAND_OP_RESUME   # Command type
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+ def duckypad_read_file(file_dir):
+     print("duckypad_read_file", file_dir)
+@@ -159,7 +183,10 @@ def duckypad_read_file(file_dir):
+ 
+     for x in range(0, len(file_dir)):
+         pc_to_duckypad_buf[3+x] = ord(file_dir[x])
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+     
+     while 1:
+         time.sleep(HID_WAIT_TIME)
+@@ -239,7 +266,10 @@ def duckypad_open_file_for_writing(file_dir):
+     for x in range(0, len(file_dir)):
+         pc_to_duckypad_buf[3+x] = ord(file_dir[x])
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+     result = _read_duckypad()
+     _check_hid_err(result)
+@@ -249,7 +279,10 @@ def duckypad_close_file():
+     pc_to_duckypad_buf[0] = 5   # HID Usage ID, always 5
+     pc_to_duckypad_buf[2] = HID_COMMAND_CLOSE_FILE  # Command type
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+     result = _read_duckypad()
+     _check_hid_err(result)
+@@ -266,7 +299,10 @@ def duckypad_write_one_chunk(content):
+     for x in range(0, len(content)):
+         pc_to_duckypad_buf[3+x] = content[x]
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+     result = _read_duckypad()
+     _check_hid_err(result)
+@@ -285,7 +321,10 @@ def duckypad_delete_file(file_name):
+     for x in range(0, len(file_name)):
+         pc_to_duckypad_buf[3+x] = ord(file_name[x])
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+     result = _read_duckypad()
+     _check_hid_err(result)
+@@ -298,7 +337,10 @@ def duckypad_create_dir(dir_name):
+     for x in range(0, len(dir_name)):
+         pc_to_duckypad_buf[3+x] = ord(dir_name[x])
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+     result = _read_duckypad()
+     _check_hid_err(result)
+@@ -309,7 +351,10 @@ def duckypad_delete_dir(dir_name):
+     pc_to_duckypad_buf[2] = HID_COMMAND_DELETE_DIR  # Command type
+     for x in range(0, len(dir_name)):
+         pc_to_duckypad_buf[3+x] = ord(dir_name[x])
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+     result = _read_duckypad()
+     _check_hid_err(result)
+ 
+@@ -392,4 +437,7 @@ def duckypad_hid_sw_reset():
+     pc_to_duckypad_buf = [0] * PC_TO_DUCKYPAD_HID_BUF_SIZE
+     pc_to_duckypad_buf[0] = 5   # HID Usage ID, always 5
+     pc_to_duckypad_buf[2] = HID_COMMAND_SW_RESET    # Command type
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
diff --git a/srcpkgs/duckyPad_Configurator/template b/srcpkgs/duckyPad_Configurator/template
new file mode 100644
index 00000000000000..8cf71fa6a848f2
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/template
@@ -0,0 +1,36 @@
+# Template file for 'duckyPad_Configurator'
+pkgname=duckyPad_Configurator
+version=1.6.3
+revision=1
+_duckypad_dir="usr/share/duckypad"
+pycompile_dirs="${_duckypad_dir}"
+build_wrksrc=pc_software
+depends="python3-tkinter python3-appdirs python3-hid python3-PyAutoGUI"
+short_desc="Companion app to configure duckyPad"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/dekuNukem/duckyPad"
+distfiles="https://github.com/dekuNukem/duckyPad/archive/refs/tags/${version}.tar.gz"
+checksum=67342c903f706c0bcfbb4f9f33925d75dd9eec85c0e1a89fea90ccec542d5c1c
+python_version=3.12
+
+do_install() {
+	vmkdir usr/share/applications
+	vinstall ${FILESDIR}/duckypad.desktop 755 usr/share/applications
+
+	vmkdir "${_duckypad_dir}"
+
+	rm _scrap.py
+	for _file in *.py; do
+		vinstall "${_file}" 644 "${_duckypad_dir}"
+	done
+
+	vinstall _icon.ico 644 "${_duckypad_dir}"
+
+	vmkdir usr/lib/udev/rules.d
+	vinstall ${FILESDIR}/20-duckyPad.rules 644 usr/lib/udev/rules.d
+
+	vbin ${FILESDIR}/duckypad_config
+
+	vlicense ../LICENSE
+}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: New package: duckyPad_Configurator-1.6.3
  2024-10-03 23:24 [PR PATCH] New package: duckyPad_Configurator-1.6.3 Calandracas606
@ 2025-01-03  1:59 ` github-actions
  2025-01-03  2:01 ` Calandracas606
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: github-actions @ 2025-01-03  1:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/52484#issuecomment-2568604020

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: New package: duckyPad_Configurator-1.6.3
  2024-10-03 23:24 [PR PATCH] New package: duckyPad_Configurator-1.6.3 Calandracas606
  2025-01-03  1:59 ` github-actions
@ 2025-01-03  2:01 ` Calandracas606
  2025-01-03  2:12 ` [PR PATCH] [Updated] " Calandracas606
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Calandracas606 @ 2025-01-03  2:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/52484#issuecomment-2568606019

Comment:
bump


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Updated] New package: duckyPad_Configurator-1.6.3
  2024-10-03 23:24 [PR PATCH] New package: duckyPad_Configurator-1.6.3 Calandracas606
  2025-01-03  1:59 ` github-actions
  2025-01-03  2:01 ` Calandracas606
@ 2025-01-03  2:12 ` Calandracas606
  2025-04-04  2:05 ` github-actions
  2025-04-18  2:05 ` [PR PATCH] [Closed]: " github-actions
  4 siblings, 0 replies; 6+ messages in thread
From: Calandracas606 @ 2025-01-03  2:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1385 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages duckPad_Configurator
https://github.com/void-linux/void-packages/pull/52484

New package: duckyPad_Configurator-1.6.3
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**


#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**


<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - i686
  - aarch64 (cross)
  - aarch64-musl (cross)
  - armv7l (cross)
  - armv7l-musl (cross)
  - armv6l (cross)
  - armv6l-musl (cross)



A patch file from https://github.com/void-linux/void-packages/pull/52484.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-duckPad_Configurator-52484.patch --]
[-- Type: text/x-diff, Size: 12525 bytes --]

From 096a63715b9f23161632f2337a7e674f912630cb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 3 Oct 2024 17:31:35 -0400
Subject: [PATCH 1/3] New package: python3-PyAutoGUI-0.9.54

---
 srcpkgs/python3-PyAutoGUI/template | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/python3-PyAutoGUI/template

diff --git a/srcpkgs/python3-PyAutoGUI/template b/srcpkgs/python3-PyAutoGUI/template
new file mode 100644
index 00000000000000..c169fa181b9a2c
--- /dev/null
+++ b/srcpkgs/python3-PyAutoGUI/template
@@ -0,0 +1,18 @@
+# Template file for 'python3-PyAutoGUI'
+pkgname=python3-PyAutoGUI
+version=0.9.54
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-xlib"
+short_desc="Cross-platform GUI automation Python module for human beings"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="BSD-3-Clause"
+homepage="https://github.com/asweigart/pyautogui"
+changelog="https://raw.githubusercontent.com/asweigart/pyautogui/refs/heads/master/CHANGES.txt"
+distfiles="${PYPI_SITE}/P/PyAutoGUI/PyAutoGUI-${version}.tar.gz"
+checksum=dd1d29e8fd118941cb193f74df57e5c6ff8e9253b99c7b04f39cfc69f3ae04b2
+
+post_install() {
+	vlicense LICENSE.txt
+}

From 75bddee1ecd4241d98685eb4d78b4b52159470b1 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 3 Oct 2024 19:18:45 -0400
Subject: [PATCH 2/3] python3-hid: update to 1.0.6.

---
 srcpkgs/python3-hid/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3-hid/template b/srcpkgs/python3-hid/template
index 325e3e2ea47cc5..6b5495e4defa34 100644
--- a/srcpkgs/python3-hid/template
+++ b/srcpkgs/python3-hid/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-hid'
 pkgname=python3-hid
-version=1.0.4
-revision=4
+version=1.0.6
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 depends="hidapi python3"
@@ -11,7 +11,7 @@ license="MIT"
 homepage="https://github.com/apmorton/pyhidapi"
 # Can't use PyPi as the tarball there doesn't include LICENSE
 distfiles="${homepage}/archive/refs/tags/${version}.tar.gz"
-checksum=b4a48e643cf345cf061edb287255a2cfb9778eb89756a915a5baf8eabfb3a0e0
+checksum=f2eb1228d824f41609f02681ab19d817fb3c933ba813d1134a84dc96def722f0
 make_check=no # Tests require removed python3-nose
 
 post_install() {

From 581783b9ae57c5ba95cff3072f419b5431571086 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Thu, 3 Oct 2024 19:18:55 -0400
Subject: [PATCH 3/3] New package: duckyPad_Configurator-1.6.3

---
 srcpkgs/duckyPad_Configurator/INSTALL         |   7 +
 .../files/20-duckyPad.rules                   |   1 +
 .../files/duckypad.desktop                    |   7 +
 .../files/duckypad_config                     |   3 +
 .../patches/pyhidapi.patch                    | 186 ++++++++++++++++++
 srcpkgs/duckyPad_Configurator/template        |  36 ++++
 6 files changed, 240 insertions(+)
 create mode 100644 srcpkgs/duckyPad_Configurator/INSTALL
 create mode 100644 srcpkgs/duckyPad_Configurator/files/20-duckyPad.rules
 create mode 100644 srcpkgs/duckyPad_Configurator/files/duckypad.desktop
 create mode 100644 srcpkgs/duckyPad_Configurator/files/duckypad_config
 create mode 100644 srcpkgs/duckyPad_Configurator/patches/pyhidapi.patch
 create mode 100644 srcpkgs/duckyPad_Configurator/template

diff --git a/srcpkgs/duckyPad_Configurator/INSTALL b/srcpkgs/duckyPad_Configurator/INSTALL
new file mode 100644
index 00000000000000..e6ee5d5c0e6c19
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/INSTALL
@@ -0,0 +1,7 @@
+#!/bin/sh
+case "${ACTION}" in
+post)
+	udevadm trigger
+	udevadm control --reload-rules
+	;;
+esac
diff --git a/srcpkgs/duckyPad_Configurator/files/20-duckyPad.rules b/srcpkgs/duckyPad_Configurator/files/20-duckyPad.rules
new file mode 100644
index 00000000000000..de8dd95e9f1b37
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/files/20-duckyPad.rules
@@ -0,0 +1 @@
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="d11c", TAG+="uaccess", TAG+="udev-acl"
diff --git a/srcpkgs/duckyPad_Configurator/files/duckypad.desktop b/srcpkgs/duckyPad_Configurator/files/duckypad.desktop
new file mode 100644
index 00000000000000..f944948f98f227
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/files/duckypad.desktop
@@ -0,0 +1,7 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Name=DuckyPad Configurator
+Icon=/usr/share/duckypad/_icon.ico
+Exec=python3 /usr/share/duckypad/duckypad_config.py
+Terminal=false
+Type=Application
diff --git a/srcpkgs/duckyPad_Configurator/files/duckypad_config b/srcpkgs/duckyPad_Configurator/files/duckypad_config
new file mode 100644
index 00000000000000..788d2bbe05eb6f
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/files/duckypad_config
@@ -0,0 +1,3 @@
+#!/usr/bin/sh
+cd /usr/share/duckypad
+exec python3 duckypad_config.py "$@"
diff --git a/srcpkgs/duckyPad_Configurator/patches/pyhidapi.patch b/srcpkgs/duckyPad_Configurator/patches/pyhidapi.patch
new file mode 100644
index 00000000000000..6dde8dbbc3e9db
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/patches/pyhidapi.patch
@@ -0,0 +1,186 @@
+diff --git a/pc_software/hid_op.py b/pc_software/hid_op.py
+index 40bdba59..bdf85589 100644
+--- a/pc_software/hid_op.py
++++ b/pc_software/hid_op.py
+@@ -66,7 +66,10 @@ HID_COMMAND_CREATE_DIR = 18
+ HID_COMMAND_DELETE_DIR = 19
+ HID_COMMAND_SW_RESET = 20
+ 
+-h = hid.device()
++if hasattr(hid, 'device'):
++    h = hid.device()
++else:
++    h = None
+ 
+ def _check_hid_err(result):
+     """
+@@ -92,13 +95,21 @@ def _read_duckypad():
+     return []
+ 
+ def duckypad_hid_init():
+-    duckypad_path = get_duckypad_path()
+-    if duckypad_path is None:
+-        raise OSError('duckyPad Not Found!')
+-    h.open_path(duckypad_path)
++    global h
++    if h and hasattr(hid, 'device'):
++        duckypad_path = get_duckypad_path()
++        if duckypad_path is None:
++           raise OSError('duckyPad Not Found!')
++        h.open_path(duckypad_path)
++    else:
++        try:
++            h = hid.Device(0x483, 0xd11c)
++        except:
++           raise OSError('duckyPad Not Found!')
+ 
+ def duckypad_hid_close():
+-    h.close()
++    if h:
++        h.close()
+ 
+ def duckypad_list_files(root_dir = None):
+     ret = []
+@@ -110,10 +121,16 @@ def duckypad_list_files(root_dir = None):
+         for x in range(0, len(root_dir)):
+             pc_to_duckypad_buf[3+x] = ord(root_dir[x])
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
++
+     while 1:
+         time.sleep(HID_WAIT_TIME)
+         result = _read_duckypad()
++        if isinstance(result, bytes):
++            result = list(iter(result))
+         if len(result) == 0 or result[2] == HID_RESPONSE_EOF:
+             break
+         _check_hid_err(result)
+@@ -129,7 +146,10 @@ def get_dp_info():
+     try:
+         duckypad_hid_close()
+         duckypad_hid_init()
+-        h.write(pc_to_duckypad_buf)
++        if hasattr(hid, 'device'):
++            h.write(pc_to_duckypad_buf)
++        else:
++            h.write(bytes(pc_to_duckypad_buf))
+         result = _read_duckypad()
+     except Exception as e:
+         print("get_dp_info:", e)
+@@ -139,6 +159,7 @@ def get_dp_info():
+ def is_dp_ready():
+     dp_info = get_dp_info()
+     if dp_info is None:
++        print("Err1")
+         return False, 'duckyPad not Found!'
+     if dp_info[2] == 0:
+         return True, 'All good!'
+@@ -148,7 +169,10 @@ def duckypad_hid_resume():
+     pc_to_duckypad_buf = [0] * PC_TO_DUCKYPAD_HID_BUF_SIZE
+     pc_to_duckypad_buf[0] = 5   # HID Usage ID, always 5
+     pc_to_duckypad_buf[2] = HID_COMMAND_OP_RESUME   # Command type
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+ def duckypad_read_file(file_dir):
+     print("duckypad_read_file", file_dir)
+@@ -159,7 +183,10 @@ def duckypad_read_file(file_dir):
+ 
+     for x in range(0, len(file_dir)):
+         pc_to_duckypad_buf[3+x] = ord(file_dir[x])
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+     
+     while 1:
+         time.sleep(HID_WAIT_TIME)
+@@ -239,7 +266,10 @@ def duckypad_open_file_for_writing(file_dir):
+     for x in range(0, len(file_dir)):
+         pc_to_duckypad_buf[3+x] = ord(file_dir[x])
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+     result = _read_duckypad()
+     _check_hid_err(result)
+@@ -249,7 +279,10 @@ def duckypad_close_file():
+     pc_to_duckypad_buf[0] = 5   # HID Usage ID, always 5
+     pc_to_duckypad_buf[2] = HID_COMMAND_CLOSE_FILE  # Command type
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+     result = _read_duckypad()
+     _check_hid_err(result)
+@@ -266,7 +299,10 @@ def duckypad_write_one_chunk(content):
+     for x in range(0, len(content)):
+         pc_to_duckypad_buf[3+x] = content[x]
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+     result = _read_duckypad()
+     _check_hid_err(result)
+@@ -285,7 +321,10 @@ def duckypad_delete_file(file_name):
+     for x in range(0, len(file_name)):
+         pc_to_duckypad_buf[3+x] = ord(file_name[x])
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+     result = _read_duckypad()
+     _check_hid_err(result)
+@@ -298,7 +337,10 @@ def duckypad_create_dir(dir_name):
+     for x in range(0, len(dir_name)):
+         pc_to_duckypad_buf[3+x] = ord(dir_name[x])
+ 
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+ 
+     result = _read_duckypad()
+     _check_hid_err(result)
+@@ -309,7 +351,10 @@ def duckypad_delete_dir(dir_name):
+     pc_to_duckypad_buf[2] = HID_COMMAND_DELETE_DIR  # Command type
+     for x in range(0, len(dir_name)):
+         pc_to_duckypad_buf[3+x] = ord(dir_name[x])
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
+     result = _read_duckypad()
+     _check_hid_err(result)
+ 
+@@ -392,4 +437,7 @@ def duckypad_hid_sw_reset():
+     pc_to_duckypad_buf = [0] * PC_TO_DUCKYPAD_HID_BUF_SIZE
+     pc_to_duckypad_buf[0] = 5   # HID Usage ID, always 5
+     pc_to_duckypad_buf[2] = HID_COMMAND_SW_RESET    # Command type
+-    h.write(pc_to_duckypad_buf)
++    if hasattr(hid, 'device'):
++        h.write(pc_to_duckypad_buf)
++    else:
++        h.write(bytes(pc_to_duckypad_buf))
diff --git a/srcpkgs/duckyPad_Configurator/template b/srcpkgs/duckyPad_Configurator/template
new file mode 100644
index 00000000000000..8cf71fa6a848f2
--- /dev/null
+++ b/srcpkgs/duckyPad_Configurator/template
@@ -0,0 +1,36 @@
+# Template file for 'duckyPad_Configurator'
+pkgname=duckyPad_Configurator
+version=1.6.3
+revision=1
+_duckypad_dir="usr/share/duckypad"
+pycompile_dirs="${_duckypad_dir}"
+build_wrksrc=pc_software
+depends="python3-tkinter python3-appdirs python3-hid python3-PyAutoGUI"
+short_desc="Companion app to configure duckyPad"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/dekuNukem/duckyPad"
+distfiles="https://github.com/dekuNukem/duckyPad/archive/refs/tags/${version}.tar.gz"
+checksum=67342c903f706c0bcfbb4f9f33925d75dd9eec85c0e1a89fea90ccec542d5c1c
+python_version=3.12
+
+do_install() {
+	vmkdir usr/share/applications
+	vinstall ${FILESDIR}/duckypad.desktop 755 usr/share/applications
+
+	vmkdir "${_duckypad_dir}"
+
+	rm _scrap.py
+	for _file in *.py; do
+		vinstall "${_file}" 644 "${_duckypad_dir}"
+	done
+
+	vinstall _icon.ico 644 "${_duckypad_dir}"
+
+	vmkdir usr/lib/udev/rules.d
+	vinstall ${FILESDIR}/20-duckyPad.rules 644 usr/lib/udev/rules.d
+
+	vbin ${FILESDIR}/duckypad_config
+
+	vlicense ../LICENSE
+}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: New package: duckyPad_Configurator-1.6.3
  2024-10-03 23:24 [PR PATCH] New package: duckyPad_Configurator-1.6.3 Calandracas606
                   ` (2 preceding siblings ...)
  2025-01-03  2:12 ` [PR PATCH] [Updated] " Calandracas606
@ 2025-04-04  2:05 ` github-actions
  2025-04-18  2:05 ` [PR PATCH] [Closed]: " github-actions
  4 siblings, 0 replies; 6+ messages in thread
From: github-actions @ 2025-04-04  2:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/52484#issuecomment-2777375785

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Closed]: New package: duckyPad_Configurator-1.6.3
  2024-10-03 23:24 [PR PATCH] New package: duckyPad_Configurator-1.6.3 Calandracas606
                   ` (3 preceding siblings ...)
  2025-04-04  2:05 ` github-actions
@ 2025-04-18  2:05 ` github-actions
  4 siblings, 0 replies; 6+ messages in thread
From: github-actions @ 2025-04-18  2:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1202 bytes --]

There's a closed pull request on the void-packages repository

New package: duckyPad_Configurator-1.6.3
https://github.com/void-linux/void-packages/pull/52484

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**


#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**


<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - i686
  - aarch64 (cross)
  - aarch64-musl (cross)
  - armv7l (cross)
  - armv7l-musl (cross)
  - armv6l (cross)
  - armv6l-musl (cross)



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-18  2:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-03 23:24 [PR PATCH] New package: duckyPad_Configurator-1.6.3 Calandracas606
2025-01-03  1:59 ` github-actions
2025-01-03  2:01 ` Calandracas606
2025-01-03  2:12 ` [PR PATCH] [Updated] " Calandracas606
2025-04-04  2:05 ` github-actions
2025-04-18  2:05 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).