put the built uf2 in the package

This commit is contained in:
xenia 2021-06-30 02:14:22 -04:00
parent 67c278cb8c
commit 486b78b550
2 changed files with 32 additions and 8 deletions

View File

@ -7,26 +7,43 @@ pkgdesc="dragnbus host tools"
arch=("any")
url="https://git.lain.faith/sys64738/DapperMime-JTAG"
license=("GPL")
provides=("$_pkgbase")
conflicts=("$_pkgbase")
depends=("udev" "python" "python-pyserial")
makedepends=()
source=("file://$PWD/../10-dragnbus.rules"
"file://$PWD/../dbctl.py")
sha256sums=(SKIP SKIP)
makedepends=("raspberry-pico-sdk" "ninja")
optdepends=("picotool: for flashing the firmware on the CLI")
source=("repo::git+file://$PWD/../../")
sha256sums=(SKIP)
prepare() {
cd repo
git submodule init
git submodule update CMSIS_5
}
build() {
cd repo
export CFLAGS= CPPFLAGS= CXXFLAGS=
./scripts/configure_dev.sh
cd cmake-build
ninja
cd ../host
python -m compileall dbctl.py
python -m compileall -o 2 dbctl.py
}
package() {
cd repo
install -dm755 "$pkgdir/usr/share/licenses/dragnbus/"
install -dm755 "$pkgdir/usr/bin/"
ln -s /usr/share/licenses/common/GPL3/license.txt \
"$pkgdir/usr/share/licenses/dragnbus/license.txt"
install -Dm755 dbctl.py "$pkgdir/usr/lib/dragnbus/dbctl.py"
install -Dm644 -t "$pkgdir/usr/lib/dragnbus/__pycache__/" __pycache__/*
install -Dm755 host/dbctl.py "$pkgdir/usr/lib/dragnbus/dbctl.py"
install -Dm644 -t "$pkgdir/usr/lib/dragnbus/__pycache__/" host/__pycache__/*
ln -s "/usr/lib/dragnbus/dbctl.py" "$pkgdir/usr/bin/dbctl"
install -Dm644 10-dragnbus.rules "$pkgdir/usr/lib/udev/rules.d/10-dragnbus.rules"
install -Dm644 host/10-dragnbus.rules "$pkgdir/usr/lib/udev/rules.d/10-dragnbus.rules"
install -Dm644 cmake-build/repo.uf2 "$pkgdir/usr/share/dragnbus/dragnbus.uf2"
}

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
import argparse, serial, struct
import argparse, serial, struct, os
from typing import *
def auto_int(x):
@ -121,6 +121,9 @@ def main():
parser.add_argument('-v', '--verbose', default=False, action='store_true',
help="Verbose logging (for this utility)")
parser.add_argument('-f', '--flash', default=False, action='store_true',
help="Flash firmware to attached pico")
for k, v in option_table.items():
if k == "support":
parser.add_argument('--%s'%k, default=None, action='store_true',
@ -131,6 +134,10 @@ def main():
args = parser.parse_args()
if args.flash:
os.system("picotool load -x /usr/share/dragnbus/dragnbus.uf2")
return
for k, v in option_table.items():
if args.__dict__[k] is not None:
resp = do_xfer(args, v.optid, val2byte(v.type, args.__dict__[k]), args.tty)