Skip to content

Commit

Permalink
Merge pull request #1891 from pentoo/python3_12_testing
Browse files Browse the repository at this point in the history
python3 12 testing
  • Loading branch information
github-actions[bot] authored May 10, 2024
2 parents 4d0fdc1 + cfbd771 commit 3f6a018
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 6 deletions.
42 changes: 42 additions & 0 deletions net-wireless/mousejack/files/mousejack
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh

usage() {
printf "The following firmware's are supported:\n"
printf "Nordic Semiconductor Bootloader\n"
printf "CrazyRadio Firmware\n"
printf "RFStorm Research Firmware\n"
printf "run \"mousejack install\"\n\n"
printf "To flash Logitech Unifying Dongle C-U0007\n"
printf "run \"mousejack logitech_install\"\n\n"
}

if [ -z "${1}" ]; then
usage
exit 1
fi

#parse args
while true; do
case $1 in
-h|--help)
usage
exit 0
;;
install)
/usr/share/mousejack/prog/usb-flash.py /usr/share/mousejack/dongle.bin
exit $?
;;
logitech_install)
/usr/share/mousejack/prog/logitech-usb-flash.py /usr/share/mousejack/dongle.formatted.bin /usr/share/mousejack/dongle.formatted.ihx
exit $?
;;
--)
shift
break
;;
*)
break
;;
esac
shift
done
11 changes: 11 additions & 0 deletions net-wireless/mousejack/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Zero_Chaos</name>
</maintainer>
<upstream>
<remote-id type="github">kuzmin-no/nrf-research-firmware-python3</remote-id>
</upstream>
</pkgmetadata>
53 changes: 53 additions & 0 deletions net-wireless/mousejack/mousejack-9999.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
inherit python-single-r1

DESCRIPTION="Firmware and research tools for nRF24LU1+ based USB dongles and breakout boards"
HOMEPAGE="https://www.mousejack.com/"
if [ "${PV}" = "9999" ]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/kuzmin-no/nrf-research-firmware-python3.git"
else
COMMIT="e4de36685d9f9161430e724ce0e63f8c850e0fba"
SRC_URI="https://github.com/kuzmin-no/nrf-research-firmware-python3/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/nrf-research-firmware-${COMMIT}"
KEYWORDS="~amd64 ~x86"
fi

LICENSE="GPL-3+"
SLOT="0"
REQUIRED_USE=${PYTHON_REQUIRED_USE}

DEPEND="dev-embedded/sdcc[device-lib,mcs51]"
RDEPEND="${DEPEND}
${PYTHON_DEPS}
dev-embedded/platformio[${PYTHON_SINGLE_USEDEP}]
$(python_gen_cond_dep '
dev-python/pyusb[${PYTHON_USEDEP}]
')"

src_prepare() {
mv tools/lib tools/nrf24 || die
# This is needed, qa warning is false because this is a no-op on tools/nrf24-reset-radio.py
for file in tools/nrf24-*; do
sed -i 's#from lib#from nrf24#' ${file} || die
done
default
}
src_install() {
insinto /usr/share/${PN}
doins bin/dongle.{bin,formatted.bin,formatted.ihx}

python_domodule tools/nrf24
python_doscript tools/nrf24-*

python_scriptinto /usr/share/${PN}/prog
python_doscript prog/usb-flasher/usb-flash.py
python_doscript prog/usb-flasher/logitech-usb-flash.py
python_doscript prog/usb-flasher/unifying.py

dosbin "${FILESDIR}/mousejack"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"

IUSE="gui"

#future needed until https://github.com/atlas0fd00m/rfcat/issues/158
DEPEND=">=dev-python/pyusb-1.0.0[${PYTHON_USEDEP}]
virtual/libusb:1
dev-python/future[${PYTHON_USEDEP}]
dev-python/ipython[${PYTHON_USEDEP}]
dev-python/pyserial[${PYTHON_USEDEP}]
dev-python/numpy[${PYTHON_USEDEP}]
gui? ( >=dev-python/pyside2-5.12.0[${PYTHON_USEDEP}] )
"
RDEPEND="${DEPEND}"

Expand Down
5 changes: 2 additions & 3 deletions profiles/pentoo/zero-system/make.defaults
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
ACCEPT_LICENSE="${ACCEPT_LICENSE} NVIDIA-CUDA android google-chrome Google-TOS baudline Intel-SDP Nero-AAC-EULA ms-teams-pre PUEL PUEL-11"

USE="gentoo-dev pentoo-extra zsh-completion -semantic-desktop"
#USE="${USE} python_targets_python3_12"
USE="${USE} pipewire"
USE="pentoo-extra zsh-completion -semantic-desktop"
USE="${USE} python_targets_python3_12"

PORTAGE_GPG_DIR="/home/zero/.gnupg/"
PORTAGE_GPG_KEY="0xA5DD1427DD11F94A"
Expand Down
1 change: 1 addition & 0 deletions profiles/pentoo/zero-system/package.use/sys-apps
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sys-apps/portage gentoo-dev
3 changes: 3 additions & 0 deletions scripts/git_local_prune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
# This script automatically deletes any local branches which have been merged
git branch --merged | grep -v master | xargs git branch -d

0 comments on commit 3f6a018

Please sign in to comment.