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

mirage: init at 0.5.1 #84150

Merged
merged 2 commits into from Aug 10, 2020
Merged

mirage: init at 0.5.1 #84150

merged 2 commits into from Aug 10, 2020

Conversation

colemickens
Copy link
Member

@colemickens colemickens commented Apr 3, 2020

Motivation for this change

Package new application mirage as attribute mirage-im (there's an existing alias, maybe I could remove it?).

This is a draft since the application doesn't work yet.

This fixes #84147.

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.

Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

This is a draft since the application doesn't work yet.

What happens when you run it from the command line?

@@ -0,0 +1,30 @@
{ mkDerivation, stdenv, lib, fetchFromGitHub, cmake, qtbase, qtquickcontrols2
, qtkeychain, qtmultimedia, qttools, libqmatrixclient_0_5, libQuotient, gnome3
Copy link
Contributor

Choose a reason for hiding this comment

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

libQuotient and libqmatrixclient are not used.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, sorry, left in draft so people wouldn't review too closely. I just copied quaternion so there's lots of left over cruft. I'lll clean it up once it actually does something (anything) on launch.

@cole-h
Copy link
Member

cole-h commented Apr 4, 2020

@GrahamcOfBorg eval

(bot's been having a bad time recently)

@ajs124
Copy link
Member

ajs124 commented Apr 13, 2020

If you just want to try out this app and don't feel like finishing the package, they provide an AppImage, which you can run/package through appimageTools.wrapType2.

@colemickens colemickens force-pushed the nixpkgs-mirage branch 2 times, most recently from e3db78e to e52598b Compare May 19, 2020 21:52
@colemickens
Copy link
Member Author

Well, I'm making some progress at least.
output

@colemickens
Copy link
Member Author

This is working for me now, but it needs cleanup before it's ready for review.

olm pyotherside
];

propagatedBuildInputs = pypkgs;
Copy link
Contributor

Choose a reason for hiding this comment

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

this also causes the python interpreter to be exported, and it's not really needed since you're wrapping the executable anyway.

[nix-shell:/home/jon/.cache/nixpkgs-review/pr-84150-1]$ nix-shell --pure -p "with import ./nixpkgs {}; mirage-im"

[nix-shell:/home/jon/.cache/nixpkgs-review/pr-84150-1]$ python --version
Python 3.8.3

Copy link
Member Author

Choose a reason for hiding this comment

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

If I remove this line, I get these errors and it doesn't load:

~ 19:21:36 | Got library name:  "/nix/store/3z4vm3gsf9zvsj9im9xmx8pmdia8cjqq-pyotherside-1.5.9/lib/qt-5.12.7/qml/io/thp/pyotherside/libpyothersideplugin.so"
~ 19:21:36 | Using Wayland-EGL
~ 19:21:36 | Using the 'xdg-shell' shell integration
~ 19:21:36 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"qrc:/src/backend/qml_bridge.py\", line 26, in <module>\n    from .pyotherside_events import CoroutineDone, LoopException\n\n  File \"qrc:/src/backend/pyotherside_events.py\", line 8, in <module>\n    from .utils import serialize_value_for_qml\n\n  File \"qrc:/src/backend/utils.py\", line 23, in <module>\n    import aiofiles\n\nModuleNotFoundError: No module named 'aiofiles'\n"
! 19:21:36 | Unhandled PyOtherSide error: Cannot import module: backend.qml_bridge (Traceback (most recent call last):

  File "qrc:/src/backend/qml_bridge.py", line 26, in <module>
    from .pyotherside_events import CoroutineDone, LoopException

  File "qrc:/src/backend/pyotherside_events.py", line 8, in <module>
    from .utils import serialize_value_for_qml

  File "qrc:/src/backend/utils.py", line 23, in <module>
    import aiofiles

ModuleNotFoundError: No module named 'aiofiles'
)
~ 19:21:36 | "PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'BRIDGE' is not defined\n"
! 19:21:36 | Unhandled PyOtherSide error: Function not found: 'BRIDGE.call_backend_coro' (Traceback (most recent call last):

  File "<string>", line 1, in <module>

NameError: name 'BRIDGE' is not defined
)

Copy link
Member Author

Choose a reason for hiding this comment

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

going to push these commits up just so you can verify.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea, I was looking into a way around this, the buildPythonPath searches what being propagated to collect the entire python dependency tree. However, this also exports the python interpreter to the user's environment :(

@jonringer
Copy link
Contributor

do you mind squashing/removing some of the fixup commits, particularly:

mirage: feedback
mirage: also remove propagatedBuildInputs
Revert "mirage: also remove propagatedBuildInputs" 

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

I can't think of a way to improve this. I would like to prevent the python interpreter from getting propagated.
cc @FRidh

otherwise, the app seems to work, and the gui launches fine

https://github.com/NixOS/nixpkgs/pull/84150
1 package built:
mirage-im

@symphorien
Copy link
Member

One way to prevent propagation of python is:

diff --git a/pkgs/applications/networking/instant-messengers/mirage/default.nix b/pkgs/applications/networking/instant-messengers/mirage/default.nix
index 1101d6f9b06..8e99ca64123 100644
--- a/pkgs/applications/networking/instant-messengers/mirage/default.nix
+++ b/pkgs/applications/networking/instant-messengers/mirage/default.nix
@@ -44,7 +44,10 @@ mkDerivation rec {
     wrapProgram $out/bin/mirage \
       --prefix PYTHONPATH : "$PYTHONPATH" \
       "''${qtWrapperArgs[@]}"
-    '';
+  '';
+  postFixup = ''
+    rm $out/nix-support -r
+  '';
 
   meta = with lib; {
     description = "A fancy, customizable, keyboard-operable Qt/QML+Python Matrix chat client for encrypted and decentralized communication.";

@jonringer jonringer merged commit 00c0d79 into NixOS:master Aug 10, 2020
@colemickens colemickens deleted the nixpkgs-mirage branch December 30, 2022 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

package request: mirage: new matrix client
7 participants