Skip to content

Commit 30842a7

Browse files
author
whitequark
committedOct 22, 2015
conda: include udev rules and artiq_flash.sh in artiq package.
1 parent 026504e commit 30842a7

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed
 

Diff for: ‎artiq/frontend/artiq_flash.sh

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
#!/bin/bash
1+
#!/usr/bin/env python
2+
# conda-build requires all scripts to have a python shebang.
3+
# see https://github.com/conda/conda-build/blob/6921f067a/conda_build/noarch_python.py#L36-L38
24

5+
def run(script):
6+
import sys, tempfile, subprocess
7+
file = tempfile.NamedTemporaryFile(mode='w+t', suffix='sh')
8+
file.write(script)
9+
file.flush()
10+
subprocess.run(["/bin/bash", file.name] + sys.argv[1:])
11+
file.close()
12+
13+
run("""
314
# exit on error
415
set -e
516
# print commands
@@ -72,7 +83,7 @@ do
7283
echo ""
7384
echo "To flash everything, do not use any of the -b|-B|-r option."
7485
echo ""
75-
echo "usage: $0 [-b] [-B] [-r] [-h] [-m nist_qc1|nist_qc2] [-t kc705|pipistrello] [-d path] [-f path]"
86+
echo "usage: artiq_flash.sh [-b] [-B] [-r] [-h] [-m nist_qc1|nist_qc2] [-t kc705|pipistrello] [-d path] [-f path]"
7687
echo "-b Flash bitstream"
7788
echo "-B Flash BIOS"
7889
echo "-r Flash ARTIQ runtime"
@@ -193,3 +204,4 @@ then
193204
fi
194205
echo "Done."
195206
xc3sprog -v -c $CABLE -R > /dev/null 2>&1
207+
""")

Diff for: ‎conda/artiq/build.sh

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
#!/bin/bash
22

3+
ARTIQ_PREFIX=$PREFIX/lib/python3.5/site-packages/artiq
4+
35
$PYTHON setup.py install --single-version-externally-managed --record=record.txt
6+
7+
# install scripts
8+
9+
cp artiq/frontend/artiq_flash.sh $PREFIX/bin
10+
11+
# install udev rules
12+
13+
mkdir -p $ARTIQ_PREFIX/misc
14+
cp misc/99-papilio.rules $ARTIQ_PREFIX/misc/
15+
cp misc/99-kc705.rules $ARTIQ_PREFIX/misc/

0 commit comments

Comments
 (0)
Please sign in to comment.