NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.77k stars 13.18k forks source link

Package request: GDLauncher Carbon #269067

Open huantianad opened 8 months ago

huantianad commented 8 months ago

Project description

GDLauncher is a custom Minecraft launcher written from the ground up in rust and solidJS. Its main goal is to make it easy and enjoyable to manage different Minecraft versions, install modloaders, mods and modpacks from different platforms, bringing the playing and modding experience to the next level!

This launcher is the successor to the old FOSS GDLauncher, rewritten in Rust, using electron. See issue for tracking packaging of original launcher #151244.

Unlike the launcher this is a successor to, building from source may not be a viable option as the launcher loses many features when built from source (from the discord, it "wont connect to our server / no curseforge support and you have to get your own mc auth stuff"). It's worth looking into what exactly is lost when building from source and what alternatives there may be to those (e.g. our own implementations). It might also be beneficial to provide a binary package along side the source package.

Metadata

Priorities

Add a :+1: reaction to issues you find important.

PassiveLemon commented 8 months ago

The source built problems might be because of the required API key as said in this section: https://github.com/gorilla-devs/GDLauncher-Carbon#a-quick-note I'm still slowly working on that package but there's very little reference in nixpkgs for packages built with pnpm so I get stuck a lot.

huantianad commented 8 months ago

Yeah unfortunately no one builder yet, but I think there just a few ones you can look at. I assume you already know this but definitely just search pnpm in nixpkgs, I think there's one that vesktop was based off of, that also used pnpm and Rust, like Carbon does.

Hopefully we can get some amount of functionality without an API key, or perhaps we could get our own?

PassiveLemon commented 8 months ago

Yeah I've looked at those couple. I've got my WIP code here: https://github.com/PassiveLemon/lemonix/blob/master/pkgs/gdlauncher-carbon/default.nix but I cant get it to work yet.

Hopefully we can get some amount of functionality without an API key, or perhaps we could get our own?

Apparently you can get your own API key but its for development purposes so it might not be super accessible

PassiveLemon commented 7 months ago

I've been unable to figure out how to get it to build from source unfortunately. However, they do provide an appimage link in their discord server which, afaik, is the only place it can be found. You can use this to install it:

{ lib,
  appimageTools,
  fetchurl,
}:
let
  pname = "gdlauncher-carbon";
  version = "alpha.1702056058";
  src = fetchurl {
    url = "https://cdn-raw.gdl.gg/launcher/GDLauncher__2.0.0-${version}__linux__x64.AppImage";
    hash = "sha256-zzzy0mILrRX/o3o7Ni8WpQCliMhrGWqoXXlz5/j/y+o=";
  };

  appimageContents = appimageTools.extractType2 { inherit pname version src; };
in
appimageTools.wrapType2 {
  inherit pname version src;

  extraInstallCommands = ''
    mv $out/bin/${pname}-${version} $out/bin/${pname}

    install -Dm444 ${appimageContents}/@gddesktop.desktop -t $out/share/applications
    install -Dm444 ${appimageContents}/@gddesktop.png $out/share/pixmaps/gdlauncher-carbon.png
    substituteInPlace $out/share/applications/@gddesktop.desktop \
      --replace 'Exec=AppRun --no-sandbox %U' 'Exec=${pname}' \
      --replace 'Icon=@gddesktop' 'Icon=gdlauncher-carbon'
    cp -r ${appimageContents}/usr/share/icons $out/share
  '';

  meta = with lib; {
    description = "A simple, yet powerful Minecraft custom launcher with a strong focus on the user experience";
    homepage = "https://gdlauncher.com/";
    license = licenses.bsl11;
    mainProgram = "gdlauncher-carbon";
    maintainers = with maintainers; [ ];
    platforms = [ "x86_64-linux" ];
  };
}

They update the version pretty frequently.

huantianad commented 7 months ago

Do you think we can grab the asar and use system electron to avoid extra deps in a FHS?