Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Lomiri DE #108366

Closed
wants to merge 34 commits into from
Closed

[WIP] Lomiri DE #108366

wants to merge 34 commits into from

Conversation

OPNA2608
Copy link
Contributor

@OPNA2608 OPNA2608 commented Jan 4, 2021

Nothing's tested & working yet, just opening a draft so people can chime in, start nitpicking & improving if they want. 🙂

I got ubports/unity8 and its compile-time dependencies to compile but that's about it so far. There are rough edges that need to be fixed down the line:

  • The commit to Qt5 addresses qtPrepareTool qmake function fails to locate perl scripts #76080, as further explained in the commit for ubuntu-ui-toolkit
  • The ubports-specific click package manager lomiri.click is (sadly, unless somehow patched out) needed, currently semi-broken and the derivation in general is very ugly
  • Alot of packages are built on random non-master branches of ubports projects. Sometimes it's xenial, other times bionic, often xenial_-_qt-5.12 or something that should be noted in the derivation to help with coordinating updates later down the road
  • Some packages can prolly be moved out of the lomiri set of packages into all-packages.nix
  • The Qt-"owned" modules from the first commit might be movable into lomiri instead, if that's a better place for them?
  • All the NixOS modules stuff is missing so far so iunno how to test anything of this
  • I already noticed that some binaries try to load completely wrong paths (${unity8}/bin/indicator-client looks for file:///build/source/qml/Panel/Indicators/client/IndicatorsClient.qml)
Motivation for this change

#99090

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

* includedir has a doubled prefix (once inserted at buildtime, second
  time by substituting prefix to dev output at fixup time), deleting
  first one
* Requires specifies the private derivation within egl-wayland (`let`'d
  eglexternalplatform), marked Requires.private instead
Required for upcoming system-settings
The earlier changes in Qt5 need fixing (mir -> mir_1, moving under
lomiri package set instead?)
Binaries broken, but libs required for another derivation

propagatedBuildInputs = [ click-c ] ++ (with python3.pkgs; [ chardet pygobject3 ]);

configurePhase = ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not overwrite configurePhase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not? The default configurePhase does nothing here and I haven't been successful with getting the configure script to run successfully under buildPythonApplication yet. It works in the click-c derivation and generates files that are needed for the python part to work (like the setup.py file). The copying around is essentially replacing ./configure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hooks and setup scripts might expect the phase to exist and do something. Generally use pre and post and as a last resort overwrite something with adding runHook preConfigure and runHook postConfigure.

pkgs/desktops/lomiri/dbus-test-runner/default.nix Outdated Show resolved Hide resolved
pkgs/development/libraries/accountsservice/0.6.42.nix Outdated Show resolved Hide resolved
pkgs/development/libraries/accountsservice/0.6.42.nix Outdated Show resolved Hide resolved
@OPNA2608 OPNA2608 mentioned this pull request Jan 21, 2021
@OPNA2608
Copy link
Contributor Author

@ttuegel Sorry for the ping but I could need some help from a Qt maintainer.

b3ee755 has a change to a qtbase patch. It's been awhile so I'll have to read that code again & test things but I think the diff to that patch may boil down to ~ this after some cleanup:

   defineTest(qtPrepareTool) {
       cmd = $$eval(QT_TOOL.$${2}.binary)
       isEmpty(cmd) {
  -        cmd = $$[QT_HOST_BINS]/$$2
- +        cmd = $$system("command -v $$2")
+ +        cmd = $$system("command -v $${2}.pl")
-          exists($${cmd}.pl) {
-              $${1}_EXE = $${cmd}.pl
-              cmd = perl -w $$system_path($${cmd}.pl)
+ -        exists($${cmd}.pl) {
+ -            $${1}_EXE = $${cmd}.pl
+ -            cmd = perl -w $$system_path($${cmd}.pl)
+ +        exists($${cmd}) {
+ +            $${1}_EXE = $${cmd}
+ +            cmd = perl -w $$system_path($${cmd})

The original patch ignores that $$2 is only an incomplete program name because the .pl extension of the tool will be missing from the function call, so e.g. command -v syncqt would never find Qt's syncqt.pl script. I'd prefer to move this fix + iirc fixShebanging Qt's Perl scripts into a separate PR due to the amount of rebuilding it'll causes.

pkgs/development/libraries/qt-5/README.md has instructions for Qt patches but they seem outdated, with your linked qt forks only going up to 5.9. Is there a different/updated workflow for this and the documentation is just lacking behind? If the patches are still being generated from a fork somewhere then I'm afraid that a major version bump to Qt may reintroduce the wrong patch if i just overwrite pkgs/development/libraries/qt-5/5.1{2,4,5}/qtbase.patch.d/0003-qtbase-mkspecs.patch.

@@ -12465,6 +12467,7 @@ in

abseil-cpp = callPackage ../development/libraries/abseil-cpp { };

accountsservice_0642 = callPackage ../development/libraries/accountsservice/0.6.42.nix { };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
accountsservice_0642 = callPackage ../development/libraries/accountsservice/0.6.42.nix { };
accountsservice_0_6 = callPackage ../development/libraries/accountsservice/0.6.nix { };

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current version in Nixpkgs is 0.6.55, naming it 0.6.nix would suggest that 0.6.42 needs to be updated still.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know that. accountsservice_0_6_42 is probably still a bit more clear.

--replace "prefix}/$out" 'prefix}'
'';

meta = with stdenv.lib; {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
meta = with stdenv.lib; {
meta = with lib; {

@@ -0,0 +1,42 @@
{ stdenv, fetchFromGitHub
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ stdenv, fetchFromGitHub
{ lib, stdenv, fetchFromGitHub

pname = "properties-cpp";
version = "0.0.1";
pname = "properties-cpp-unstable";
version = "2014-07-30";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version = "2014-07-30";
version = "unstable-2014-07-30";


outputs = [ "out" "dev" "doc" ];

meta = with stdenv.lib; {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
meta = with stdenv.lib; {
meta = with lib; {

}:

let
version = "2020-05-17";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version = "2020-05-17";
version = "unstable-2020-05-17";

sha256 = "0kgrskami9rjk0qkrnzm3kd209nxzf5hmw3cdqkhp5rfd548csry";
};
click-c = stdenv.mkDerivation {
pname = "click-c-unstable";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pname = "click-c-unstable";
pname = "click-c";

"''${gappsWrapperArgs[@]}"
)
'';
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing meta.


nativeBuildInputs = [ cmake pkg-config ];

buildInputs = [ wayland boost egl-wayland wlcs libglvnd glm protobuf capnproto glog lttng-ust udev glib libxcb libX11 libXau libXcursor libXdmcp libXrender libdrm mesa epoxy nettle libxkbcommon libinput libxmlxx libuuid freetype libyamlcpp py libevdev umockdev gtest libsystemtap ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
buildInputs = [ wayland boost egl-wayland wlcs libglvnd glm protobuf capnproto glog lttng-ust udev glib libxcb libX11 libXau libXcursor libXdmcp libXrender libdrm mesa epoxy nettle libxkbcommon libinput libxmlxx libuuid freetype libyamlcpp py libevdev umockdev gtest libsystemtap ];
buildInputs = [ wayland boost egl-wayland wlcs libglvnd glm protobuf capnproto glog lttng-ust udev
glib libxcb libX11 libXau libXcursor libXdmcp libXrender libdrm mesa epoxy nettle libxkbcommon
libinput libxmlxx libuuid freetype libyamlcpp py libevdev umockdev gtest libsystemtap ];

Comment on lines +3 to +7
, wayland, boost, egl-wayland, wlcs, libglvnd, glm, protobuf, capnproto, glog, lttng-ust, udev, glib, libxcb, libX11, libXau, libXcursor, libXdmcp, libXrender, libdrm, mesa, epoxy, nettle, libxkbcommon, libinput, libxmlxx, libuuid, freetype, libyamlcpp, python3, libevdev, umockdev, gtest, libsystemtap

, version
, sha256
}:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
, wayland, boost, egl-wayland, wlcs, libglvnd, glm, protobuf, capnproto, glog, lttng-ust, udev, glib, libxcb, libX11, libXau, libXcursor, libXdmcp, libXrender, libdrm, mesa, epoxy, nettle, libxkbcommon, libinput, libxmlxx, libuuid, freetype, libyamlcpp, python3, libevdev, umockdev, gtest, libsystemtap
, version
, sha256
}:
, wayland, boost, egl-wayland, wlcs, libglvnd, glm, protobuf, capnproto, glog, lttng-ust, udev, glib
, libxcb, libX11, libXau, libXcursor, libXdmcp, libXrender, libdrm, mesa, epoxy, nettle, libxkbcommon
, libinput, libxmlxx, libuuid, freetype, libyamlcpp, python3, libevdev, umockdev, gtest, libsystemtap
, version, sha256
}:

@stale
Copy link

stale bot commented Oct 12, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 12, 2021
@onny
Copy link
Contributor

onny commented Jun 9, 2022

This PR is very impressive :) I really would like to see get Lomiri working on NixOS. Have you already packaged the UBports apps? https://gitlab.com/ubports/apps

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 9, 2022
@OPNA2608
Copy link
Contributor Author

I'm still very interested in having Lomiri on NixOS as well :).

I haven't packaged anything else that's related to ubports, just what's here in this PR. I also never got the actually hard part of this all figured out: How to get it to run & be configurable via options.

Regarding Lomiri, I haven't had much time to look at this stuff over the past year but it sounds like upstream may've been working on refactoring some stuff?

https://gitlab.com/ubports/development/core/lomiri

This repository contains the new version of Lomiri which powers Ubuntu Touch based on Ubuntu 20.04 and serves as the upstream for packaging Lomiri outside of Ubuntu Touch.

@onny onny mentioned this pull request Dec 21, 2022
13 tasks
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 8, 2023
@OPNA2608
Copy link
Contributor Author

Closing this:

  • has merge conflicts
  • this wasn't enough to get Lomiri usable
  • I've since restarted this effort in another branch with more success: OPNA2608/nixpkgs:init/lomiri-junk

@OPNA2608 OPNA2608 closed this Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: qt/kde
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants