15 # Note: use this to get the release metadata
16 # https://gitlab.com/api/v4/projects/10174980/repository/tags/v{version}
18 date = "2023-03-30-03:28";
19 rev = "80fe5ca64b40fbf3e0e393a44f8880a79a6a5380";
22 rustPlatform.buildRustPackage {
26 src = fetchFromGitLab {
30 hash = "sha256-h2hLO227aeK2oEFfdGMgmtMkA9cn9AgQ9w6myb+8W8c=";
33 cargoLock.lockFile = ./Cargo.lock;
34 cargoLock.outputHashes = {
35 # Hashes of dependencies pinned to a git commit
36 "auth-common-0.1.0" = "sha256-6tUutHLY309xSBT2D7YueAmsAWyVn410XNKFT8yuTgA=";
37 "conrod_core-0.63.0" = "sha256-GxakbJBVTFgbtUsa2QB105xgd+aULuWLBlv719MIzQY=";
38 "egui_wgpu_backend-0.26.0" = "sha256-47XZoE7bFRv/TG4EmM2qit5L21qsKT6Nt/t1y/NMneQ=";
39 "fluent-0.16.0" = "sha256-xN+DwObqoToqprLDy3yvTiqclIIOsuUtpAQ6W1mdf0I=";
40 "iced_core-0.4.0" = "sha256-5s6IXcitoGcHS0FUx/cujx9KLBpaUuMnugmBged1cLA=";
41 "keyboard-keynames-0.1.2" = "sha256-5I70zT+Lwt0JXJgTAy/VygHdxIBuE/u3pq8LP8NkRdE=";
42 "naga-0.14.2" = "sha256-yyLrJNhbu/RIVr0hM7D7Rwd7vH3xX8Dns+u6m8NEU2M=";
43 "portpicker-0.1.0" = "sha256-or1907XdrDIyFzHNmW6me2EIyEQ8sjVIowfGsypa4jU=";
44 "shaderc-0.8.0" = "sha256-BU736g075i3GqlyyB9oyoVlQqNcWbZEGa8cdge1aMq0=";
45 "specs-0.20.0" = "sha256-OHnlag6SJ1rlAYnlmVD+uqY+kFNsbQ42W21RrEa8Xn0=";
48 ./fix-on-rust-stable.patch
49 ./fix-assets-path.patch
54 cp ${./Cargo.lock} Cargo.lock
56 # Force vek to build in unstable mode
57 cat <<'EOF' | tee "$cargoDepsCopy"/vek-*/build.rs
59 println!("cargo:rustc-check-cfg=cfg(nightly)");
60 println!("cargo:rustc-cfg=nightly");
65 nativeBuildInputs = [ pkg-config ];
73 buildNoDefaultFeatures = true;
74 buildFeatures = [ "default-publish" ];
77 # Enable unstable features, see https://gitlab.com/veloren/veloren/-/issues/264
78 RUSTC_BOOTSTRAP = true;
80 # Set version info, required by veloren-common
81 NIX_GIT_TAG = "v${version}";
82 NIX_GIT_HASH = "${lib.substring 0 7 rev}/${date}";
84 # Save game data under user's home directory,
85 # otherwise it defaults to $out/bin/../userdata
86 VELOREN_USERDATA_STRATEGY = "system";
89 SHADERC_LIB_DIR = "${shaderc.lib}/lib";
92 # Some tests require internet access
96 # Add required but not explicitly requested libraries
97 patchelf --add-rpath '${
105 }' "$out/bin/veloren-voxygen"
110 install -Dm644 assets/voxygen/net.veloren.veloren.desktop -t "$out/share/applications"
111 install -Dm644 assets/voxygen/net.veloren.veloren.png "$out/share/pixmaps"
112 install -Dm644 assets/voxygen/net.veloren.veloren.metainfo.xml "$out/share/metainfo"
114 mkdir -p "$out/share/veloren"; cp -ar assets "$out/share/veloren/"
118 description = "An open world, open source voxel RPG";
119 homepage = "https://www.veloren.net";
120 license = licenses.gpl3;
121 mainProgram = "veloren-voxygen";
122 platforms = platforms.linux;
123 maintainers = with maintainers; [ rnhmjoj tomodachi94 ];