mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
nix: workaround an issue with crate2nix, change some errors to be more clear
This commit is contained in:
parent
c5a7db06fb
commit
9ecaba8552
@ -14287,7 +14287,7 @@ rec {
|
|||||||
{
|
{
|
||||||
name = "csv";
|
name = "csv";
|
||||||
packageId = "csv";
|
packageId = "csv";
|
||||||
optional = true;
|
# optional = true;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "directories-next";
|
name = "directories-next";
|
||||||
@ -14396,7 +14396,7 @@ rec {
|
|||||||
{
|
{
|
||||||
name = "structopt";
|
name = "structopt";
|
||||||
packageId = "structopt";
|
packageId = "structopt";
|
||||||
optional = true;
|
# optional = true;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "sum_type";
|
name = "sum_type";
|
||||||
|
6
nix/Cargo.nix_patches.md
Normal file
6
nix/Cargo.nix_patches.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Apply these instructions after generating the `Cargo.nix` file.
|
||||||
|
|
||||||
|
- Find `veloren-common` crate in `Cargo.nix`:
|
||||||
|
- Comment the `optional = true;` line for "structopt" and "csv" dependencies.
|
||||||
|
- See [this issue](https://github.com/kolloch/crate2nix/issues/129) on `crate2nix` repository for more info.
|
||||||
|
- Note that the suggested workaround in the issue **does not** work for us.
|
@ -192,6 +192,7 @@ To update `Cargo.nix` (and `crate-hashes.json`) using latest `Cargo.lock`, run:
|
|||||||
```shell
|
```shell
|
||||||
crate2nix generate -f ../Cargo.toml
|
crate2nix generate -f ../Cargo.toml
|
||||||
```
|
```
|
||||||
|
Then follow the instructions in the `Cargo.nix_patches.md` file.
|
||||||
|
|
||||||
### Rust toolchain
|
### Rust toolchain
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ let
|
|||||||
prettyRev = with sourceInfo;
|
prettyRev = with sourceInfo;
|
||||||
if sourceInfo ? rev && sourceInfo ? lastModified
|
if sourceInfo ? rev && sourceInfo ? lastModified
|
||||||
then builtins.substring 0 8 rev + "/" + utils.dateTimeFormat lastModified
|
then builtins.substring 0 8 rev + "/" + utils.dateTimeFormat lastModified
|
||||||
else throw "Need revision + lastModified to determine version";
|
else throw "Need revision + lastModified to determine pretty revision";
|
||||||
|
|
||||||
tag = with sourceInfo;
|
tag = with sourceInfo;
|
||||||
if sourceInfo ? tag
|
if sourceInfo ? tag
|
||||||
@ -51,7 +51,7 @@ let
|
|||||||
version =
|
version =
|
||||||
if tag != "" then tag
|
if tag != "" then tag
|
||||||
else if prettyRev != "" then prettyRev
|
else if prettyRev != "" then prettyRev
|
||||||
else throw "Need a tag or at least revision + lastModified in order to determine version";
|
else throw "Need a tag or pretty revision in order to determine version";
|
||||||
|
|
||||||
veloren-assets = pkgs.runCommand "makeAssetsDir" { } ''
|
veloren-assets = pkgs.runCommand "makeAssetsDir" { } ''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
|
Loading…
Reference in New Issue
Block a user