Skip to content

Commit

Permalink
xivlauncher-rb: init at 1.1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
drakon64 committed Jul 12, 2024
1 parent 0c3948b commit ed73fd0
Show file tree
Hide file tree
Showing 14 changed files with 346 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "daily"
43 changes: 9 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,38 @@ on:
push:
branches:
- main
- master
schedule:
# rebuild everyday at 2:51
# TIP: Choose a random time here so not all repositories are build at once:
# https://www.random.org/clock-times/?num=1&earliest=01%3A00&latest=08%3A00&interval=5&format=html&rnd=new
- cron: '51 2 * * *'
- cron: '30 17 * * *'

jobs:
tests:
strategy:
matrix:
# Set this to notify the global nur package registry that changes are
# available.
#
# The repo name as used in
# https://github.com/nix-community/NUR/blob/master/repos.json
nurRepo:
- <YOUR_REPO_NAME>
# Set this to cache your build results in cachix for faster builds
# in CI and for everyone who uses your cache.
#
# Format: Your cachix cache host name without the ".cachix.org" suffix.
# Example: mycache (for mycache.cachix.org)
#
# For this to work, you also need to set the CACHIX_SIGNING_KEY or
# CACHIX_AUTH_TOKEN secret in your repository secrets settings in
# Github found at
# https://github.com/<your_githubname>/nur-packages/settings/secrets
cachixName:
- <YOUR_CACHIX_NAME>
nixPath:
- nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz
- nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-unstable.tar.gz
- nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-24.05.tar.gz

runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install nix
uses: cachix/install-nix-action@V27
with:
nix_path: "${{ matrix.nixPath }}"
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Show nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'

- name: Setup cachix
uses: cachix/cachix-action@v15
# Don't replace <YOUR_CACHIX_NAME> here!
if: ${{ matrix.cachixName != '<YOUR_CACHIX_NAME>' }}
with:
name: ${{ matrix.cachixName }}
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
name: drakon64
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Check evaluation
run: |
nix-env -f . -qa \* --meta --xml \
Expand All @@ -67,9 +45,6 @@ jobs:
--drv-path --show-trace \
-I nixpkgs=$(nix-instantiate --find-file nixpkgs) \
-I $PWD
- name: Build nix packages
run: nix shell -f '<nixpkgs>' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs
- name: Trigger NUR update
# Don't replace <YOUR_REPO_NAME> here!
if: ${{ matrix.nurRepo != '<YOUR_REPO_NAME>' }}
run: curl -XPOST "https://nur-update.nix-community.org/update?repo=${{ matrix.nurRepo }}"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea

result
result-*

11 changes: 0 additions & 11 deletions ci.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# This file provides all the buildable and cacheable packages and
# package outputs in your package set. These are what gets built by CI,
# so if you correctly mark packages as
#
# - broken (using `meta.broken`),
# - unfree (using `meta.license.free`), and
# - locally built (using `preferLocalBuild`)
#
# then your CI will be able to build and cache only those packages for
# which this is possible.

{ pkgs ? import <nixpkgs> { } }:

with builtins;
Expand Down
12 changes: 1 addition & 11 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# This file describes your repository contents.
# It should return a set of nix derivations
# and optionally the special attributes `lib`, `modules` and `overlays`.
# It should NOT import <nixpkgs>. Instead, you should take pkgs as an argument.
# Having pkgs default to <nixpkgs> is fine though, and it lets you use short
# commands such as:
# nix-build -A mypackage

{ pkgs ? import <nixpkgs> { } }:

{
Expand All @@ -14,7 +6,5 @@
modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays

example-package = pkgs.callPackage ./pkgs/example-package { };
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
# ...
xivlauncher-rb = pkgs.callPackage ./pkgs/xivlauncher-rb { };
}
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
{
description = "My personal NUR repository";
description = "Cross-platform version of XIVLauncher, optimized for Steam Deck";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
let
systems = [
"x86_64-linux"
"i686-linux"
"x86_64-darwin"
"aarch64-linux"
"armv6l-linux"
"armv7l-linux"
];
systems = [ "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in
{
Expand Down
6 changes: 1 addition & 5 deletions lib/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{ pkgs }:

with pkgs.lib; {
# Add your library functions here
#
# hexint = x: hexvals.${toLower x};
}
with pkgs.lib; {}
6 changes: 1 addition & 5 deletions modules/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
# Add your NixOS modules here
#
# my-module = ./my-module;
}
{}
4 changes: 0 additions & 4 deletions overlay.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# You can use this file as a nixpkgs overlay. This is useful in the
# case where you don't want to add the whole NUR namespace to your
# configuration.

self: super:
let
isReserved = n: n == "lib" || n == "overlays" || n == "modules";
Expand Down
6 changes: 1 addition & 5 deletions overlays/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
# Add your overlays here
#
# my-overlay = import ./my-overlay;
}
{}
9 changes: 0 additions & 9 deletions pkgs/example-package/default.nix

This file was deleted.

87 changes: 87 additions & 0 deletions pkgs/xivlauncher-rb/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{ lib, buildDotnetModule, fetchFromGitHub, dotnetCorePackages, SDL2, libsecret, glib, gnutls, aria2, steam, gst_all_1
, copyDesktopItems, makeDesktopItem, makeWrapper
, useSteamRun ? true }:

let
tag = "1.1.0.6";
in
buildDotnetModule rec {
pname = "xivlauncher-rb";
version = tag;

src = fetchFromGitHub {
owner = "rankynbass";
repo = "XIVLauncher.Core";
rev = "rb-v${tag}";
hash = "sha256-ptpQnWC7aYmC0apwMWTCAQuyG7vUF50fERiXFWHrxg4=";
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-rb.passthru.fetch-deps`

# please do not unpin these even if they match the defaults, xivlauncher is sensitive to .NET versions
dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-runtime = dotnetCorePackages.runtime_8_0;

dotnetFlags = [
"-p:BuildHash=${tag}"
"-p:PublishSingleFile=false"
];

postPatch = ''
substituteInPlace lib/FFXIVQuickLauncher/src/XIVLauncher.Common/Game/Patch/Acquisition/Aria/AriaHttpPatchAcquisition.cs \
--replace-fail '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 pkgs.zstd ];
extraProfile = ''
unset TZ
'';
}).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-rb";
exec = "XIVLauncher.Core";
icon = "xivlauncher";
desktopName = "XIVLauncher-RB";
comment = meta.description;
categories = [ "Game" ];
startupWMClass = "XIVLauncher.Core";
})
];

meta = with lib; {
description = "Custom launcher for FFXIV";
homepage = "https://github.com/rankynbass/XIVLauncher.Core";
license = licenses.gpl3;
# maintainers = with maintainers; [ sersorrel witchof0x20 ];
platforms = [ "x86_64-linux" ];
mainProgram = "XIVLauncher.Core";
};
}
Loading

0 comments on commit ed73fd0

Please sign in to comment.