Error finding qtSerialPort in Qt6 derivation

For a past few days I am still trying to run Qt Design Studio 2.3.1 Community.

However while building it from a derivation, I get the following error:

...
 > auto-patchelf: 1 dependencies could not be satisfied
       > error: auto-patchelf could not satisfy dependency libQt5SerialPort.so.5 wanted by /nix/store/bih1ngcz4h0w01i875iys83lcfjksp2m-qtdesignstudio-v2.3.1/qt5_design_studio_reduced_version/plugins/position/libqtposition_serialnmea.so
       > auto-patchelf failed to find all the required dependencies.
...

saying that it miss libQt5SerialPort.so.5 dependency.

However I have added the qtserialport to the dependencies as was suggested.

I didn’t used a prefixed qt5 version to omit dependency errors.

My nix derivation code:

flake.nix:

{
  description = "Qt Design Studio";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system: 
    let
      pname = "qtdesignstudio";
      version = "v2.3.1";

      pkgs = import nixpkgs { inherit system; config.pulseaudio=true;};

    in { 
        packages.default = pkgs.qt6Packages.callPackage ./. {inherit pname version; };
    }
  );
}

default.nix:

{ pname, version, stdenv, pkgs, qtbase, wrapQtAppsHook, qt5compat, qtpositioning, qtserialport }: 

let
   zip_name = "qtdesignstudio-2.3.1.zip";
in
stdenv.mkDerivation {
  
  inherit pname version; 

  src = ./.;

  buildInputs = with pkgs; [

    gcc-unwrapped
    cairo
    pango
    gtk3
    atk
    gdk-pixbuf
    pulseaudio
    alsa-lib

    gst_all_1.gstreamer
    gst_all_1.gst-plugins-base
    gst_all_1.gst-plugins-bad

    xorg.libxkbfile
    xorg.libxshmfence

    nss_latest
    mysql80

  ] ++ [ 

    qt5compat
    qtbase
    qtpositioning
    qtserialport 

  ];

  unpackPhase = "true";

  nativeBuildInputs = with pkgs; [ 
    autoPatchelfHook 
    unzip
  ] ++ 
  [ wrapQtAppsHook ]; 

  installPhase = ''
    mkdir -p $out
    unzip $src/${zip_name} -d $out
  '';

}

To reproduce this problem I also leave you a link to my github repo: GitHub - satk0/qtdesignstudio.nix: My poor try to run Qt Design Studio on NixOS

Would be great if you check it out !

Is there anyway to solve it? Any other qt dependency I added worked well except for this one.

1 Like