diff --git a/nixos/modules/services/x11/desktop-managers/lumina.nix b/nixos/modules/services/x11/desktop-managers/lumina.nix index 43fed2572b51..957b6ab63bb9 100644 --- a/nixos/modules/services/x11/desktop-managers/lumina.nix +++ b/nixos/modules/services/x11/desktop-managers/lumina.nix @@ -26,18 +26,13 @@ in services.xserver.desktopManager.session = singleton { name = "lumina"; start = '' - exec ${pkgs.lumina}/bin/start-lumina-desktop + exec ${pkgs.lumina.lumina}/bin/start-lumina-desktop ''; }; - environment.systemPackages = [ - pkgs.fluxbox - pkgs.libsForQt5.kwindowsystem - pkgs.lumina - pkgs.numlockx - pkgs.qt5.qtsvg - pkgs.xscreensaver - ]; + environment.systemPackages = + pkgs.lumina.preRequisitePackages ++ + pkgs.lumina.corePackages; # Link some extra directories in /run/current-system/software/share environment.pathsToLink = [ diff --git a/pkgs/desktops/lumina/default.nix b/pkgs/desktops/lumina/default.nix index 00ebfd8a7253..10e75eea38f0 100644 --- a/pkgs/desktops/lumina/default.nix +++ b/pkgs/desktops/lumina/default.nix @@ -1,84 +1,26 @@ -{ stdenv, fetchFromGitHub, fluxbox, xscreensaver, desktop-file-utils, - numlockx, xorg, qtbase, qtsvg, qtmultimedia, qtx11extras, qmake, - qttools, poppler, wrapGAppsHook -}: +{ pkgs, libsForQt5 }: -stdenv.mkDerivation rec { - name = "lumina-${version}"; - version = "1.4.0-p1"; +let + packages = self: with self; { + + lumina = callPackage ./lumina { }; + lumina-calculator = callPackage ./lumina-calculator { }; + lumina-pdf = callPackage ./lumina-pdf { }; + + preRequisitePackages = [ + pkgs.fluxbox + pkgs.libsForQt5.kwindowsystem + pkgs.numlockx + pkgs.qt5.qtsvg + pkgs.xscreensaver + ]; + + corePackages = [ + lumina + lumina-calculator + lumina-pdf + ]; - src = fetchFromGitHub { - owner = "trueos"; - repo = "lumina"; - rev = "v${version}"; - sha256 = "0jin0a2s6pjbpw7w1bz67dgqp0xlpw1a7nh8zv0qwdf954zczanp"; }; - nativeBuildInputs = [ - qmake - qttools - wrapGAppsHook - ]; - - buildInputs = [ - xorg.libxcb - xorg.libXdamage - xorg.xcbutilwm - xorg.xcbutilimage - qtbase - qtsvg - qtmultimedia - qtx11extras - poppler - fluxbox - xscreensaver - desktop-file-utils - numlockx - ]; - - patches = [ - ./avoid-absolute-path-on-sessdir.patch - ./LuminaOS-NixOS.cpp.patch - ]; - - prePatch = '' - # Copy Gentoo setup as NixOS setup and then patch it - # TODO: write a complete NixOS setup? - cp -a src-qt5/core/libLumina/LuminaOS-Gentoo.cpp src-qt5/core/libLumina/LuminaOS-NixOS.cpp - ''; - - postPatch = '' - # Fix location of poppler-qt5.h - substituteInPlace src-qt5/desktop-utils/lumina-pdf/mainUI.h \ - --replace '#include ' '#include ' - - # Fix plugin dir - substituteInPlace src-qt5/core/lumina-theme-engine/lthemeengine.pri \ - --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix" - - # Fix location of fluxbox styles - substituteInPlace src-qt5/core-utils/lumina-config/pages/page_fluxbox_settings.cpp \ - --replace 'LOS::AppPrefix()+"share/fluxbox' "\"${fluxbox}/share/fluxbox" - ''; - - qmakeFlags = [ - "LINUX_DISTRO=NixOS" - "CONFIG+=WITH_I18N" - "LRELEASE=${stdenv.lib.getDev qttools}/bin/lrelease" - ]; - - enableParallelBuilding = true; - - meta = with stdenv.lib; { - description = "A lightweight, portable desktop environment"; - longDescription = '' - The Lumina Desktop Environment is a lightweight system interface - that is designed for use on any Unix-like operating system. It - is based on QT5. - ''; - homepage = https://lumina-desktop.org; - license = licenses.bsd3; - platforms = platforms.unix; - maintainers = [ maintainers.romildo ]; - }; -} +in pkgs.lib.makeScope libsForQt5.newScope packages diff --git a/pkgs/desktops/lumina/lumina-calculator/default.nix b/pkgs/desktops/lumina/lumina-calculator/default.nix new file mode 100644 index 000000000000..70e0f2e3511c --- /dev/null +++ b/pkgs/desktops/lumina/lumina-calculator/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub, qmake, qtbase, qttools }: + +stdenv.mkDerivation rec { + pname = "lumina-calculator"; + version = "2019-04-27"; + + src = fetchFromGitHub { + owner = "lumina-desktop"; + repo = pname; + rev = "ccb792fc713aa7163fffd37fc20c83ffe9ca7523"; + sha256 = "0cdyz94znycsc3qxg5bmg51bwms7586d4ja1bsmj8cb9pd3lv980"; + }; + + sourceRoot = "source/src-qt5"; + + nativeBuildInputs = [ qmake qttools ]; + + buildInputs = [ qtbase ]; + + qmakeFlags = [ + "CONFIG+=WITH_I18N" + "LRELEASE=${stdenv.lib.getDev qttools}/bin/lrelease" + ]; + + meta = with stdenv.lib; { + description = "Scientific calculator for the Lumina Desktop"; + homepage = https://github.com/lumina-desktop/lumina-calculator; + license = licenses.bsd3; + platforms = platforms.unix; + maintainers = [ maintainers.romildo ]; + }; +} diff --git a/pkgs/desktops/lumina/lumina-pdf/default.nix b/pkgs/desktops/lumina/lumina-pdf/default.nix new file mode 100644 index 000000000000..62d59d18cc55 --- /dev/null +++ b/pkgs/desktops/lumina/lumina-pdf/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchFromGitHub, qmake, qtbase, qttools, poppler }: + +stdenv.mkDerivation rec { + pname = "lumina-pdf"; + version = "2019-04-27"; + + src = fetchFromGitHub { + owner = "lumina-desktop"; + repo = pname; + rev = "645ed591ef91c3607d3ab87dd86f7acfd08b05c9"; + sha256 = "0gl943jb9c9rcgb5wksx3946hwlifghfd27r97skm9is8ih6k0vn"; + }; + + sourceRoot = "source/src-qt5"; + + nativeBuildInputs = [ qmake qttools ]; + + buildInputs = [ qtbase poppler ]; + + postPatch = '' + sed -i '1i\#include \' Renderer-poppler.cpp + ''; + + qmakeFlags = [ + "CONFIG+=WITH_I18N" + "LRELEASE=${stdenv.lib.getDev qttools}/bin/lrelease" + ]; + + enableParallelBuilding = false; + + meta = with stdenv.lib; { + description = "PDF viewer for the Lumina Desktop"; + homepage = https://github.com/lumina-desktop/lumina-pdf; + license = licenses.bsd3; + platforms = platforms.unix; + maintainers = [ maintainers.romildo ]; + }; +} diff --git a/pkgs/desktops/lumina/LuminaOS-NixOS.cpp.patch b/pkgs/desktops/lumina/lumina/LuminaOS-NixOS.cpp.patch similarity index 100% rename from pkgs/desktops/lumina/LuminaOS-NixOS.cpp.patch rename to pkgs/desktops/lumina/lumina/LuminaOS-NixOS.cpp.patch diff --git a/pkgs/desktops/lumina/avoid-absolute-path-on-sessdir.patch b/pkgs/desktops/lumina/lumina/avoid-absolute-path-on-sessdir.patch similarity index 100% rename from pkgs/desktops/lumina/avoid-absolute-path-on-sessdir.patch rename to pkgs/desktops/lumina/lumina/avoid-absolute-path-on-sessdir.patch diff --git a/pkgs/desktops/lumina/lumina/default.nix b/pkgs/desktops/lumina/lumina/default.nix new file mode 100644 index 000000000000..c758fc38a1b9 --- /dev/null +++ b/pkgs/desktops/lumina/lumina/default.nix @@ -0,0 +1,89 @@ +{ stdenv, + fetchFromGitHub, + desktop-file-utils, + fluxbox, + numlockx, + qmake, + qtbase, + qtmultimedia, + qtsvg, + qttools, + qtx11extras, + xorg, + xscreensaver, + wrapGAppsHook +}: + +stdenv.mkDerivation rec { + pname = "lumina"; + version = "1.5.0"; + + src = fetchFromGitHub { + owner = "lumina-desktop"; + repo = pname; + rev = "v${version}"; + sha256 = "0rj2gzifr98db7i82cg3hg7l5yfik810pjpawg6n54qbzq987z25"; + }; + + nativeBuildInputs = [ + qmake + qttools + wrapGAppsHook + ]; + + buildInputs = [ + xorg.libxcb + xorg.libXcursor + xorg.libXdamage + xorg.xcbutilwm + xorg.xcbutilimage + qtbase + qtsvg + qtmultimedia + qtx11extras + fluxbox + xscreensaver + desktop-file-utils + numlockx + ]; + + patches = [ + ./avoid-absolute-path-on-sessdir.patch + ./LuminaOS-NixOS.cpp.patch + ]; + + prePatch = '' + # Copy Gentoo setup as NixOS setup and then patch it + # TODO: write a complete NixOS setup? + cp -a src-qt5/core/libLumina/LuminaOS-Gentoo.cpp src-qt5/core/libLumina/LuminaOS-NixOS.cpp + ''; + + postPatch = '' + # Fix plugin dir + substituteInPlace src-qt5/core/lumina-theme-engine/lthemeengine.pri \ + --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix" + + # Fix location of fluxbox styles + substituteInPlace src-qt5/core-utils/lumina-config/pages/page_fluxbox_settings.cpp \ + --replace 'LOS::AppPrefix()+"share/fluxbox' "\"${fluxbox}/share/fluxbox" + ''; + + qmakeFlags = [ + "LINUX_DISTRO=NixOS" + "CONFIG+=WITH_I18N" + "LRELEASE=${stdenv.lib.getDev qttools}/bin/lrelease" + ]; + + meta = with stdenv.lib; { + description = "A lightweight, portable desktop environment"; + longDescription = '' + The Lumina Desktop Environment is a lightweight system interface + that is designed for use on any Unix-like operating system. It + is based on QT5. + ''; + homepage = https://lumina-desktop.org; + license = licenses.bsd3; + platforms = platforms.unix; + maintainers = [ maintainers.romildo ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b2a7b0e510f1..7bce1986cd3f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22058,7 +22058,7 @@ in kakasi = callPackage ../tools/text/kakasi { }; - lumina = libsForQt5.callPackage ../desktops/lumina { }; + lumina = recurseIntoAttrs (callPackage ../desktops/lumina { }); lxqt = recurseIntoAttrs (import ../desktops/lxqt { inherit pkgs libsForQt5;