2019-08-14 13:12:54 +00:00
|
|
|
let
|
|
|
|
fallbackPkgs = import <nixpkgs> {};
|
2020-05-09 21:08:00 +00:00
|
|
|
fallbackMozSrc = builtins.fetchTarball "https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz";
|
2019-08-14 13:12:54 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
alsaLib ? fallbackPkgs.alsaLib,
|
|
|
|
atk ? fallbackPkgs.atk,
|
|
|
|
cairo ? fallbackPkgs.cairo,
|
2020-05-09 21:08:00 +00:00
|
|
|
git ? null,
|
|
|
|
git-lfs ? null,
|
2019-08-14 13:12:54 +00:00
|
|
|
glib ? fallbackPkgs.glib,
|
2020-05-09 21:08:00 +00:00
|
|
|
gnuplot ? null,
|
2019-08-14 13:12:54 +00:00
|
|
|
gtk3 ? fallbackPkgs.gtk3,
|
2020-05-09 21:08:00 +00:00
|
|
|
libudev ? fallbackPkgs.libudev,
|
2019-08-14 13:12:54 +00:00
|
|
|
makeRustPlatform ? fallbackPkgs.makeRustPlatform,
|
2020-05-09 21:08:00 +00:00
|
|
|
mozSrc ? fallbackMozSrc,
|
2019-08-14 13:12:54 +00:00
|
|
|
nix-gitignore ? fallbackPkgs.nix-gitignore,
|
2020-05-09 21:08:00 +00:00
|
|
|
openssl ? fallbackPkgs.openssl,
|
2019-08-14 13:12:54 +00:00
|
|
|
pango ? fallbackPkgs.pango,
|
|
|
|
pkg-config ? fallbackPkgs.pkg-config,
|
|
|
|
pkgs ? fallbackPkgs,
|
2020-05-09 21:08:00 +00:00
|
|
|
python3 ? fallbackPkgs.python3,
|
|
|
|
rustup ? null,
|
2019-08-14 13:12:54 +00:00
|
|
|
stdenv ? fallbackPkgs.stdenv,
|
|
|
|
veloren-src ? null,
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# `mozPkgs` is the package set of `mozRepo`; this differs from their README
|
|
|
|
# where they use it as an overlay rather than a separate package set
|
2020-05-09 21:08:00 +00:00
|
|
|
mozPkgs = import "${mozSrc}/package-set.nix" { inherit pkgs; };
|
|
|
|
channel = mozPkgs.rustChannelOf { rustToolchain = ./rust-toolchain; };
|
|
|
|
rustPlatform = makeRustPlatform {
|
2019-08-14 13:12:54 +00:00
|
|
|
rustc = channel.rust;
|
|
|
|
cargo = channel.cargo;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2020-05-09 21:08:00 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "veloren";
|
2019-08-14 13:12:54 +00:00
|
|
|
version = "unstable";
|
|
|
|
# For information on how to automatically fetch the source from GitLab, please
|
|
|
|
# ask @haslersn
|
|
|
|
src = if veloren-src == null then (nix-gitignore.gitignoreSource [] ./.) else veloren-src;
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2020-05-09 21:08:00 +00:00
|
|
|
python3
|
|
|
|
# Convenience for nix-shell
|
2019-08-14 13:12:54 +00:00
|
|
|
git
|
|
|
|
git-lfs
|
|
|
|
gnuplot
|
2020-05-09 21:08:00 +00:00
|
|
|
rustup # Required for integration in some editors
|
2019-08-14 13:12:54 +00:00
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
pango
|
2020-05-09 21:08:00 +00:00
|
|
|
libudev
|
|
|
|
openssl
|
2019-08-14 13:12:54 +00:00
|
|
|
];
|
2020-05-09 21:08:00 +00:00
|
|
|
#preConfigure = "export HOME=`mktemp -d`";
|
|
|
|
postInstall = "cp -R $src/assets $out/bin/assets";
|
|
|
|
# If veloren-vendor build fails with hash mismatch, change this hash with `got:` hash
|
2020-06-14 03:29:11 +00:00
|
|
|
cargoSha256 = "13aa2jypqhg4y7bpkxqdchd0sw85hq6galafswbg1d4bjwphnq70";
|
2019-08-14 13:12:54 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|