Skip to content

Commit

Permalink
mousejack: add working 3.12 version
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroChaos- committed May 10, 2024
1 parent 16190ca commit 37787df
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 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"
}

0 comments on commit 37787df

Please sign in to comment.