put the built uf2 in the package
This commit is contained in:
parent
67c278cb8c
commit
486b78b550
|
@ -7,26 +7,43 @@ pkgdesc="dragnbus host tools"
|
||||||
arch=("any")
|
arch=("any")
|
||||||
url="https://git.lain.faith/sys64738/DapperMime-JTAG"
|
url="https://git.lain.faith/sys64738/DapperMime-JTAG"
|
||||||
license=("GPL")
|
license=("GPL")
|
||||||
|
provides=("$_pkgbase")
|
||||||
|
conflicts=("$_pkgbase")
|
||||||
depends=("udev" "python" "python-pyserial")
|
depends=("udev" "python" "python-pyserial")
|
||||||
makedepends=()
|
makedepends=("raspberry-pico-sdk" "ninja")
|
||||||
source=("file://$PWD/../10-dragnbus.rules"
|
optdepends=("picotool: for flashing the firmware on the CLI")
|
||||||
"file://$PWD/../dbctl.py")
|
source=("repo::git+file://$PWD/../../")
|
||||||
sha256sums=(SKIP SKIP)
|
sha256sums=(SKIP)
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd repo
|
||||||
|
git submodule init
|
||||||
|
git submodule update CMSIS_5
|
||||||
|
}
|
||||||
|
|
||||||
build() {
|
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 dbctl.py
|
||||||
python -m compileall -o 2 dbctl.py
|
python -m compileall -o 2 dbctl.py
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
|
cd repo
|
||||||
install -dm755 "$pkgdir/usr/share/licenses/dragnbus/"
|
install -dm755 "$pkgdir/usr/share/licenses/dragnbus/"
|
||||||
install -dm755 "$pkgdir/usr/bin/"
|
install -dm755 "$pkgdir/usr/bin/"
|
||||||
ln -s /usr/share/licenses/common/GPL3/license.txt \
|
ln -s /usr/share/licenses/common/GPL3/license.txt \
|
||||||
"$pkgdir/usr/share/licenses/dragnbus/license.txt"
|
"$pkgdir/usr/share/licenses/dragnbus/license.txt"
|
||||||
|
|
||||||
install -Dm755 dbctl.py "$pkgdir/usr/lib/dragnbus/dbctl.py"
|
install -Dm755 host/dbctl.py "$pkgdir/usr/lib/dragnbus/dbctl.py"
|
||||||
install -Dm644 -t "$pkgdir/usr/lib/dragnbus/__pycache__/" __pycache__/*
|
install -Dm644 -t "$pkgdir/usr/lib/dragnbus/__pycache__/" host/__pycache__/*
|
||||||
ln -s "/usr/lib/dragnbus/dbctl.py" "$pkgdir/usr/bin/dbctl"
|
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"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import argparse, serial, struct
|
import argparse, serial, struct, os
|
||||||
from typing import *
|
from typing import *
|
||||||
|
|
||||||
def auto_int(x):
|
def auto_int(x):
|
||||||
|
@ -121,6 +121,9 @@ def main():
|
||||||
parser.add_argument('-v', '--verbose', default=False, action='store_true',
|
parser.add_argument('-v', '--verbose', default=False, action='store_true',
|
||||||
help="Verbose logging (for this utility)")
|
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():
|
for k, v in option_table.items():
|
||||||
if k == "support":
|
if k == "support":
|
||||||
parser.add_argument('--%s'%k, default=None, action='store_true',
|
parser.add_argument('--%s'%k, default=None, action='store_true',
|
||||||
|
@ -131,6 +134,10 @@ def main():
|
||||||
|
|
||||||
args = parser.parse_args()
|
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():
|
for k, v in option_table.items():
|
||||||
if args.__dict__[k] is not None:
|
if args.__dict__[k] is not None:
|
||||||
resp = do_xfer(args, v.optid, val2byte(v.type, args.__dict__[k]), args.tty)
|
resp = do_xfer(args, v.optid, val2byte(v.type, args.__dict__[k]), args.tty)
|
||||||
|
|
Loading…
Reference in New Issue