diff options
author | Jade <jade@witchof.space> | 2024-03-25 13:35:36 -0400 |
---|---|---|
committer | Jade <jade@witchof.space> | 2024-03-25 13:38:48 -0400 |
commit | 4a5b766ae4ba73f7c4ba0c23b5515bc22f0d7f0c (patch) | |
tree | d86b7463c2d5339a52c1120e0f03dfddbc2be70d /pkgs/by-name/xi/xivlauncher/package.nix | |
parent | f6f6375d7a9808917ad9030fd26f7064759d8c26 (diff) |
xivlauncher: migrate to by-name
Diffstat (limited to 'pkgs/by-name/xi/xivlauncher/package.nix')
-rw-r--r-- | pkgs/by-name/xi/xivlauncher/package.nix | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/pkgs/by-name/xi/xivlauncher/package.nix b/pkgs/by-name/xi/xivlauncher/package.nix new file mode 100644 index 0000000000000..ec617ad0f0f55 --- /dev/null +++ b/pkgs/by-name/xi/xivlauncher/package.nix @@ -0,0 +1,80 @@ +{ lib, buildDotnetModule, fetchFromGitHub, dotnetCorePackages, SDL2, libsecret, glib, gnutls, aria2, steam, gst_all_1 +, copyDesktopItems, makeDesktopItem, makeWrapper +, useSteamRun ? true }: + +let + rev = "1.0.8"; +in + buildDotnetModule rec { + pname = "XIVLauncher"; + version = rev; + + src = fetchFromGitHub { + owner = "goatcorp"; + repo = "XIVLauncher.Core"; + inherit rev; + hash = "sha256-x4W5L4k+u0MYKDWJu82QcXARW0zjmqqwGiueR1IevMk="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ copyDesktopItems makeWrapper ]; + + buildInputs = with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav ]; + + projectFile = "src/XIVLauncher.Core/XIVLauncher.Core.csproj"; + nugetDeps = ./deps.nix; # File generated with `nix-build -A xivlauncher.passthru.fetch-deps` + + dotnetFlags = [ + "-p:BuildHash=${rev}" + "-p:PublishSingleFile=false" + ]; + + postPatch = '' + substituteInPlace lib/FFXIVQuickLauncher/src/XIVLauncher.Common/Game/Patch/Acquisition/Aria/AriaHttpPatchAcquisition.cs \ + --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 + ''; + + postFixup = lib.optionalString useSteamRun (let + steam-run = (steam.override { + extraPkgs = pkgs: [ pkgs.libunwind ]; + }).run; + in '' + substituteInPlace $out/bin/XIVLauncher.Core \ + --replace 'exec' 'exec ${steam-run}/bin/steam-run' + '') + '' + 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 + ''; + + executables = [ "XIVLauncher.Core" ]; + + runtimeDeps = [ SDL2 libsecret glib gnutls ]; + + desktopItems = [ + (makeDesktopItem { + name = "xivlauncher"; + exec = "XIVLauncher.Core"; + icon = "xivlauncher"; + desktopName = "XIVLauncher"; + comment = meta.description; + categories = [ "Game" ]; + startupWMClass = "XIVLauncher.Core"; + }) + ]; + + meta = with lib; { + description = "Custom launcher for FFXIV"; + homepage = "https://github.com/goatcorp/XIVLauncher.Core"; + license = licenses.gpl3; + maintainers = with maintainers; [ sersorrel witchof0x20 ]; + platforms = [ "x86_64-linux" ]; + mainProgram = "XIVLauncher.Core"; + }; + } |