mirror of
https://github.com/xgui4/LCE-Qt-Launcher.git
synced 2026-07-16 02:40:38 +00:00
start nixos experiment
This commit is contained in:
BIN
assets/images/4jcraft-ico.png
Normal file
BIN
assets/images/4jcraft-ico.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
$PSNativeCommandUseErrorActionPreference = $true
|
||||
|
||||
Write-Output "Donwloading image from the internet"
|
||||
curl.exe -L -o "internet-lce-hub-ico.png" "https://avatars.githubusercontent.com/u/267444710?s=48&v=4"
|
||||
curl.exe -L -o "internet-lce-evolved-ico.png" "https://codeberg.org/repo-avatars/c60b9f3bb0dfca3d35a457d921d2f68b73ebd2054d6d6e25a949bb3a7f32ad3a"
|
||||
curl.exe -L -o "internet-4jcraft-ico.png" "https://avatars.githubusercontent.com/u/265054390?s=48&v=4"
|
||||
curl.exe -L -o "internet-mclce-ico.png" "https://avatars.githubusercontent.com/u/274307453?s=200&v=4"
|
||||
Write-Output "done"
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "Donwloading image from the internet"
|
||||
curl -L -o "internet-lce-hub-ico.png" "https://avatars.githubusercontent.com/u/267444710?s=48&v=4"
|
||||
curl -L -o "internet-lce-evolved-ico.png" "https://codeberg.org/repo-avatars/c60b9f3bb0dfca3d35a457d921d2f68b73ebd2054d6d6e25a949bb3a7f32ad3a"
|
||||
curl -L -o "internet-4jcraft-ico.png" "https://avatars.githubusercontent.com/u/265054390?s=48&v=4"
|
||||
curl -L -o "internet-mclce-ico.png" "https://avatars.githubusercontent.com/u/274307453?s=200&v=4"
|
||||
echo "done"
|
||||
BIN
assets/images/lce-evolved-ico.png
Normal file
BIN
assets/images/lce-evolved-ico.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 165 KiB |
BIN
assets/images/lce-hub-ico.png
Normal file
BIN
assets/images/lce-hub-ico.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
BIN
assets/images/mclce-ico.png
Normal file
BIN
assets/images/mclce-ico.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
@@ -1 +0,0 @@
|
||||
powershell.exe -ExecutionPolicy Bypass -File "download_img.ps1"
|
||||
46
default.nix
46
default.nix
@@ -1,5 +1,3 @@
|
||||
# LCE-Qt-Launcher Nix Packages
|
||||
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
pkgs.python3Packages.buildPythonApplication rec {
|
||||
@@ -9,13 +7,19 @@ pkgs.python3Packages.buildPythonApplication rec {
|
||||
|
||||
src = ./.;
|
||||
|
||||
# Outils nécessaires à la compilation
|
||||
nativeBuildInputs = [
|
||||
pkgs.python3Packages.hatchling
|
||||
pkgs.qt6.wrapQtAppsHook # Indispensable ici pour le wrap automatique
|
||||
pkgs.python3Packages.pyside6
|
||||
pkgs.python3Packages.shiboken6
|
||||
pkgs.qt6.wrapQtAppsHook
|
||||
pkgs.qt6.qtbase
|
||||
pkgs.qt6.qtbase.dev
|
||||
pkgs.qt6.qttools
|
||||
pkgs.bash
|
||||
pkgs.coreutils
|
||||
pkgs.gnused
|
||||
];
|
||||
|
||||
# Dépendances Python (Note: pas de virgules dans les listes Nix)
|
||||
propagatedBuildInputs = with pkgs.python3Packages; [
|
||||
pyside6
|
||||
requests
|
||||
@@ -23,12 +27,38 @@ pkgs.python3Packages.buildPythonApplication rec {
|
||||
rich
|
||||
];
|
||||
|
||||
# On s'assure que le wrapper Qt est appliqué aux exécutables Python
|
||||
dontWrapQtApps = true; # On désactive le wrap automatique global...
|
||||
postPatch = ''
|
||||
patchShebangs scripts/
|
||||
chmod +x scripts/*.sh
|
||||
substituteInPlace scripts/build.sh \
|
||||
--replace-fail "/usr/lib/qt6/rcc" "rcc" \
|
||||
--replace-fail "/usr/lib/qt6/uic" "uic"
|
||||
'';
|
||||
|
||||
# Manual installation of non-Python assets (Desktop files, icons, etc.)
|
||||
postInstall = ''
|
||||
# Desktop Entry & Mime
|
||||
install -Dm644 "packages/io.github.xgui4.lce_qt_launcher.desktop" "$out/share/applications/io.github.xgui4.lce_qt_launcher.desktop"
|
||||
install -Dm644 "packages/lce_inst-mime.xml" "$out/share/mime/packages/io.github.xgui4.lce_qt_launcher.xml"
|
||||
install -Dm644 "packages/io.github.xgui4.lce_qt_launcher.metainfo.xml" "$out/share/metainfo/io.github.xgui4.lce_qt_launcher.metainfo.xml"
|
||||
|
||||
# Icons
|
||||
install -Dm644 "assets/io.github.xgui4.lce_qt_launcher.png" "$out/share/icons/hicolor/128x128/apps/io.github.xgui4.lce_qt_launcher.png"
|
||||
install -Dm644 "assets/lce_inst.png" "$out/share/icons/hicolor/128x128/mimetypes/application-x-lce_inst.png"
|
||||
|
||||
# Data/Assets (Mirroring your /opt logic into Nix share)
|
||||
mkdir -p "$out/share/${pname}"
|
||||
cp -r data assets "$out/share/${pname}/"
|
||||
|
||||
# Docs
|
||||
install -Dm644 "license.md" -t "$out/share/licenses/${pname}/"
|
||||
install -Dm644 "readme.md" "code-of-conduct.md" -t "$out/share/doc/${pname}/"
|
||||
'';
|
||||
|
||||
dontWrapQtApps = true;
|
||||
preFixup = ''
|
||||
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
||||
''; # ...pour l'injecter proprement dans le wrapper Python (meilleure pratique)
|
||||
'';
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "A custom Minecraft LCE Launcher written in Python and Qt with GNU/Linux support in mind.";
|
||||
|
||||
@@ -16,9 +16,7 @@ class CustomBuildHook(BuildHookInterface): # pyright: ignore[reportMissingTypeA
|
||||
@override
|
||||
def initialize(self, version, build_data) -> None: # pyright: ignore[reportMissingParameterType]
|
||||
if os.name == "posix":
|
||||
_ = subprocess.run("./scripts/prepare.sh", check=True)
|
||||
_ = subprocess.run("./scripts/build.sh", check=True)
|
||||
if os.name == "nt":
|
||||
_ = subprocess.run("scripts\\prepare.cmd", check=True, shell=True)
|
||||
_ = subprocess.run("scripts\\build.cmd", check=True, shell=True)
|
||||
return super().initialize(version, build_data)
|
||||
8
res.qrc
8
res.qrc
@@ -14,10 +14,10 @@
|
||||
<file alias="button-disabled.png">assets/images/button-disabled.png</file>
|
||||
<file alias="gear.gif">assets/images/gear.gif</file>
|
||||
<file alias="news.png">assets/images/news.png</file>
|
||||
<file alias="mclce-ico.png">assets/images/internet-mclce-ico.png</file>
|
||||
<file alias="4jcraft-ico.png">assets/images/internet-4jcraft-ico.png</file>
|
||||
<file alias="lce-evolved-ico.png">assets/images/internet-lce-evolved-ico.png</file>
|
||||
<file alias="lce-hub-ico.png">assets/images/internet-lce-hub-ico.png</file>
|
||||
<file alias="mclce-ico.png">assets/images/mclce-ico.png</file>
|
||||
<file alias="4jcraft-ico.png">assets/images/4jcraft-ico.png</file>
|
||||
<file alias="lce-evolved-ico.png">assets/images/lce-evolved-ico.png</file>
|
||||
<file alias="lce-hub-ico.png">assets/images/lce-hub-ico.png</file>
|
||||
<file alias="chest.png">assets/images/chest.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/styles">
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
@echo off
|
||||
|
||||
echo "Changing directory to the images directory"
|
||||
cd assets/images || exit /b 1p
|
||||
echo "done"
|
||||
|
||||
pwsh-bypass.bat
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "Changing directory to the images directory"
|
||||
cd assets/images
|
||||
echo "done"
|
||||
|
||||
./download_img.sh
|
||||
Reference in New Issue
Block a user