From 8da6a217bcf3c4230c7920919c617948d05f85d9 Mon Sep 17 00:00:00 2001 From: Edward? <128195750+HuntedRaven7@users.noreply.github.com> Date: Thu, 16 Jul 2026 14:08:19 -0400 Subject: [PATCH 1/2] Feat: Nix Flake install method with ci (#146) --- .github/workflows/nix.yml | 38 +++++++++++ .gitignore | 4 ++ README.md | 13 ++++ flake.lock | 27 ++++++++ flake.nix | 83 ++++++++++++++++++++++++ nix/package.nix | 131 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 296 insertions(+) create mode 100644 .github/workflows/nix.yml create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 nix/package.nix diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..447ee2c --- /dev/null +++ b/.github/workflows/nix.yml @@ -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 diff --git a/.gitignore b/.gitignore index f701a55..a2928d6 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,10 @@ .DS_Store Thumbs.db +# Nix +/result +/result-* + # Log files *.log diff --git a/README.md b/README.md index 6f2d1ba..fc9614b 100644 --- a/README.md +++ b/README.md @@ -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,18 @@ 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..default` (or `emerald-legacy-launcher`) from it. + **Flatpak Installation:** ```bash flatpak install emerald.flatpak diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5b993c3 --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..a371015 --- /dev/null +++ b/flake.nix @@ -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); + }; +} diff --git a/nix/package.nix b/nix/package.nix new file mode 100644 index 0000000..1c2db27 --- /dev/null +++ b/nix/package.nix @@ -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 = [ ]; + }; +}) From 962979c70ed05355bf12e7ac350d7340c7ba17dc Mon Sep 17 00:00:00 2001 From: Edward? <128195750+HuntedRaven7@users.noreply.github.com> Date: Thu, 16 Jul 2026 21:28:24 -0400 Subject: [PATCH 2/2] Feat: Adding Gentoo Ebuild (#148) Co-authored-by: /home/neo <158327205+neoapps-dev@users.noreply.github.com> --- BUILDING.md | 6 +- README.md | 12 +++ .../emerald-legacy-launcher/Manifest | 1 + .../emerald-legacy-launcher-1.5.1.ebuild | 79 +++++++++++++++++++ .../emerald-legacy-launcher-9999.ebuild | 79 +++++++++++++++++++ .../files/emerald-legacy-launcher.desktop | 11 +++ .../emerald-legacy-launcher/metadata.xml | 14 ++++ gentoo/metadata/layout.conf | 3 + gentoo/profiles/repo_name | 1 + 9 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 gentoo/games-util/emerald-legacy-launcher/Manifest create mode 100644 gentoo/games-util/emerald-legacy-launcher/emerald-legacy-launcher-1.5.1.ebuild create mode 100644 gentoo/games-util/emerald-legacy-launcher/emerald-legacy-launcher-9999.ebuild create mode 100644 gentoo/games-util/emerald-legacy-launcher/files/emerald-legacy-launcher.desktop create mode 100644 gentoo/games-util/emerald-legacy-launcher/metadata.xml create mode 100644 gentoo/metadata/layout.conf create mode 100644 gentoo/profiles/repo_name diff --git a/BUILDING.md b/BUILDING.md index 3e6c46d..d5410a1 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -32,4 +32,8 @@ codesign --force --deep --sign - "/path/to/Emerald\ Legacy\ Launcher.app" ```sh pnpm flatpak # or npm -``` \ No newline at end of file +``` + +## Gentoo + +A Portage overlay lives in [`gentoo/`](gentoo/). See the GNU/Linux installation section in [README.md](README.md). diff --git a/README.md b/README.md index fc9614b..31ca458 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,18 @@ nix profile install github:LCE-Hub/LCE-Emerald-Launcher On NixOS, add the flake as an input and install `packages..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 diff --git a/gentoo/games-util/emerald-legacy-launcher/Manifest b/gentoo/games-util/emerald-legacy-launcher/Manifest new file mode 100644 index 0000000..b72ef44 --- /dev/null +++ b/gentoo/games-util/emerald-legacy-launcher/Manifest @@ -0,0 +1 @@ +DIST emerald-legacy-launcher-1.5.1.tar.gz 18500442 BLAKE2B 365d9dd36ee6fddb90625719b599c8fc492eba4ce0fb8926c953f2a7d7f4987bf77d91de6a140a489534ba61e8a71bf9e65d8e015a35af31bccb84ca3a023178 SHA512 c713ef81e56d55d7135fa4228f875822a3eee38ace86d8d28a59a8b4afeff28844bf698e9902eb66075b425a0fb71ae72969ae1fe99ce185a005b5f42a4dccc8 diff --git a/gentoo/games-util/emerald-legacy-launcher/emerald-legacy-launcher-1.5.1.ebuild b/gentoo/games-util/emerald-legacy-launcher/emerald-legacy-launcher-1.5.1.ebuild new file mode 100644 index 0000000..96fce97 --- /dev/null +++ b/gentoo/games-util/emerald-legacy-launcher/emerald-legacy-launcher-1.5.1.ebuild @@ -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 +} diff --git a/gentoo/games-util/emerald-legacy-launcher/emerald-legacy-launcher-9999.ebuild b/gentoo/games-util/emerald-legacy-launcher/emerald-legacy-launcher-9999.ebuild new file mode 100644 index 0000000..318574c --- /dev/null +++ b/gentoo/games-util/emerald-legacy-launcher/emerald-legacy-launcher-9999.ebuild @@ -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 +} diff --git a/gentoo/games-util/emerald-legacy-launcher/files/emerald-legacy-launcher.desktop b/gentoo/games-util/emerald-legacy-launcher/files/emerald-legacy-launcher.desktop new file mode 100644 index 0000000..58919c1 --- /dev/null +++ b/gentoo/games-util/emerald-legacy-launcher/files/emerald-legacy-launcher.desktop @@ -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 diff --git a/gentoo/games-util/emerald-legacy-launcher/metadata.xml b/gentoo/games-util/emerald-legacy-launcher/metadata.xml new file mode 100644 index 0000000..0164f8d --- /dev/null +++ b/gentoo/games-util/emerald-legacy-launcher/metadata.xml @@ -0,0 +1,14 @@ + + + + + LCE-Hub/LCE-Emerald-Launcher + https://github.com/LCE-Hub/LCE-Emerald-Launcher/issues + + + 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. + + diff --git a/gentoo/metadata/layout.conf b/gentoo/metadata/layout.conf new file mode 100644 index 0000000..20fcfea --- /dev/null +++ b/gentoo/metadata/layout.conf @@ -0,0 +1,3 @@ +masters = gentoo +thin-manifests = true +sign-manifests = false diff --git a/gentoo/profiles/repo_name b/gentoo/profiles/repo_name new file mode 100644 index 0000000..4973375 --- /dev/null +++ b/gentoo/profiles/repo_name @@ -0,0 +1 @@ +emerald-legacy-launcher