about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/emulators/yuzu/early-access/default.nix
blob: 842f7c1079751b6e5ead14f337bc1aa3aa891591 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ mainline, fetchzip, fetchgit, runCommand, gnutar }:
# The mirror repo for early access builds is missing submodule info,
# but the Windows distributions include a source tarball, which in turn
# includes the full git metadata. So, grab that and rehydrate it.
# This has the unfortunate side effect of requiring two FODs, one
# for the Windows download and one for the full repo with submodules.
let
  sources = import ./sources.nix;

  zip = fetchzip {
    name = "yuzu-ea-windows-dist";
    url = "https://github.com/pineappleEA/pineapple-src/releases/download/EA-${sources.version}/Windows-Yuzu-EA-${sources.version}.zip";
    hash = sources.distHash;
  };

  gitSrc = runCommand "yuzu-ea-dist-unpacked" {
    src = zip;
    nativeBuildInputs = [ gnutar ];
  }
  ''
    mkdir $out
    tar xf $src/*.tar.xz --directory=$out --strip-components=1
  '';

  rehydratedSrc = fetchgit {
    url = gitSrc;
    fetchSubmodules = true;
    hash = sources.fullHash;
  };
in mainline.overrideAttrs(old: {
  pname = "yuzu-early-access";
  version = sources.version;
  src = rehydratedSrc;
  passthru.updateScript = ./update.sh;
  meta = old.meta // { description = old.meta.description + " - early access branch"; };
})