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