package.nix (2149B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 cmake, 6 copyDesktopItems, 7 makeDesktopItem, 8 makeWrapper, 9 pkg-config, 10 qt6, 11 curl, 12 draco, 13 glslang, 14 ktx-tools, 15 lua5_4, 16 openal, 17 sfml, 18 sol2, 19 vulkanscenegraph, 20 vsgimgui, 21 vsgxchange, 22 }: 23 24 stdenv.mkDerivation (finalAttrs: { 25 pname = "rrs"; 26 version = "1.9.3"; 27 28 __structuredAttrs = true; 29 30 src = fetchFromGitHub { 31 owner = "maisvendoo"; 32 repo = "RRS"; 33 tag = "v${finalAttrs.version}"; 34 hash = "sha256-wNXy8Lw9EW7q6l1vdllD9jl7sNVgRgAOtUQ7etgMNTo="; 35 }; 36 37 postPatch = '' 38 substituteInPlace filesystem/src/filesystem.cpp \ 39 --replace-fail "QDir::currentPath().toStdString()" "\"$out/bin\"" \ 40 --replace-fail "getLevelUpDirectory(workDir, 1)" "\"$out/\"" 41 ''; 42 43 nativeBuildInputs = [ 44 cmake 45 copyDesktopItems 46 makeWrapper 47 pkg-config 48 qt6.qttools 49 qt6.wrapQtAppsHook 50 ]; 51 52 buildInputs = [ 53 qt6.qtbase 54 qt6.qtserialbus 55 qt6.qtwebengine 56 curl 57 draco 58 glslang 59 ktx-tools 60 lua5_4 61 openal 62 sfml 63 sol2 64 vulkanscenegraph 65 vsgimgui 66 vsgxchange 67 ]; 68 69 desktopItems = [ 70 (makeDesktopItem { 71 name = "rrs-launcher"; 72 type = "Application"; 73 desktopName = "Russian Railway Simulator"; 74 icon = "RRS_logo"; 75 exec = "launcher"; 76 terminal = false; 77 categories = [ 78 "Simulation" 79 ]; 80 }) 81 ]; 82 83 noAuditTmpdir = true; 84 85 postInstall = '' 86 cp -r /build/source/{bin,lib,modules,plugins} $out 87 cp -r $src/{cfg,data,docs,fonts,routes,themes} $out 88 install -Dm644 $src/launcher/resources/images/RRS_logo.png -t $out/share/icons/hicolor/48x48/apps 89 ''; 90 91 postFixup = '' 92 for f in $out/bin/*; do 93 wrapProgram $f \ 94 --prefix LD_LIBRARY_PATH : $out/lib 95 done 96 ''; 97 98 meta = { 99 description = "Russian Railway Simulator"; 100 homepage = "https://github.com/maisvendoo/RRS"; 101 license = lib.licenses.gpl2; 102 maintainers = [ lib.maintainers.sikmir ]; 103 platforms = lib.platforms.linux; 104 skip.ci = stdenv.isDarwin; 105 mainProgram = "launcher"; 106 broken = true; # error: 'KTX_BASIS_CODEC_ETC1S' was not declared in this scope 107 }; 108 })
