-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
77 lines (65 loc) · 2.52 KB
/
Copy pathdefault.nix
File metadata and controls
77 lines (65 loc) · 2.52 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{ pkgs ? import <nixpkgs> {} }:
pkgs.python3Packages.buildPythonApplication rec {
pname = "lce-qt-launcher";
version = "0.0.21.2";
format = "pyproject";
src = ./.;
nativeBuildInputs = [
pkgs.python3Packages.hatchling
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
pkgs.steamtinkerlaunch
];
propagatedBuildInputs = with pkgs.python3Packages; [
pyside6
platformdirs
vdf
rich
];
postPatch = ''
patchShebangs scripts/
chmod +x scripts/*.sh
substituteInPlace scripts/build.sh \
--replace-fail "/usr/lib/qt6/rcc" "${pkgs.qt6.qtbase}/libexec/rcc" \
--replace-fail "/usr/lib/qt6/uic" "${pkgs.qt6.qtbase}/libexec/uic"
# Remove the build-time dependencies Nix doesn't need
# (this prevents Hatchling from complaining they are missing)
sed -i '/"hatch<=/d' pyproject.toml
sed -i '/"Nuitka<=/d' pyproject.toml
sed -i '/"patchelf<=/d' pyproject.toml
'';
# 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}/"
'';
dontCheckRuntimeDeps = true;
dontWrapQtApps = true;
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
meta = with pkgs.lib; {
description = "a custom Minecraft LCE Launcher written with PySide6 (Qt6 for Python) with Freedom and with GNU/Linux support in mind.";
license = licenses.gpl3;
platforms = platforms.linux;
mainProgram = "lce-qt-launcher";
};
}