@@ -168,9 +168,8 @@ nixpkgs clone in `nix_file` or `nix_file_content`.
168
168
<td>
169
169
<p><code>Label-keyed String dict; optional</code></p>
170
170
<p>A dictionary mapping repositoriy labels to `NIX_PATH` entries.</p>
171
- <p>Setting it to <pre>
172
- repositories = { "myrepo" : "//: myrepo " }
173
- </pre >
171
+ <p>Setting it to
172
+ <pre><code>repositories = { "myrepo" : "//:myrepo" }</code></pre>
174
173
for example would replace all instances
175
174
of <code><myrepo></code> in the called nix code by the
176
175
path to the target <code>"//:myrepo"</code>. See the
@@ -182,17 +181,46 @@ repositories = { "myrepo" : "//:myrepo" }
182
181
<tr>
183
182
<td><code>build_file</code></td>
184
183
<td>
185
- <p><code>String; optional</code></p>
186
- <p>The file to use as the BUILD file for this repository. This
187
- attribute is a label relative to the main workspace. The
188
- file does not need to be named BUILD, but can be.</p>
184
+ <p><code>Label; optional</code></p>
185
+ <p>The file to use as the BUILD file for this repository.
186
+ Its contents are copied copied into the file
187
+ <code>BUILD</code> in root of the nix output folder.
188
+ The Label does not need to be named BUILD, but can be.
189
+ </p>
190
+ <p>For common use cases we provide filegroups that expose
191
+ certain files as targets:
192
+ <dl>
193
+ <dt><code>:bin</code></dt>
194
+ <dd>Everything in the <code>bin/</code> directory.</dd>
195
+ <dt><code>:lib</code></dt>
196
+ <dd>All <code>.so</code> and <code>.a</code> files
197
+ that can be found in subdirectories of
198
+ <code>lib/</code>.</dd>
199
+ <dt><code>:include</code></dt>
200
+ <dd>All <code>.h</code> files
201
+ that can be found in subdirectories of
202
+ <code>bin/</code>.</dd>
203
+ </dl>
204
+ </p>
205
+ <p>If you need different files from the nix package,
206
+ you can reference them like this: <pre><code>package(default_visibility = [ "//visibility:public" ])
207
+ filegroup(
208
+ name = "our-docs",
209
+ srcs = glob([ "share/doc/ourpackage/** /* "] ),
210
+ )</code ></pre >
211
+ See the bazel documentation of
212
+ <a href =" https://docs.bazel.build/versions/master/be/general.html#filegroup " >filegroup</a >
213
+ and
214
+ <a href =" https://docs.bazel.build/versions/master/be/functions.html#glob " >glob</a >.
215
+ </p >
189
216
</td >
190
217
</tr >
191
218
<tr >
192
219
<td ><code >build_file_content</code ></td >
193
220
<td >
194
221
<p ><code >String; optional</code ></p >
195
- <p>The content for the BUILD file for this repository.</p>
222
+ <p >Like <code >build_file</code >, but a string of the contents
223
+ instead of a file name.</p >
196
224
</td >
197
225
</tr >
198
226
</tbody >
0 commit comments