2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-26 03:38:25 +08:00

conda: include udev rules and artiq_flash.sh in artiq package.

This commit is contained in:
whitequark 2015-10-22 17:18:59 +03:00
parent 026504e578
commit 30842a7174
2 changed files with 26 additions and 2 deletions

View File

@ -1,5 +1,16 @@
#!/bin/bash
#!/usr/bin/env python
# conda-build requires all scripts to have a python shebang.
# see https://github.com/conda/conda-build/blob/6921f067a/conda_build/noarch_python.py#L36-L38
def run(script):
import sys, tempfile, subprocess
file = tempfile.NamedTemporaryFile(mode='w+t', suffix='sh')
file.write(script)
file.flush()
subprocess.run(["/bin/bash", file.name] + sys.argv[1:])
file.close()
run("""
# exit on error
set -e
# print commands
@ -72,7 +83,7 @@ do
echo ""
echo "To flash everything, do not use any of the -b|-B|-r option."
echo ""
echo "usage: $0 [-b] [-B] [-r] [-h] [-m nist_qc1|nist_qc2] [-t kc705|pipistrello] [-d path] [-f path]"
echo "usage: artiq_flash.sh [-b] [-B] [-r] [-h] [-m nist_qc1|nist_qc2] [-t kc705|pipistrello] [-d path] [-f path]"
echo "-b Flash bitstream"
echo "-B Flash BIOS"
echo "-r Flash ARTIQ runtime"
@ -193,3 +204,4 @@ then
fi
echo "Done."
xc3sprog -v -c $CABLE -R > /dev/null 2>&1
""")

View File

@ -1,3 +1,15 @@
#!/bin/bash
ARTIQ_PREFIX=$PREFIX/lib/python3.5/site-packages/artiq
$PYTHON setup.py install --single-version-externally-managed --record=record.txt
# install scripts
cp artiq/frontend/artiq_flash.sh $PREFIX/bin
# install udev rules
mkdir -p $ARTIQ_PREFIX/misc
cp misc/99-papilio.rules $ARTIQ_PREFIX/misc/
cp misc/99-kc705.rules $ARTIQ_PREFIX/misc/