Merge branch 'main' into conversion

This commit is contained in:
/home/neo 2026-07-17 21:13:03 +03:00 committed by GitHub
commit 55beacaab1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 501 additions and 1 deletions

38
.github/workflows/nix.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Nix
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
id-token: write
concurrency:
group: nix-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build package
run: nix build .#default --print-build-logs
- name: Flake check
run: nix flake check --print-build-logs
- name: Verify outputs
run: |
test -x ./result/bin/emerald-legacy-launcher
nix path-info -Sh ./result
ls -la ./result/bin/
ls -la ./result/share/applications/ || true

4
.gitignore vendored
View file

@ -24,6 +24,10 @@
.DS_Store
Thumbs.db
# Nix
/result
/result-*
# Log files
*.log

View file

@ -32,4 +32,8 @@ codesign --force --deep --sign - "/path/to/Emerald\ Legacy\ Launcher.app"
```sh
pnpm flatpak # or npm
```
```
## Gentoo
A Portage overlay lives in [`gentoo/`](gentoo/). See the GNU/Linux installation section in [README.md](README.md).

View file

@ -108,6 +108,7 @@ Multiple distribution formats available:
| `.rpm` | RHEL, Fedora, openSUSE |
| `.AppImage` | Universal (no installation required) |
| `.flatpak` | Universal with sandboxing (recommended over AppImage) |
| Nix flake | NixOS and any Linux with [Nix](https://nixos.org/download/) installed |
**AUR:**
Special thanks to [AntiApple4life](https://aur.archlinux.org/packages?O=0&SeB=m&K=AntiApple4life) for the AUR packages!
@ -122,6 +123,30 @@ paru -S emerald-legacy-launcher # or yay
paru -S emerald-legacy-launcher-bin # or yay
```
**Nix:**
Requires [Nix](https://nixos.org/download/) with flakes enabled (`experimental-features = nix-command flakes` in `nix.conf`).
```bash
# Run without installing
nix run github:LCE-Hub/LCE-Emerald-Launcher
# Install to your user profile
nix profile install github:LCE-Hub/LCE-Emerald-Launcher
```
On NixOS, add the flake as an input and install `packages.<system>.default` (or `emerald-legacy-launcher`) from it.
**Gentoo:**
This repository includes a local Portage overlay under [`gentoo/`](gentoo/). Point `repos.conf` at that directory, then emerge the package (build fetches Cargo/npm deps over the network; Wine/Proton is needed at runtime to launch games):
```bash
# /etc/portage/repos.conf/emerald-legacy-launcher.conf
[emerald-legacy-launcher]
location = /path/to/LCE-Emerald-Launcher/gentoo
auto-sync = no
sudo emerge games-util/emerald-legacy-launcher # 1.5.1
# sudo emerge =games-util/emerald-legacy-launcher-9999 # live git
```
**Flatpak Installation:**
```bash
flatpak install emerald.flatpak

27
flake.lock Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1784120854,
"narHash": "sha256-KesHgItiZPgGX740axSiQLcIQ8D24MDqNpkKYWIek8k=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "753cc8a3a87467296ddd1fa93f0cc3e81120ee46",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

83
flake.nix Normal file
View file

@ -0,0 +1,83 @@
{
description = "LCE Emerald Launcher FOSS cross-platform launcher for Minecraft Legacy Console Edition";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
inherit (nixpkgs) lib;
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = lib.genAttrs systems;
pkgsFor =
system:
import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in
{
overlays.default = final: _prev: {
emerald-legacy-launcher = final.callPackage ./nix/package.nix {
src = self;
};
};
packages = forAllSystems (
system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.emerald-legacy-launcher;
emerald-legacy-launcher = pkgs.emerald-legacy-launcher;
}
);
apps = forAllSystems (system: {
default = {
type = "app";
program = lib.getExe self.packages.${system}.default;
};
});
checks = forAllSystems (system: {
package = self.packages.${system}.default;
});
devShells = forAllSystems (
system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.mkShell {
inputsFrom = [ pkgs.emerald-legacy-launcher ];
packages = with pkgs; [
cargo
rustc
rustfmt
clippy
cargo-tauri
nodejs
pnpm_10
pkg-config
];
shellHook = ''
echo "Emerald Legacy Launcher dev shell"
echo " pnpm install && pnpm tauri dev"
'';
};
}
);
formatter = forAllSystems (system: (pkgsFor system).nixfmt);
};
}

View file

@ -0,0 +1 @@
DIST emerald-legacy-launcher-1.5.1.tar.gz 18500442 BLAKE2B 365d9dd36ee6fddb90625719b599c8fc492eba4ce0fb8926c953f2a7d7f4987bf77d91de6a140a489534ba61e8a71bf9e65d8e015a35af31bccb84ca3a023178 SHA512 c713ef81e56d55d7135fa4228f875822a3eee38ace86d8d28a59a8b4afeff28844bf698e9902eb66075b425a0fb71ae72969ae1fe99ce185a005b5f42a4dccc8

View file

@ -0,0 +1,79 @@
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit desktop xdg
DESCRIPTION="FOSS cross-platform launcher for Minecraft Legacy Console Edition"
HOMEPAGE="https://github.com/LCE-Hub/LCE-Emerald-Launcher"
SRC_URI="https://github.com/LCE-Hub/LCE-Emerald-Launcher/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/LCE-Emerald-Launcher-${PV}"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
# Cargo crates and npm packages are fetched at build time.
RESTRICT="network-sandbox"
RDEPEND="
dev-libs/glib:2
dev-libs/libayatana-appindicator
dev-libs/openssl:=
net-libs/libsoup:3.0
net-libs/webkit-gtk:4.1
x11-libs/cairo
x11-libs/gdk-pixbuf:2
x11-libs/gtk+:3
x11-libs/pango
"
DEPEND="${RDEPEND}"
BDEPEND="
|| (
>=dev-lang/rust-1.77.0:*
>=dev-lang/rust-bin-1.77.0:*
)
net-libs/nodejs[npm]
virtual/pkgconfig
"
# Rust binaries ignore *FLAGS from make.conf.
QA_FLAGS_IGNORED="usr/bin/emerald-legacy-launcher"
src_prepare() {
default
# Disable updater artifact signing (no Tauri signing key in distro builds).
sed -i \
-e 's/"createUpdaterArtifacts": true/"createUpdaterArtifacts": false/' \
src-tauri/tauri.conf.json || die
}
src_compile() {
local -x CI=true
local -x npm_config_audit=false
local -x npm_config_fund=false
local -x npm_config_update_notifier=false
npm install || die "npm install failed"
npm run tauri -- build --no-bundle || die "tauri build failed"
}
src_install() {
dobin src-tauri/target/release/emerald-legacy-launcher
newicon -s 32 src-tauri/icons/32x32.png emerald-legacy-launcher.png
newicon -s 64 src-tauri/icons/64x64.png emerald-legacy-launcher.png
newicon -s 128 src-tauri/icons/128x128.png emerald-legacy-launcher.png
newicon -s 256 src-tauri/icons/128x128@2x.png emerald-legacy-launcher.png
newicon -s 512 src-tauri/icons/icon.png emerald-legacy-launcher.png
domenu "${FILESDIR}"/emerald-legacy-launcher.desktop
insinto /usr/share/metainfo
newins flatpak/io.github.Emerald_Legacy_Launcher.Emerald_Legacy_Launcher.metainfo.xml \
io.github.Emerald_Legacy_Launcher.Emerald_Legacy_Launcher.metainfo.xml
dodoc README.md LICENSE
}

View file

@ -0,0 +1,79 @@
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit desktop git-r3 xdg
DESCRIPTION="FOSS cross-platform launcher for Minecraft Legacy Console Edition"
HOMEPAGE="https://github.com/LCE-Hub/LCE-Emerald-Launcher"
EGIT_REPO_URI="https://github.com/LCE-Hub/LCE-Emerald-Launcher.git"
LICENSE="GPL-3"
SLOT="0"
PROPERTIES="live"
# Cargo crates and npm packages are fetched at build time.
RESTRICT="network-sandbox"
RDEPEND="
dev-libs/glib:2
dev-libs/libayatana-appindicator
dev-libs/openssl:=
net-libs/libsoup:3.0
net-libs/webkit-gtk:4.1
x11-libs/cairo
x11-libs/gdk-pixbuf:2
x11-libs/gtk+:3
x11-libs/pango
"
DEPEND="${RDEPEND}"
BDEPEND="
|| (
>=dev-lang/rust-1.77.0:*
>=dev-lang/rust-bin-1.77.0:*
)
net-libs/nodejs[npm]
virtual/pkgconfig
"
# Rust binaries ignore *FLAGS from make.conf.
QA_FLAGS_IGNORED="usr/bin/emerald-legacy-launcher"
src_prepare() {
default
# Prefer npm for the frontend build; disable updater artifact signing
# (no Tauri signing key in distro builds).
sed -i \
-e 's/"createUpdaterArtifacts": true/"createUpdaterArtifacts": false/' \
src-tauri/tauri.conf.json || die
}
src_compile() {
local -x CI=true
local -x npm_config_audit=false
local -x npm_config_fund=false
local -x npm_config_update_notifier=false
npm install || die "npm install failed"
npm run tauri -- build --no-bundle || die "tauri build failed"
}
src_install() {
dobin src-tauri/target/release/emerald-legacy-launcher
newicon -s 32 src-tauri/icons/32x32.png emerald-legacy-launcher.png
newicon -s 64 src-tauri/icons/64x64.png emerald-legacy-launcher.png
newicon -s 128 src-tauri/icons/128x128.png emerald-legacy-launcher.png
newicon -s 256 src-tauri/icons/128x128@2x.png emerald-legacy-launcher.png
newicon -s 512 src-tauri/icons/icon.png emerald-legacy-launcher.png
domenu "${FILESDIR}"/emerald-legacy-launcher.desktop
insinto /usr/share/metainfo
newins flatpak/io.github.Emerald_Legacy_Launcher.Emerald_Legacy_Launcher.metainfo.xml \
io.github.Emerald_Legacy_Launcher.Emerald_Legacy_Launcher.metainfo.xml
dodoc README.md LICENSE
}

View file

@ -0,0 +1,11 @@
[Desktop Entry]
Name=LCE Emerald Launcher
Comment=FOSS cross-platform launcher for Minecraft Legacy Console Edition
Exec=emerald-legacy-launcher %u
Icon=emerald-legacy-launcher
Type=Application
Categories=Game;
MimeType=x-scheme-handler/emerald;x-scheme-handler/emeraldlauncher;x-scheme-handler/discord-1482504445152460871;
StartupNotify=true
StartupWMClass=emerald-legacy-launcher
Terminal=false

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<upstream>
<remote-id type="github">LCE-Hub/LCE-Emerald-Launcher</remote-id>
<bugs-to>https://github.com/LCE-Hub/LCE-Emerald-Launcher/issues</bugs-to>
</upstream>
<longdescription lang="en">
LCE Emerald Launcher is a FOSS cross-platform Tauri launcher for
Minecraft Legacy Console Edition. It installs community builds,
manages versions, skins, and workshop content, and launches the game
via Wine/Proton on Linux.
</longdescription>
</pkgmetadata>

View file

@ -0,0 +1,3 @@
masters = gentoo
thin-manifests = true
sign-manifests = false

View file

@ -0,0 +1 @@
emerald-legacy-launcher

131
nix/package.nix Normal file
View file

@ -0,0 +1,131 @@
{
lib,
stdenv,
rustPlatform,
cargo-tauri,
nodejs,
pkg-config,
pnpm_10,
fetchPnpmDeps,
pnpmConfigHook,
wrapGAppsHook4,
openssl,
webkitgtk_4_1,
glib-networking,
libayatana-appindicator,
librsvg,
udev,
src ? null,
}:
# Disable updater artifact signing — Nix builds have no Tauri signing key.
let
tauriConfOverride = builtins.toFile "tauri-nix.conf.json" ''
{
"bundle": {
"createUpdaterArtifacts": false
}
}
'';
defaultSrc = lib.cleanSourceWith {
src = ../.;
filter =
path: _type:
let
baseName = baseNameOf path;
in
!(builtins.elem baseName [
".git"
"node_modules"
"target"
"dist"
"build-flatpak"
"emerald-repo"
"result"
"result-dev"
]);
};
in
rustPlatform.buildRustPackage (finalAttrs: {
pname = "emerald-legacy-launcher";
version = "1.5.1";
src = if src != null then src else defaultSrc;
cargoRoot = "src-tauri";
buildAndTestSubdir = finalAttrs.cargoRoot;
cargoHash = "sha256-tSbFyle2eQ5Dw9fTXloIepOZU1UxhkF6/KZBRXehm4w=";
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
pnpm = pnpm_10;
fetcherVersion = 3;
hash = "sha256-6na8YlSTkdnSse8DQjBnTBpfmKSYj3+1FLWVyyfUx1g=";
};
nativeBuildInputs = [
cargo-tauri.hook
nodejs
pkg-config
pnpmConfigHook
pnpm_10
]
++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ];
buildInputs = [
openssl
]
++ lib.optionals stdenv.hostPlatform.isLinux [
glib-networking
libayatana-appindicator
librsvg
udev
webkitgtk_4_1
];
tauriBuildFlags = [
"-c"
tauriConfOverride
];
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace "$cargoDepsCopy"/*/libappindicator-sys-*/src/lib.rs \
--replace-fail "libayatana-appindicator3.so.1" \
"${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
'';
# Prefer the project's pnpm frontend build over the npm beforeBuildCommand.
preBuild = ''
substituteInPlace src-tauri/tauri.conf.json \
--replace-fail '"beforeBuildCommand": "npm run build"' \
'"beforeBuildCommand": "pnpm run build"'
'';
preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [
libayatana-appindicator
udev
]
}
)
'';
doCheck = false;
env = {
CI = "true";
};
meta = {
description = "FOSS cross-platform launcher for Minecraft Legacy Console Edition";
homepage = "https://github.com/LCE-Hub/LCE-Emerald-Launcher";
license = lib.licenses.gpl3Only;
mainProgram = "emerald-legacy-launcher";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = [ ];
};
})