nixpkgs/pkgs/by-name/xi/xivlauncher/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

84 lines
2.7 KiB
Nix
Raw Normal View History

2023-06-19 15:42:48 +00:00
{ lib, buildDotnetModule, fetchFromGitHub, dotnetCorePackages, SDL2, libsecret, glib, gnutls, aria2, steam, gst_all_1
, copyDesktopItems, makeDesktopItem, makeWrapper
2022-04-17 22:41:03 +00:00
, useSteamRun ? true }:
let
2024-03-19 12:47:54 +00:00
rev = "1.0.8";
2022-04-17 22:41:03 +00:00
in
buildDotnetModule rec {
pname = "XIVLauncher";
2022-10-23 20:33:05 +00:00
version = rev;
2022-04-17 22:41:03 +00:00
src = fetchFromGitHub {
owner = "goatcorp";
2022-10-23 20:33:05 +00:00
repo = "XIVLauncher.Core";
2022-04-17 22:41:03 +00:00
inherit rev;
2024-03-19 12:47:54 +00:00
hash = "sha256-x4W5L4k+u0MYKDWJu82QcXARW0zjmqqwGiueR1IevMk=";
2022-10-23 20:33:05 +00:00
fetchSubmodules = true;
2022-04-17 22:41:03 +00:00
};
nativeBuildInputs = [ copyDesktopItems makeWrapper ];
buildInputs = with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav ];
2022-04-17 22:41:03 +00:00
projectFile = "src/XIVLauncher.Core/XIVLauncher.Core.csproj";
2022-09-03 14:22:49 +00:00
nugetDeps = ./deps.nix; # File generated with `nix-build -A xivlauncher.passthru.fetch-deps`
2022-04-17 22:41:03 +00:00
dotnetFlags = [
"-p:BuildHash=${rev}"
"-p:PublishSingleFile=false"
2022-04-17 22:41:03 +00:00
];
postPatch = ''
2022-10-23 20:33:05 +00:00
substituteInPlace lib/FFXIVQuickLauncher/src/XIVLauncher.Common/Game/Patch/Acquisition/Aria/AriaHttpPatchAcquisition.cs \
2022-04-17 22:41:03 +00:00
--replace 'ariaPath = "aria2c"' 'ariaPath = "${aria2}/bin/aria2c"'
'';
postInstall = ''
mkdir -p $out/share/pixmaps
cp src/XIVLauncher.Core/Resources/logo.png $out/share/pixmaps/xivlauncher.png
'';
2023-06-19 15:42:48 +00:00
postFixup = lib.optionalString useSteamRun (let
steam-run = (steam.override {
extraPkgs = pkgs: [ pkgs.libunwind ];
extraProfile = ''
unset TZ
'';
2023-06-19 15:42:48 +00:00
}).run;
in ''
2022-04-17 22:41:03 +00:00
substituteInPlace $out/bin/XIVLauncher.Core \
--replace 'exec' 'exec ${steam-run}/bin/steam-run'
2023-06-19 15:42:48 +00:00
'') + ''
wrapProgram $out/bin/XIVLauncher.Core --prefix GST_PLUGIN_SYSTEM_PATH_1_0 ":" "$GST_PLUGIN_SYSTEM_PATH_1_0"
# the reference to aria2 gets mangled as UTF-16LE and isn't detectable by nix: https://github.com/NixOS/nixpkgs/issues/220065
mkdir -p $out/nix-support
echo ${aria2} >> $out/nix-support/depends
2022-04-17 22:41:03 +00:00
'';
executables = [ "XIVLauncher.Core" ];
runtimeDeps = [ SDL2 libsecret glib gnutls ];
desktopItems = [
(makeDesktopItem {
name = "xivlauncher";
exec = "XIVLauncher.Core";
icon = "xivlauncher";
desktopName = "XIVLauncher";
comment = meta.description;
categories = [ "Game" ];
2022-10-23 20:33:05 +00:00
startupWMClass = "XIVLauncher.Core";
2022-04-17 22:41:03 +00:00
})
];
meta = with lib; {
description = "Custom launcher for FFXIV";
2023-11-07 21:41:58 +00:00
homepage = "https://github.com/goatcorp/XIVLauncher.Core";
2022-04-17 22:41:03 +00:00
license = licenses.gpl3;
maintainers = with maintainers; [ sersorrel witchof0x20 ];
2022-04-17 22:41:03 +00:00
platforms = [ "x86_64-linux" ];
2022-10-29 14:42:41 +00:00
mainProgram = "XIVLauncher.Core";
2022-04-17 22:41:03 +00:00
};
}