1{ lib
2, stdenv
3, fetchurl
4, autoPatchelfHook
5, makeWrapper
6, unzip
7, libGL
8, libICE
9, libSM
10, libX11
11, libXrandr
12, zlib
13, alsa-lib
14}:
15
16stdenv.mkDerivation rec {
17 pname = "rigsofrods-bin";
18 version = "2022.12";
19
20 src = fetchurl {
21 url = "https://update.rigsofrods.org/rigs-of-rods-linux-2022-12.zip";
22 hash = "sha256-jj152fd4YHlU6YCVCnN6DKRfmi5+ORpMQVDacy/TPeE=";
23 };
24
25 sourceRoot = ".";
26
27 nativeBuildInputs = [
28 autoPatchelfHook
29 makeWrapper
30 unzip
31 ];
32
33 buildInputs = [
34 libGL
35 libICE
36 libSM
37 libX11
38 libXrandr
39 stdenv.cc.cc
40 zlib
41 ];
42
43 runtimeDependencies = [
44 alsa-lib
45 ];
46
47 noDumpEnvVars = true;
48
49 installPhase = ''
50 runHook preInstall
51
52 mkdir -p $out/bin $out/share/rigsofrods
53 cp -a . $out/share/rigsofrods
54 for f in RoR RunRoR; do
55 makeWrapper $out/share/rigsofrods/$f $out/bin/$f \
56 --chdir $out/share/rigsofrods
57 done
58
59 runHook postInstall
60 '';
61
62 meta = with lib; {
63 description = "A free/libre soft-body physics simulator mainly targeted at simulating vehicle physics";
64 homepage = "https://www.rigsofrods.org";
65 license = licenses.gpl3Plus;
66 maintainers = with maintainers; [ raskin wegank ];
67 platforms = [ "x86_64-linux" ];
68 };
69}