Package Request: Moment Matrix Client

I tried following the instructions at Moment’s GitHub
I tried to build it myself but I keep running into issues. Anyone able to actually package this for NixOS? I found it because it is a fork of the Mirage Matrix Client

dgraham@Mulder  ~/moment   main ±  make
g++ -Wl,-O1 -Wl,-rpath,/nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib -Wl,-rpath-link,/nix/store/78vi8a5r5k9l04z2904ypb0fw74ji66j-qtdeclarative-6.6.1/lib -Wl,-rpath-link,/nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib -o moment  build/obj/main.o build/obj/hsluv.o build/obj/qrc_resources.o build/obj/moc_clipboard.o build/obj/moc_utils.o   /nix/store/78vi8a5r5k9l04z2904ypb0fw74ji66j-qtdeclarative-6.6.1/lib/libQt6QuickControls2.so -lQt6Quick /nix/store/78vi8a5r5k9l04z2904ypb0fw74ji66j-qtdeclarative-6.6.1/lib/libQt6Quick.so -lQt6QmlModels -lQt6OpenGL /nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib/libQt6OpenGL.so /nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib/libQt6Widgets.so -lQt6Gui /nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib/libQt6Gui.so /nix/store/78vi8a5r5k9l04z2904ypb0fw74ji66j-qtdeclarative-6.6.1/lib/libQt6QmlModels.so -lQt6Qml /nix/store/78vi8a5r5k9l04z2904ypb0fw74ji66j-qtdeclarative-6.6.1/lib/libQt6Qml.so -lQt6Network /nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib/libQt6Network.so -lQt6Core /nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib/libQt6Core.so -lpthread -lGLX -lOpenGL   
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6Quick: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6QmlModels: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6OpenGL: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6Gui: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6Qml: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6Network: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6Core: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lGLX: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lOpenGL: No such file or directory

Any help is appreciated :slight_smile:

In general when dealing with Linux CLIs, options come before positional arguments (in this case, filenames). So in your command, -lQt6Quick etc are treated as input paths. You should move them before the filenames, and all should be well.

(And yes, some of the Nix tools are cursed with putting flags after positional arguments. This seems to be a recent trend.)

So I edited the Makefile and added a space but here is the output of make:

 ✘ dgraham@Mulder  ~/moment   main ±  clear
 dgraham@Mulder  ~/moment   main ±  make         
g++ -Wl,-O1 -Wl,-rpath,/nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib -Wl,-rpath-link,/nix/store/78vi8a5r5k9l04z2904ypb0fw74ji66j-qtdeclarative-6.6.1/lib -Wl,-rpath-link,/nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib -o moment  build/obj/main.o build/obj/hsluv.o build/obj/qrc_resources.o build/obj/moc_clipboard.o build/obj/moc_utils.o   /nix/store/78vi8a5r5k9l04z2904ypb0fw74ji66j-qtdeclarative-6.6.1/lib/libQt6QuickControls2.so -l Qt6Quick /nix/store/78vi8a5r5k9l04z2904ypb0fw74ji66j-qtdeclarative-6.6.1/lib/libQt6Quick.so -l Qt6QmlModels -l Qt6OpenGL /nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib/libQt6OpenGL.so /nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib/libQt6Widgets.so -l Qt6Gui /nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib/libQt6Gui.so /nix/store/78vi8a5r5k9l04z2904ypb0fw74ji66j-qtdeclarative-6.6.1/lib/libQt6QmlModels.so -l Qt6Qml /nix/store/78vi8a5r5k9l04z2904ypb0fw74ji66j-qtdeclarative-6.6.1/lib/libQt6Qml.so -l Qt6Network /nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib/libQt6Network.so -l Qt6Core /nix/store/jxrymq8x8jxzcqmdi40j8rb5c9bim8xz-qtbase-6.6.1/lib/libQt6Core.so -lpthread -lGLX -lOpenGL   
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6Quick: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6QmlModels: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6OpenGL: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6Gui: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6Qml: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6Network: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lQt6Core: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lGLX: No such file or directory
/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin/ld: cannot find -lOpenGL: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:386: moment] Error 1

Mirage is already packaged so you can get pretty far by just swapping out the source:

moment = mirage-im.overrideAttrs (mirage: rec {
  pname = "moment";
  version = "0.7.3";

  src = fetchFromGitLab {
    owner = "mx-moment";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-mvmCu1qL7wD+0kYJ0LdLrAEnVXVdsnUEQSMGntAfpFU=";
    fetchSubmodules = true;
  };

  postInstall = replaceStrings [ mirage.pname ] [ pname ] mirage.postInstall;
});

Mirage has gone stale, someone forked it and took it over. I got a flatpak so I think I am good :slight_smile: