Sample Header Ad - 728x90

auto-patchelf could not satisfy dependency libQt5SerialPort.so.5

2 votes
0 answers
297 views
I am trying to run Qt Design Studio 2.3.1 Community on NixOS. **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
  '';

}
However while building it, 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.
...
is there anyway to resolve it? I tried [this answer](https://discourse.nixos.org/t/qt-development-environment-on-a-flake-system/23707/3) from NixOS discourse but it is for Qt5, not for Qt6. Would be great if you could help me as I am totally stuck on it.
Asked by satk0 (161 rep)
Aug 25, 2023, 12:30 PM