|
3 | 3 | "A stream processing framework for high-throughput applications.";
|
4 | 4 |
|
5 | 5 | inputs.ctypesgen = {
|
6 |
| - url = "github:ctypesgen/ctypesgen"; |
| 6 | + url = "github:ctypesgen/ctypesgen/ctypesgen-1.0.2"; |
7 | 7 | flake = false;
|
8 | 8 | };
|
9 | 9 |
|
|
114 | 114 | ]);
|
115 | 115 | preBuild = lib.optionalString enablePython ''
|
116 | 116 | make -C python bifrost/libbifrost_generated.py
|
117 |
| - sed -i \ |
118 |
| - -e "s:^add_library_search_dirs(\[:&'$out/lib':" \ |
119 |
| - python/bifrost/libbifrost_generated.py |
| 117 | + sed "s:\(load_library\)(\"bifrost\"):\1('$out/lib/libbifrost.so'):"\ |
| 118 | + -i python/bifrost/libbifrost_generated.py |
120 | 119 | '';
|
121 | 120 | makeFlags =
|
122 | 121 | lib.optionals enableCuda [ "CUDA_LIBDIR64=$(CUDA_HOME)/lib" ];
|
|
135 | 134 | SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
136 | 135 | src = inputs.ctypesgen;
|
137 | 136 | buildInputs = [ setuptools-scm toml ];
|
138 |
| - patchPhase = |
| 137 | + postPatch = |
139 | 138 | # Version detection in the absence of ‘git describe’ is broken,
|
140 | 139 | # even with an explicit VERSION file.
|
141 | 140 | ''
|
142 |
| - sed -i \ |
143 |
| - -e 's/\(VERSION = \).*$/\1"${pname}-${version}"/' \ |
| 141 | + sed -e 's/\(VERSION = \).*$/\1"${pname}-${version}"/' \ |
144 | 142 | -e 's/\(VERSION_NUMBER = \).*$/\1"${version}"/' \
|
145 |
| - ctypesgen/version.py |
| 143 | + -i ctypesgen/version.py |
| 144 | + '' + |
| 145 | + # Test suite invokes ‘run.py’, replace that with actual script. |
| 146 | + '' |
| 147 | + sed -e "s:\(script = \).*:\1'${ |
| 148 | + placeholder "out" |
| 149 | + }/bin/ctypesgen':" \ |
| 150 | + -e "s:run\.py:ctypesgen:" \ |
| 151 | + -i ctypesgen/test/testsuite.py |
146 | 152 | '' +
|
147 | 153 | # At runtime, ctypesgen invokes ‘gcc -E’. It won’t be available in
|
148 | 154 | # the darwin stdenv so let's explicitly patch full path to gcc in
|
149 | 155 | # nix store, making gcc a true prerequisite, which it is. There
|
150 | 156 | # are also runs of gcc specified in test suite.
|
151 | 157 | ''
|
152 | 158 | sed -i 's:gcc -E:${gcc}/bin/gcc -E:' ctypesgen/options.py
|
153 |
| - sed -i 's:"gcc":"${gcc}/bin/gcc":' tests/ctypesgentest.py |
154 | 159 | '' +
|
155 | 160 | # Some tests explicitly load ‘libm’ and ‘libc’. They won’t be
|
156 | 161 | # found on NixOS unless we patch in the ‘glibc’ path.
|
157 | 162 | lib.optionalString stdenv.isLinux ''
|
158 |
| - sed -i 's:libm.so.6:${glibc}/lib/libm.so.6:' tests/testsuite.py |
159 |
| - sed -i 's:libc.so.6:${glibc}/lib/libc.so.6:' tests/testsuite.py |
| 163 | + sed -e 's:libm.so.6:${glibc}/lib/&:' \ |
| 164 | + -e 's:libc.so.6:${glibc}/lib/&:' \ |
| 165 | + -i ctypesgen/test/testsuite.py |
160 | 166 | '';
|
161 |
| - checkPhase = "python -m unittest -v tests/testsuite.py"; |
| 167 | + checkPhase = "python ctypesgen/test/testsuite.py"; |
162 | 168 | };
|
163 | 169 |
|
164 | 170 | pyOverlay = self: _: {
|
|
0 commit comments