Unverified Commit 00a4af6e authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

parallel-launcher: 8.3.0 -> 9.0.2 (#452803)

parents 55eb1090 c97bbf81
Loading
Loading
Loading
Loading
+26 −12
Original line number Diff line number Diff line
diff --git a/src/core/retroarch.cpp b/src/core/retroarch.cpp
index c2a2c47..97fa782 100644
index 7502922..c6a572b 100644
--- a/src/core/retroarch.cpp
+++ b/src/core/retroarch.cpp
@@ -102,7 +102,7 @@ static void loadConfig( std::map<string, string> &configs ) {
@@ -103,7 +103,7 @@ static void loadConfig( std::map<string, string> &configs ) {
 
 	const fs::path basePath = RetroArch::getBasePath();
 	configs["system_directory"] = (basePath / _NFS("system")).u8string();
@@ -11,7 +11,7 @@ index c2a2c47..97fa782 100644
 	configs["savefile_directory"] = (basePath / _NFS("saves")).u8string();
 	configs["savestate_directory"] = (basePath / _NFS("states")).u8string();
 	configs["libretro_info_path"] = (basePath / _NFS("info")).u8string();
@@ -110,7 +110,7 @@ static void loadConfig( std::map<string, string> &configs ) {
@@ -111,7 +111,7 @@ static void loadConfig( std::map<string, string> &configs ) {
 #if defined(FLATPAK_VERSION)
 	configs["assets_directory"] = "/app/share/libretro/assets/";
 #elif defined(__linux__)
@@ -20,7 +20,7 @@ index c2a2c47..97fa782 100644
 	configs["osk_overlay_directory"] = (BaseDir::data() / "retro-data" / "overlays" / "keyboards").u8string();
 	configs["overlay_directory"] = (BaseDir::data() / "retro-data" / "overlays").u8string();
 	configs["audio_filter_dir"] = (BaseDir::data() / "retro-data" / "filters" / "audio").u8string();
@@ -845,13 +845,7 @@ fs::path RetroArch::getBasePath() {
@@ -866,13 +866,7 @@ fs::path RetroArch::getBasePath() {
 }
 
 fs::path RetroArch::getCorePath() {
@@ -35,7 +35,7 @@ index c2a2c47..97fa782 100644
 }
 
 fs::path RetroArch::getConfigPath() {
@@ -866,7 +860,7 @@ fs::path RetroArch::getExePath() {
@@ -887,7 +881,7 @@ fs::path RetroArch::getExePath() {
 #elif defined(FLATPAK_VERSION)
 	return BaseDir::program() / "retroarch";
 #else
@@ -45,27 +45,41 @@ index c2a2c47..97fa782 100644
 }
 
diff --git a/src/main.cpp b/src/main.cpp
index 3ca39b2..f3c14ba 100644
index fbd4c92..91ef84e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -200,6 +200,7 @@ int main( int argc, char **argv ) {
@@ -209,7 +209,7 @@ int main( int argc, char **argv ) {
 		fs::path( "/usr/local/share/parallel-launcher/translations/" ),
 		fs::path( "/usr/share/parallel-launcher/translations/" )
 #else
+		fs::read_symlink( "/proc/self/exe" ).parent_path().parent_path() / "share/parallel-launcher/translations/",
 		fs::path( "/usr/share/parallel-launcher/translations/" ),
-		fs::path( "/usr/share/parallel-launcher/translations/" ),
+		fs::path( "@sharePath@/translations/" ),
 		fs::path( "/usr/local/share/parallel-launcher/translations/" ),
 		BaseDir::program() / "lang"
 #endif
diff --git a/src/plugins/discord-plugin.cpp b/src/plugins/discord-plugin.cpp
index 055c0ee..7ce44fb 100644
--- a/src/plugins/discord-plugin.cpp
+++ b/src/plugins/discord-plugin.cpp
@@ -38,7 +38,7 @@ const DiscordPlugin &DiscordPlugin::tryLoad( bool *success ) noexcept {
 		return s_abi;
 	}
 
-	void *handle = dlopen( (BaseDir::data() / "plugins" / "libdiscord-rpc.so").u8string().c_str(), RTLD_NOW );
+	void *handle = dlopen( "libdiscord-rpc.so", RTLD_NOW );
 	if( !handle ) {
 		if( success != nullptr ) *success = false;
 		return s_stub;
diff --git a/src/polyfill/base-directory.cpp b/src/polyfill/base-directory.cpp
index 720a754..db607ca 100644
index 2dcc704..45970a4 100644
--- a/src/polyfill/base-directory.cpp
+++ b/src/polyfill/base-directory.cpp
@@ -134,7 +134,7 @@ static Locations getLocations() {
@@ -146,7 +146,7 @@ static Locations getLocations() {
 #if defined(FLATPAK_VERSION)
 		fs::path( "/app/share/parallel-launcher" )
 #elif defined(__linux__)
-		fs::path( "/usr/share/parallel-launcher" )
+		fs::read_symlink( "/proc/self/exe" ).parent_path().parent_path() / "share/parallel-launcher"
+		fs::path( "@sharePath@" )
 #endif
 	};
 }
+8 −10
Original line number Diff line number Diff line
diff --git a/src/core/updates.cpp b/src/core/updates.cpp
index 403290b..f7d6547 100644
index cb9ca39..4dc5dfb 100644
--- a/src/core/updates.cpp
+++ b/src/core/updates.cpp
@@ -30,8 +30,8 @@
@@ -24,8 +24,8 @@
 #endif
 
 const InstalledVersionsInfo InstalledVersionsInfo::Default {
@@ -13,7 +13,7 @@ index 403290b..f7d6547 100644
 	/* lastUpdateCheck */ 0
 };
 
@@ -47,15 +47,7 @@ template<> void JsonSerializer::serialize<RetroArchVersion>( JsonWriter &jw, con
@@ -41,15 +41,7 @@ template<> void JsonSerializer::serialize<RetroArchVersion>( JsonWriter &jw, con
 }
 
 template<> RetroArchVersion JsonSerializer::parse<RetroArchVersion>( const Json &json ) {
@@ -30,7 +30,7 @@ index 403290b..f7d6547 100644
 }
 
 static constexpr char P_RETROARCH[] = "retroarch";
@@ -73,47 +65,14 @@ template<> void JsonSerializer::serialize<InstalledVersionsInfo>( JsonWriter &jw
@@ -67,44 +59,15 @@ template<> void JsonSerializer::serialize<InstalledVersionsInfo>( JsonWriter &jw
 }
 
 template<> InstalledVersionsInfo JsonSerializer::parse<InstalledVersionsInfo>( const Json &json ) {
@@ -60,11 +60,7 @@ index 403290b..f7d6547 100644
-#if defined(__linux__)
-	const Json &vjson = json["linux_x64"];
-#elif defined(_WIN32)
-	#ifdef _WIN64
-	const Json &vjson = json["windows_x64"];
-	#else
-		const Json &vjson = json["windows_x86"];
-	#endif
-#elif defined(__APPLE__)
-	const Json &vjson = AppleUtil::shouldUseArmCore() ? json["macos_arm64"] : json["macos_x64"];
-#else
@@ -75,14 +71,16 @@ index 403290b..f7d6547 100644
 	return ParallelCoreVersion{
-		JsonSerializer::parse<Version>( vjson["version"] ),
-		vjson["sha1"].get<string>(),
-		vjson["zipSignature"].get<string>(),
-		vjson["url"].get<string>()
+		InstalledVersionsInfo::Default.parallelVersion,
+		"",
+		"",
+		""
 	};
 }
 
@@ -178,6 +137,7 @@ void RetroUpdater::checkForUpdates(
@@ -169,6 +132,7 @@ void RetroUpdater::checkForUpdates(
 	bool waitForCoreUpdates,
 	bool forceUpdate
 ) {
+51 −27
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  callPackage,
  coreutils,
  discord-rpc,
  dosfstools,
  fetchFromGitLab,
  findutils,
  lib,
  libgcrypt,
  libgpg-error,
  parallel-launcher,
  qt6,
  replaceVars,
  qt5,
  retroarch-assets,
  SDL2,
  discord-rpc,
  libgcrypt,
  sqlite,
  findutils,
  xdg-utils,
  coreutils,
  dosfstools,
  stdenv,
  vulkan-loader,
  wrapRetroArch,
  retroarch-assets,
  parallel-launcher,
  xdg-utils,
  zlib,
  # Allow overrides for the RetroArch core and declarative settings
  parallel-n64-core ? parallel-launcher.passthru.parallel-n64-core,
  extraRetroArchSettings ? { },
  parallel-n64-core ? parallel-launcher.passthru.parallel-n64-core,
  withDiscordRpc ? false,
}:
let
@@ -53,13 +55,13 @@ stdenv.mkDerivation (
  in
  {
    pname = "parallel-launcher";
    version = "8.3.0"; # Check ./parallel-n64-next.nix for updates when updating, too
    version = "9.0.2"; # Check ./parallel-n64-next.nix for updates when updating, too

    src = fetchFromGitLab {
      owner = "parallel-launcher";
      repo = "parallel-launcher";
      tag = reformatVersion finalAttrs.version;
      hash = "sha256-Zp/QTPREfpOG0zgnP1Lg5FgT9u+OEhoqBgnxWMu451A=";
      hash = "sha256-JrZy60xWgrUlFcyGNVBUfHg/diM5TG5mIbbOXpee/2U=";
    };

    patches =
@@ -73,6 +75,8 @@ stdenv.mkDerivation (
          inherit retroArchAssetsPath retroArchCoresPath;
          retroArchExePath = lib.getExe retroarch';
          parallelN64CorePath = "${retroArchCoresPath}/parallel_n64_next_libretro${suffix}";
          # Manually substituted later since we need to reference PL's $out
          sharePath = null;
        })
        # Bypass update checks and hardcode internal version checks to ours
        (replaceVars ./fix-version-checks.patch {
@@ -82,40 +86,60 @@ stdenv.mkDerivation (
      ];

    nativeBuildInputs = [
      qt5.wrapQtAppsHook
      qt5.qttools
      qt5.qmake
      qt6.wrapQtAppsHook
      qt6.qttools
      qt6.qmake
    ];

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

    qtWrapperArgs = [
      "--prefix PATH : ${
        lib.makeBinPath [
          findutils
          xdg-utils
          coreutils
          dosfstools
          findutils
          xdg-utils
        ]
      }"
      "--prefix LD_LIBRARY_PATH : ${
        lib.makeLibraryPath [
        lib.makeLibraryPath (
          [
            vulkan-loader
          ]
          ++ lib.optional withDiscordRpc discord-rpc
        )
      }"
    ];

    qmakeFlags = [
      "DEFINES+=RETROARCH_XWAYLAND"
    ];

    # Our patches result in unused params.
    # Ignoring the warning is easier to maintain than more invasive patching.
    env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-parameter";

    postPatch =
      let
        sharePath = "${placeholder "out"}/share/parallel-launcher";
      in
      ''
        substituteInPlace src/main.cpp \
          --replace-fail '@sharePath@' '${sharePath}'

        substituteInPlace src/polyfill/base-directory.cpp \
          --replace-fail '@sharePath@' '${sharePath}'
      '';

    preConfigure = ''
      lrelease app.pro
    '';
+2 −2
Original line number Diff line number Diff line
@@ -15,13 +15,13 @@ in
# Based on the libretro parallel-n64 derivation with slight tweaks
libretro.mkLibretroCore (finalAttrs: {
  core = "parallel-n64-next";
  version = "2.24.1";
  version = "2.27.1";

  src = fetchFromGitLab {
    owner = "parallel-launcher";
    repo = "parallel-n64";
    tag = reformatVersion finalAttrs.version;
    hash = "sha256-BeeKX78zozxx72cmJ3HI0nH/STvkltMBZs2+mb4ukM0=";
    hash = "sha256-u4F6CbC1NEU3OWtcqMIi/teX+SS4Jq9v5M2qc9z5bXg=";
  };

  extraNativeBuildInputs = [
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ packageDir="$nixpkgs/pkgs/by-name/pa/parallel-launcher"

getLatestVersion() {
  curl -s "https://gitlab.com/api/v4/projects/parallel-launcher%2F$1/repository/tags" \
  | jq -r '.[0] | select(.) | .name' \
  | jq -r '.[0].name' \
  | sed 's|v||' \
  | sed 's|-|.|'
}