Unverified Commit 4b3a7fbd authored by Vladimír Čunát's avatar Vladimír Čunát Committed by GitHub
Browse files

discord-rpc: fix build with CMake 4; various: disable discord-rpc (#449212)

parents ebb82c46 297f8fb9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -41,6 +41,12 @@ stdenv.mkDerivation rec {
    })
  ];

  postPatch = ''
    substituteInPlace CMakeLists.txt --replace-fail \
      "cmake_minimum_required (VERSION 3.2.0)" \
      "cmake_minimum_required (VERSION 3.10.0)"
  '';

  meta = with lib; {
    description = "Official library to interface with the Discord client";
    homepage = "https://github.com/discordapp/discord-rpc";
+4 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
  pkg-config,
  speexdsp,
  zlib,
  withDiscordRpc ? false,
}:

let
@@ -79,7 +80,6 @@ stdenv.mkDerivation (finalAttrs: {
  buildInputs = [
    SDL2
    curl
    discord-rpc
    duktape
    expat
    flac
@@ -100,13 +100,15 @@ stdenv.mkDerivation (finalAttrs: {
    openssl
    speexdsp
    zlib
  ];
  ]
  ++ lib.optional withDiscordRpc discord-rpc;

  cmakeFlags = [
    (lib.cmakeBool "DOWNLOAD_OBJECTS" false)
    (lib.cmakeBool "DOWNLOAD_OPENMSX" false)
    (lib.cmakeBool "DOWNLOAD_OPENSFX" false)
    (lib.cmakeBool "DOWNLOAD_TITLE_SEQUENCES" false)
    (lib.cmakeBool "DISABLE_DISCORD_RPC" (!withDiscordRpc))
  ];

  postUnpack = ''
+3 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
  # Allow overrides for the RetroArch core and declarative settings
  parallel-n64-core ? parallel-launcher.passthru.parallel-n64-core,
  extraRetroArchSettings ? { },
  withDiscordRpc ? false,
}:
let
  # Converts a version string like x.y.z to vx.y-z
@@ -88,12 +89,12 @@ stdenv.mkDerivation (

    buildInputs = [
      SDL2
      discord-rpc
      libgcrypt
      sqlite
      qt5.qtbase
      qt5.qtsvg
    ];
    ]
    ++ lib.optional withDiscordRpc discord-rpc;

    qtWrapperArgs = [
      "--prefix PATH : ${
+3 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
  withWayland ? false,
  # Affects final license
  withAngrylionRdpPlus ? false,
  withDiscordRpc ? false,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -48,7 +49,6 @@ stdenv.mkDerivation (finalAttrs: {

  buildInputs = [
    boost
    discord-rpc
    freetype
    hidapi
    libpng
@@ -62,6 +62,7 @@ stdenv.mkDerivation (finalAttrs: {
    xdg-user-dirs
    zlib
  ]
  ++ lib.optional withDiscordRpc discord-rpc
  ++ (
    with qt6Packages;
    [
@@ -78,6 +79,7 @@ stdenv.mkDerivation (finalAttrs: {
    # everything else.
    (lib.cmakeBool "NO_RUST" true)
    (lib.cmakeBool "USE_ANGRYLION" withAngrylionRdpPlus)
    (lib.cmakeBool "DISCORD_RPC" withDiscordRpc) # Remove with 0.8.4 update
  ];

  qtWrapperArgs =
+15 −10
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
  qtmultimedia,
  discord-rpc,
  yajl,
  withDiscordRpc ? false,
}:

let
@@ -98,8 +99,8 @@ stdenv.mkDerivation rec {
    qtbase
    qtmultimedia
    yajl
    discord-rpc
  ];
  ]
  ++ lib.optional withDiscordRpc discord-rpc;

  cmakeFlags = [
    # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
@@ -131,10 +132,12 @@ stdenv.mkDerivation rec {
      --set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \
      --prefix LUA_PATH : "$NIX_LUA_PATH" \
      --prefix DYLD_LIBRARY_PATH : "${
        lib.makeLibraryPath [
        lib.makeLibraryPath (
          [
            libsForQt5.qtkeychain
          discord-rpc
          ]
          ++ lib.optional withDiscordRpc discord-rpc
        )
      }:$out/lib" \
      --chdir "$out";

@@ -146,10 +149,12 @@ stdenv.mkDerivation rec {
      --set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \
      --prefix LUA_PATH : "$NIX_LUA_PATH" \
      --prefix LD_LIBRARY_PATH : "${
        lib.makeLibraryPath [
        lib.makeLibraryPath (
          [
            libsForQt5.qtkeychain
          discord-rpc
          ]
          ++ lib.optional withDiscordRpc discord-rpc
        )
      }" \
      --chdir "$out";