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