Skip to content

Commit

Permalink
conda: include udev rules and artiq_flash.sh in artiq package.
Browse files Browse the repository at this point in the history
whitequark committed Oct 22, 2015
1 parent 026504e commit 30842a7
Showing 2 changed files with 26 additions and 2 deletions.
16 changes: 14 additions & 2 deletions artiq/frontend/artiq_flash.sh
Original file line number Diff line number Diff line change
@@ -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
""")
12 changes: 12 additions & 0 deletions conda/artiq/build.sh
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit 30842a7

Please sign in to comment.