Unverified Commit 0c1f1b34 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

openrct2: add overrides for rct1/2 installation paths (#506337)

parents 7a36cde2 1c58afac
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -25,12 +25,16 @@
  libpthread-stubs,
  libvorbis,
  libzip,
  makeWrapper,
  nlohmann_json,
  openssl,
  pkg-config,
  speexdsp,
  zlib,
  withDiscordRpc ? false,
  # Paths to RCT1 and RCT2 installs can be specified to have them added as a wrapped argument
  rct1Path ? null,
  rct2Path ? null,
}:

let
@@ -75,6 +79,7 @@ stdenv.mkDerivation (finalAttrs: {
    cmake
    pkg-config
    unzip
    makeWrapper
  ];

  buildInputs = [
@@ -140,6 +145,12 @@ stdenv.mkDerivation (finalAttrs: {
      + (versionCheck "TITLE_SEQUENCE" title-sequences-version)
    );

  postInstall = ''
    wrapProgram $out/bin/openrct2 \
      ${lib.optionalString (rct1Path != null) "--add-flags '--rct1-data-path=\"${rct1Path}\"'"} \
      ${lib.optionalString (rct2Path != null) "--add-flags '--rct2-data-path=\"${rct2Path}\"'"}
  '';

  meta = {
    description = "Open source re-implementation of RollerCoaster Tycoon 2 (original game required)";
    homepage = "https://openrct2.io/";