summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Sovetkin2016-06-14 18:42:26 +0200
committerEugene Sovetkin2016-06-14 18:42:26 +0200
commita3618e73eec5735d762e539d8d4b8333b4c3757e (patch)
tree249bc393677f8e8e368325f712a025b7c14599dc
downloadaur-a3618e73eec5735d762e539d8d4b8333b4c3757e.tar.gz
initial commit
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD35
-rw-r--r--qasm2pdf.patch56
-rw-r--r--qasm2png.patch63
-rw-r--r--qasm2tex.patch13
5 files changed, 191 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..1e976572cdcc
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+# Generated by mksrcinfo v8
+# Tue Jun 14 16:41:52 UTC 2016
+pkgbase = qasm2circ
+ pkgdesc = Quantum circuit viewer
+ pkgver = 1.4
+ pkgrel = 1
+ url = http://www.media.mit.edu/quanta/qasm2circ/
+ arch = any
+ license = unknown
+ depends = python2
+ optdepends = ghostscript
+ optdepends = netpbm
+ optdepends = texlive-most
+ source = http://www.media.mit.edu/quanta/qasm2circ/qasm2circ-v1.4.tgz
+ source = qasm2tex.patch
+ source = qasm2pdf.patch
+ source = qasm2png.patch
+ md5sums = 3621c141703beead2e5a8b007561bf75
+ md5sums = 6c12a341aca1c1613ebd4c58e306ac44
+ md5sums = 93b2c20f5dba43b28a63e28a677a7f80
+ md5sums = f6adb71b4a8ba1dfcd4572eee5a65c44
+
+pkgname = qasm2circ
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b7200d42a8a9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,35 @@
+# Maintainer: Jenya Sovetkin <e.sovetkin at gmail com>
+pkgname=qasm2circ
+pkgver=1.4
+pkgrel=1
+pkgdesc="Quantum circuit viewer"
+arch=(any)
+license=('unknown')
+url="http://www.media.mit.edu/quanta/qasm2circ/"
+depends=('python2')
+optdepends=('ghostscript' 'netpbm' 'texlive-most')
+source=('http://www.media.mit.edu/quanta/qasm2circ/qasm2circ-v1.4.tgz'
+ 'qasm2tex.patch'
+ 'qasm2pdf.patch'
+ 'qasm2png.patch')
+md5sums=('3621c141703beead2e5a8b007561bf75'
+ '6c12a341aca1c1613ebd4c58e306ac44'
+ '93b2c20f5dba43b28a63e28a677a7f80'
+ 'f6adb71b4a8ba1dfcd4572eee5a65c44')
+
+prepare() {
+ cd "$pkgname-v$pkgver"
+ patch -p1 -i "$srcdir/qasm2tex.patch"
+ patch -p1 -i "$srcdir/qasm2pdf.patch"
+ patch -p1 -i "$srcdir/qasm2png.patch"
+}
+
+package() {
+ cd "$pkgname-v$pkgver"
+
+ install -Dm 755 qasm2tex.py "${pkgdir}/usr/bin/qasm2tex"
+ install -Dm 755 qasm2pdf "${pkgdir}/usr/bin/qasm2pdf"
+
+ ## I didn't manage to make it work yet
+ # install -Dm 755 qasm2png "${pkgdir}/usr/bin/qasm2png"
+}
diff --git a/qasm2pdf.patch b/qasm2pdf.patch
new file mode 100644
index 000000000000..5edfd66c94c9
--- /dev/null
+++ b/qasm2pdf.patch
@@ -0,0 +1,56 @@
+diff --git a/qasm2pdf b/qasm2pdf
+index 3ac2123..c3f1e1f 100755
+--- a/qasm2pdf
++++ b/qasm2pdf
+@@ -1,25 +1,32 @@
+-#!/bin/csh
++#!/bin/bash
+ #
+ # File: qasm2pdf
+ # Date: 23-Mar-04
+ # Author: I. Chuang <ichuang@mit.edu>
+ #
++# Date: 14-Jun-16
++# Edited: J. Sovetkin <e.sovetkin@gmail.com>
++#
+ # Shell script to convert qasm files to pdf, using the qasm2tex python script
+ #
+-# Usage: qasm2pdf foo.qasm
++# Usage: qasm2pdf foo1.qasm dir/foo2.qasm
+ #
+-# Produces: foo.pdf (and also foo.tex, foo.epsf)
+-
+-foreach i ($*)
+-
+- set t = `echo $i | sed "s/.qasm//"`
++# Produces: foo1.pdf and foo2.pdf in the correspoding directories (and
++# also foo.tex, foo.epsf)
+
+- python qasm2tex.py $i >! $t.tex
+- if (-z $t.tex) then
+- echo "error in qasm2tex on $t.tex! aborting."
+- else
+- latex $t
+- dvips -D2400 -E -o $t.eps $t
+- epstopdf $t.eps
+- endif
+-end
++for file in "$@"
++do
++ local filename
++ filename="${filename%.*}"
++
++ qasm2tex ${file} > ${filename}.tex
++
++ if [[ ! -f ${filename}.tex ]]
++ then
++ echo "error in qasm2tex on ${filename}.tex! aborting."
++ else
++ latex ${filename}
++ dvips -D2400 -E -o ${filename}.eps ${filename}
++ epstopdf ${filename}.eps
++ fi
++done
+--
+2.8.3
+
diff --git a/qasm2png.patch b/qasm2png.patch
new file mode 100644
index 000000000000..fbf4727a6282
--- /dev/null
+++ b/qasm2png.patch
@@ -0,0 +1,63 @@
+diff --git a/qasm2png b/qasm2png
+index f4cc8b8..2a3a4be 100755
+--- a/qasm2png
++++ b/qasm2png
+@@ -1,29 +1,35 @@
+-#!/bin/csh
++#!/bin/bash
+ #
+ # File: qasm2png
+ # Date: 23-Mar-04
+ # Author: I. Chuang <ichuang@mit.edu>
+ #
++# Date: 14-Jun-16
++# Edited: J. Sovetkin <e.sovetkin@gmail.com>
++#
+ # Shell script to convert qasm files to png, using the qasm2tex python script
+ #
+-# Usage: qasm2png foo.qasm
++# Usage: qasm2png foo.qasm dir/foo2.qasm
+ #
+-# Produces: foo.png (and also foo.tex, foo.epsf)
+-
+-set GS = "gs -sDEVICE=pnmraw -r400 -dNOPAUSE"
+-
+-foreach i ($*)
+-
+- set t = `echo $i | sed "s/.qasm//"`
++# Produces: foo1.png and foo2.png in the corresponding directories
++# (and also foo.tex, foo.epsf)
+
+- python qasm2tex.py $i >! $t.tex
+- if (-z $t.tex) then
+- echo "error in qasm2tex on $t.tex! aborting."
+- else
+- latex $t
+- dvips -D2400 -E -o $t.eps $t
+- ${GS} -sOutputFile=$t.pbm $t.eps -c quit
+- pnmcrop $t.pbm | pnmtopng >! $t.png
+- rm -f $t.pbm
+- endif
+-end
++for file in "$@"
++do
++ local filename
++ filename="${filename%.*}"
++
++ qasm2tex ${file} > ${filename}.tex
++
++ if [[ ! -f ${filename}.tex ]]
++ then
++ echo "error in qasm2tex on ${filename}.tex! aborting."
++ else
++ latex ${filename}
++ dvips -D2400 -E -o ${filename}.eps ${filename}
++ gs -sDEVICE=pnmraw -r400 -dNOPAUSE \
++ -sOutputFile=${filename}.pbm ${filename}.eps -c quit
++ pnmcrop ${filename}.pbm | pnmtopng >! ${filename}.png
++ rm -f ${filename}.pbm
++ fi
++done
+--
+2.8.3
+
diff --git a/qasm2tex.patch b/qasm2tex.patch
new file mode 100644
index 000000000000..ecd4f5de03f5
--- /dev/null
+++ b/qasm2tex.patch
@@ -0,0 +1,13 @@
+diff --git a/qasm2tex.py b/qasm2tex.py
+index 422c3ff..9cf579b 100755
+--- a/qasm2tex.py
++++ b/qasm2tex.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python2.7
+ #
+ # File: qasm2tex.py
+ # Date: 22-Mar-04
+--
+2.8.3
+