1 |
commit: f7e784db2ef31b9df95670407c28cd6d740a597a |
2 |
Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 30 05:41:12 2019 +0000 |
4 |
Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 30 05:41:12 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=f7e784db |
7 |
|
8 |
sci-physics/qcl: multiple improvements |
9 |
|
10 |
- Update to EAPI 7 |
11 |
- Fix dependencies (RDEPEND were wrong) |
12 |
- Install additional documentation |
13 |
- Respect CFLAGS for qc lib as well |
14 |
- Fix install paths so that qcl can find its lib |
15 |
|
16 |
Package-Manager: Portage-2.3.58, Repoman-2.3.12 |
17 |
Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org> |
18 |
|
19 |
sci-physics/qcl/files/qcl-0.6.4-Makefile.patch | 69 ++++++++++++++++++++++++++ |
20 |
sci-physics/qcl/qcl-0.6.4-r2.ebuild | 55 ++++++++++++++++++++ |
21 |
2 files changed, 124 insertions(+) |
22 |
|
23 |
diff --git a/sci-physics/qcl/files/qcl-0.6.4-Makefile.patch b/sci-physics/qcl/files/qcl-0.6.4-Makefile.patch |
24 |
new file mode 100644 |
25 |
index 000000000..bbc3f0abd |
26 |
--- /dev/null |
27 |
+++ b/sci-physics/qcl/files/qcl-0.6.4-Makefile.patch |
28 |
@@ -0,0 +1,69 @@ |
29 |
+diff --git a/Makefile b/Makefile |
30 |
+index 2735f71..80f9b30 100644 |
31 |
+--- a/Makefile |
32 |
++++ b/Makefile |
33 |
+@@ -14,11 +14,11 @@ VERSION=0.6.4 |
34 |
+ |
35 |
+ # Directory for Standard .qcl files |
36 |
+ |
37 |
+-QCLDIR = /usr/local/lib/qcl |
38 |
++QCLDIR = /usr/lib/qcl |
39 |
+ |
40 |
+ # Path for qcl binaries |
41 |
+ |
42 |
+-QCLBIN = /usr/local/bin |
43 |
++QCLBIN = /usr/bin |
44 |
+ |
45 |
+ ARCH = `g++ -dumpmachine || echo bin` |
46 |
+ |
47 |
+@@ -32,7 +32,7 @@ ARCH = `g++ -dumpmachine || echo bin` |
48 |
+ |
49 |
+ #DEBUG = -g -pg -DQCL_DEBUG -DQC_DEBUG |
50 |
+ #DEBUG = -g -DQCL_DEBUG -DQC_DEBUG |
51 |
+-DEBUG = -O2 -g -DQCL_DEBUG -DQC_DEBUG |
52 |
++DEBUG = -DQCL_DEBUG -DQC_DEBUG |
53 |
+ #DEBUG = -O2 |
54 |
+ |
55 |
+ # Plotting support |
56 |
+@@ -81,8 +81,8 @@ QCLINC = lib |
57 |
+ |
58 |
+ #CXX = g++ |
59 |
+ #CPP = $(CC) -E |
60 |
+-CXXFLAGS = -c $(ARCHOPT) $(DEBUG) $(PLOPT) $(RLOPT) $(IRQOPT) $(ENCOPT) -I$(QCDIR) -DDEF_INCLUDE_PATH="\"$(QCLDIR)\"" |
61 |
+-LDFLAGS = $(ARCHOPT) -L$(QCDIR) $(DEBUG) $(PLLIB) -lm -lfl -lqc $(RLLIB) |
62 |
++CXXFLAGS += -c $(DEBUG) $(PLOPT) $(RLOPT) $(IRQOPT) $(ENCOPT) -I$(QCDIR) -DDEF_INCLUDE_PATH="\"$(QCLDIR)\"" |
63 |
++LIBS = -L$(QCDIR) $(PLLIB) -lm -lfl -lqc $(RLLIB) |
64 |
+ |
65 |
+ FILESCC = $(wildcard *.cc) |
66 |
+ FILESH = $(wildcard *.h) |
67 |
+@@ -127,7 +127,7 @@ $(QCLIB): |
68 |
+ build: qcl $(QCLINC)/default.qcl |
69 |
+ |
70 |
+ qcl: $(OBJECTS) qcl.o $(QCLIB) |
71 |
+- $(CXX) $(OBJECTS) qcl.o $(LDFLAGS) -o qcl |
72 |
++ $(CXX) $(LDFLAGS) $(OBJECTS) qcl.o $(LIBS) -o qcl |
73 |
+ |
74 |
+ $(QCLINC)/default.qcl: extern.cc |
75 |
+ grep "^//!" extern.cc | cut -c5- > $(QCLINC)/default.qcl |
76 |
+diff --git a/qc/Makefile b/qc/Makefile |
77 |
+index 191ffe5..79724a9 100644 |
78 |
+--- a/qc/Makefile |
79 |
++++ b/qc/Makefile |
80 |
+@@ -16,7 +16,7 @@ |
81 |
+ |
82 |
+ # Debugging options |
83 |
+ |
84 |
+-DEBUG = -g -O2 -DQC_DEBUG |
85 |
++#DEBUG = -g -O2 -DQC_DEBUG |
86 |
+ #DEBUG = -g -pg -DQC_DEBUG |
87 |
+ #DEBUG = -O2 |
88 |
+ |
89 |
+@@ -25,7 +25,7 @@ DEBUG = -g -O2 -DQC_DEBUG |
90 |
+ |
91 |
+ #PRGOPT = -DQC_USE_RAND48 |
92 |
+ |
93 |
+-CXXFLAGS = $(ARCHOPT) -c -pedantic -Wall $(DEBUG) $(PRGOPT) |
94 |
++CXXFLAGS += $(ARCHOPT) -c -pedantic -Wall $(DEBUG) $(PRGOPT) |
95 |
+ |
96 |
+ LDFLAGS = $(ARCHOPT) -L. -lm -lqc |
97 |
+ |
98 |
|
99 |
diff --git a/sci-physics/qcl/qcl-0.6.4-r2.ebuild b/sci-physics/qcl/qcl-0.6.4-r2.ebuild |
100 |
new file mode 100644 |
101 |
index 000000000..b7eb2536b |
102 |
--- /dev/null |
103 |
+++ b/sci-physics/qcl/qcl-0.6.4-r2.ebuild |
104 |
@@ -0,0 +1,55 @@ |
105 |
+# Copyright 1999-2019 Gentoo Authors |
106 |
+# Distributed under the terms of the GNU General Public License v2 |
107 |
+ |
108 |
+EAPI=7 |
109 |
+ |
110 |
+DESCRIPTION="Quantum Computation Language with an emulator of a quantum computer" |
111 |
+HOMEPAGE="http://tph.tuwien.ac.at/~oemer/qcl.html" |
112 |
+SRC_URI=" |
113 |
+ http://tph.tuwien.ac.at/~oemer/tgz/${P}.tgz |
114 |
+ doc? ( |
115 |
+ http://tph.tuwien.ac.at/~oemer/doc/structquprog.pdf |
116 |
+ http://tph.tuwien.ac.at/~oemer/doc/qcldoc.pdf |
117 |
+ http://tph.tuwien.ac.at/~oemer/doc/quprog.pdf |
118 |
+ https://dev.gentoo.org/~bircoph/distfiles/0211100.pdf -> ccquprog.pdf |
119 |
+ )" |
120 |
+ |
121 |
+SLOT="0" |
122 |
+LICENSE="GPL-2" |
123 |
+KEYWORDS="~amd64 ~x86" |
124 |
+IUSE="doc plotutils readline" |
125 |
+ |
126 |
+BDEPEND=" |
127 |
+ sys-devel/bison |
128 |
+ sys-devel/flex" |
129 |
+DEPEND=" |
130 |
+ plotutils? ( media-libs/plotutils[X,png] ) |
131 |
+ readline? ( |
132 |
+ sys-libs/ncurses:0= |
133 |
+ sys-libs/readline:0= |
134 |
+ )" |
135 |
+RDEPEND="${DEPEND}" |
136 |
+ |
137 |
+PATCHES=( |
138 |
+ "${FILESDIR}/${PN}"-0.6.3-gcc43.patch |
139 |
+ "${FILESDIR}/${P}"-Makefile.patch |
140 |
+) |
141 |
+ |
142 |
+src_configure() { |
143 |
+ # there is no configure, Makefile must be modified |
144 |
+ if ! use plotutils; then |
145 |
+ sed -i 's/^PL/#PL/' Makefile || die |
146 |
+ fi |
147 |
+ if ! use readline; then |
148 |
+ sed -i 's/^RL/#RL/' Makefile || die |
149 |
+ fi |
150 |
+} |
151 |
+ |
152 |
+src_install() { |
153 |
+ emake \ |
154 |
+ QCLDIR="${D}/usr/lib/${PN}" \ |
155 |
+ QCLBIN="${D}/usr/bin" \ |
156 |
+ install |
157 |
+ dodoc CHANGES README |
158 |
+ use doc && dodoc "${DISTDIR}/"{ccquprog,structquprog,qcldoc,quprog}.pdf |
159 |
+} |