Attempting to build Qt6

I’ve had nothing but issues trying to build Qt 6 with Nix.

Currently, CMake will detect some of the libraries I denoted in my derivation, but many won’t be picked up. I’m using Qt for X11 Requirements | Qt 6.2 and trial and error with the CMake test output to determine which libraries should be included.

This is what my derivation looks like:

let
  unstable = import (fetchTarball https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz) {};
in
{
  pkgs ? import <nixpkgs> {}, 
  stdenv ? pkgs.llvmPackages_11.stdenv
}:

stdenv.mkDerivation rec {
  name = "qt6";
  version = "6.0.0";

  src = ~/dev/projects/myapp/qt-everywhere-src-6.0.0.tar.xz;

  nativeBuildInputs = with pkgs; [
    breakpointHook
    unstable.cmake
    ninja
    gdb
    python3
    perl
    coreutils
    bison
    flex
    gdb
    gperf
    pkgconf
  ];

  # propogatedbuildInputs = with pkgs; [ xorg.lndir ];

  buildInputs = with pkgs; [
    font-libs
    xorg-libs
    graphics-libs
    qdoc-libs
    misc-libs
  ];

  configurePhase = ''
    mkdir build
    cd build
    ../configure -prefix $out/bin -bundled-xcb-xinput
  '';

# https://doc.qt.io/qt-6/linux-requirements.html

  font-libs = with pkgs; [
    fontconfig
    freetype
  ];

  xorg-libs = with pkgs; [
    xorg.libXrender
    xorg.libxcb
    xorg.libXcomposite
    xorg.libXcursor
    xorg.libXext
    xorg.libXfixes
    xorg.libXi
    xorg.libXext
    xorg.libX11
    xorg.libXrandr
    xorg.libSM
    xorg.libICE
    xorg.libXinerama
    xorg.xcbproto
    xorg.xcbutil
    xorg.xcbutilwm
    xorg.xcbutilimage
    xorg.xcbutilerrors
    xorg.xcbutilkeysyms
    xorg.xkbutils
    xorg.xorgcffiles
    xcb-util-cursor
    libxkbcommon
  ];

  graphics-libs = with pkgs; [
    libGL
    egl-wayland
    mesa
    vulkan-headers vulkan-loader vulkan-tools
  ];

  accessibility-libs = with pkgs; [
    dbus
    libdbusmenu
    at-spi2-atk
    at-spi2-core
  ];

  qdoc-libs = with pkgs; [
    # clang_11
  ];

  misc-libs = with pkgs; [
    htslib
    mtdev
    lttng-ust
    pkg-config
    journaldriver
    libb2
    libproxy
    lksctp-tools
    libiconv
    syslogng
    icu double-conversion
    libjpeg_original libpng udev
    pcre2 pcre16
    glib
    glibc
    zstd
    zlib
    eventlog openssl gss
    libinput
    libxml2
    libxslt
    openssl
  ];

  enableParallelBuilding = true;
  NIX_BUILD_CORES = 4;

  shellHook = ''
      echo "nix-shell has been entered with qt6.nix";
  '';
}

The CMake output was very long and I had to eliminate most of it to not exceed the post character limit.

nix-build qt6-v3.nix --show-trace
these derivations will be built:
  /nix/store/k2kqqb5dgwwd2vr3xxb5rgvq7ampvkqk-qt6.drv
building '/nix/store/k2kqqb5dgwwd2vr3xxb5rgvq7ampvkqk-qt6.drv'...
unpacking sources
unpacking source archive /nix/store/mxjnbav9kk9xc1895jzbv4jwvxnnzsrs-qt-everywhere-src-6.0.0.tar.xz
source root is qt-everywhere-src-6.0.0
setting SOURCE_DATE_EPOCH to timestamp 1608160158 of file qt-everywhere-src-6.0.0/qtbase/configure
patching sources
configuring
+ cd qtbase
+ /build/qt-everywhere-src-6.0.0/qtbase/configure -top-level -prefix /nix/store/fq2g2pgjq02lh2ffq7mjc5kcmkbp6qa3-qt6/bin -bundled-xcb-xinput
'/nix/store/gdplisy9i5bl5d81disy3m2gbviq89x0-cmake-3.19.1/bin/cmake' '-DCMAKE_INSTALL_PREFIX=/nix/store/fq2g2pgjq02lh2ffq7mjc5kcmkbp6qa3-qt6/bin' '-DINPUT_bundled_xcb_xinput=yes' '-G' 'Ninja' '/build/qt-everywhere-src-6.0.0'
-- The CXX compiler identification is Clang 11.0.0
-- The C compiler identification is Clang 11.0.0
-- The ASM compiler identification is Clang
-- Found assembler: /nix/store/xs965fixqxdjf6v7njkh58figgxkgj8f-clang-wrapper-11.0.0/bin/clang
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/xs965fixqxdjf6v7njkh58figgxkgj8f-clang-wrapper-11.0.0/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/xs965fixqxdjf6v7njkh58figgxkgj8f-clang-wrapper-11.0.0/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
Check dependencies of 'qtbase'
Check dependencies of 'qt5compat'
Check dependencies of 'qtsvg'
Check dependencies of 'qtdeclarative'
Check dependencies of 'qttools'
Check dependencies of 'qtquickcontrols2'
Check dependencies of 'qtdoc'
Check dependencies of 'qtshadertools'
Check dependencies of 'qtquick3d'
Check dependencies of 'qtquicktimeline'
Check dependencies of 'qttranslations'
Check dependencies of 'qtwayland'
Configuring 'qtbase'
-- Setting build type to 'Release' as none was specified.
-- Extracting architecture info from /build/qt-everywhere-src-6.0.0/build/qtbase/config.tests/arch/architecture_test.
-- Performing Test HAVE_LD_VERSION_SCRIPT
-- Performing Test HAVE_LD_VERSION_SCRIPT - Success
-- CMAKE_VERSION: "3.19.1"
-- CMAKE_HOST_SYSTEM: "Linux-5.8.18"
-- CMAKE_HOST_SYSTEM_NAME: "Linux"
-- CMAKE_HOST_SYSTEM_VERSION: "5.8.18"
-- CMAKE_HOST_SYSTEM_PROCESSOR: "x86_64"
-- CMAKE_SYSTEM: "Linux"
-- CMAKE_SYSTEM_NAME: "Linux"
-- CMAKE_SYSTEM_VERSION: "5.8.18"
-- CMAKE_SYSTEM_PROCESSOR: "x86_64"
-- CMAKE_CROSSCOMPILING: "FALSE"
-- CMAKE_C_COMPILER: "/nix/store/xs965fixqxdjf6v7njkh58figgxkgj8f-clang-wrapper-11.0.0/bin/clang" (11.0.0)
-- CMAKE_CXX_COMPILER: "/nix/store/xs965fixqxdjf6v7njkh58figgxkgj8f-clang-wrapper-11.0.0/bin/clang++" (11.0.0)
-- Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR) (Required is at least version "1.0.8")
-- Could NOT find ZSTD: Found unsuitable version "", but required is at least "1.3" (found ZSTD_LIBRARY-NOTFOUND)
-- Could NOT find WrapDBus1 (missing: DBus1_LIBRARY DBus1_INCLUDE_DIR WrapDBus1_FOUND) (Required is at least version "1.2")
-- Checking for module 'libudev'
--   Package 'libudev', required by 'virtual:world', not found
-- Performing Test machine tuple
-- Performing Test machine tuple - Success
-- Performing Test HAVE_cxx14
-- Performing Test HAVE_cxx14 - Success
-- Performing Test HAVE_cxx17
-- Performing Test HAVE_cxx17 - Success
-- Performing Test HAVE_cxx2a
-- Performing Test HAVE_cxx2a - Success
-- Performing Test HAVE_precompile_header
-- Performing Test HAVE_precompile_header - Failed
-- Performing Test TEST_use_bfd_linker
-- Performing Test TEST_use_bfd_linker - Success
-- Performing Test TEST_use_gold_linker
-- Performing Test TEST_use_gold_linker - Success
-- Performing Test TEST_use_lld_linker
-- Performing Test TEST_use_lld_linker - Success
-- Performing Test TEST_optimize_debug
-- Performing Test TEST_optimize_debug - Success
-- Performing Test TEST_enable_new_dtags
-- Performing Test TEST_enable_new_dtags - Success
-- Performing Test TEST_gdb_index
-- Performing Test TEST_gdb_index - Failed
-- Performing SIMD Test AVX512 IFMA instructions
-- Performing SIMD Test AVX512 IFMA instructions - Success
-- Performing SIMD Test AVX512 VBMI instructions
-- Performing SIMD Test AVX512 VBMI instructions - Success
-- Performing Test HAVE_posix_fallocate
-- Performing Test HAVE_posix_fallocate - Success
-- Performing Test HAVE_alloca_stdlib_h
-- Performing Test HAVE_alloca_stdlib_h - Success
-- Performing Test HAVE_alloca_h
-- Performing Test HAVE_alloca_h - Success
-- Performing Test HAVE_alloca_malloc_h
-- Performing Test HAVE_alloca_malloc_h - Failed
-- Performing Test HAVE_stack_protector
-- Performing Test HAVE_stack_protector - Success
-- Performing Test HAVE_intelcet
-- Performing Test HAVE_intelcet - Failed
-- Could NOT find GLIB2 (missing: GLIB2_LIBRARIES GTHREAD2_LIBRARIES GLIB2_INCLUDE_DIRS)
-- Found the following ICU libraries:
--   i18n (required)
--   uc (required)
--   data (required)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR)
-- Checking for module 'libsystemd'
--   Package 'libsystemd', required by 'virtual:world', not found
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Checking for module 'libb2'
--   Found libb2, version 0.98.1
-- Performing Test HAVE_GETTIME
-- Performing Test HAVE_GETTIME - Success
-- Found WrapRt: TRUE
-- Found LTTngUST: /nix/store/xag0lph24s4n3g121ca5vk22sx1j1iyl-lttng-ust-2.10.5/lib/liblttng-ust.so;dl (found version "2.0.5")
-- Could NOT find WrapSystemPCRE2 (missing: PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS __pcre2_found) (Required is at least version "10.20")
-- Could NOT find Slog2 (missing: Slog2_INCLUDE_DIR Slog2_LIBRARY)
-- Performing Test HAVE_atomicfptr
-- Performing Test HAVE_atomicfptr - Success
-- Performing Test HAVE_clock_monotonic
-- Performing Test HAVE_clock_monotonic - Success
-- Performing Test HAVE_cloexec
-- Performing Test HAVE_cloexec - Success
-- Performing Test HAVE_cxx11_future
-- Performing Test HAVE_cxx11_future - Success
-- Performing Test HAVE_cxx11_random
-- Performing Test HAVE_cxx11_random - Success
-- Performing Test HAVE_cxx17_filesystem
-- Performing Test HAVE_cxx17_filesystem - Success
-- Performing Test HAVE_pollts
-- Performing Test HAVE_pollts - Failed
-- Performing Test HAVE_poll
-- Performing Test HAVE_poll - Success
-- Performing Test HAVE_renameat2
-- Performing Test HAVE_renameat2 - Success
-- Performing Test HAVE_statx
-- Performing Test HAVE_statx - Success
-- Performing Test HAVE_syslog
-- Performing Test HAVE_syslog - Success
-- Performing Test HAVE_xlocalescanprint
-- Performing Test HAVE_xlocalescanprint - Failed
-- Checking for module 'libproxy-1.0'
--   Package 'libproxy-1.0', required by 'virtual:world', not found
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
-- Could NOT find WrapOpenSSLHeaders (missing: WrapOpenSSLHeaders_FOUND)
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
-- Could NOT find WrapOpenSSLHeaders (missing: WrapOpenSSLHeaders_FOUND)
-- Could NOT find WrapOpenSSL (missing: WrapOpenSSL_FOUND)
-- Could NOT find GSSAPI (missing: GSSAPI_LIBRARIES GSSAPI_INCLUDE_DIRS)
-- Performing Test HAVE_getifaddrs
-- Performing Test HAVE_getifaddrs - Success
-- Performing Test HAVE_ipv6ifname
-- Performing Test HAVE_ipv6ifname - Success
-- Performing Test HAVE_linux_netlink
-- Performing Test HAVE_linux_netlink - Success
-- Performing Test HAVE_sctp
-- Performing Test HAVE_sctp - Success
-- Performing Test HAVE_netlistmgr
-- Performing Test HAVE_netlistmgr - Failed
-- Checking for module 'atspi-2'
--   Package 'atspi-2', required by 'virtual:world', not found
-- Checking for module 'directfb'
--   Package 'directfb', required by 'virtual:world', not found
-- Could NOT find Libdrm (missing: Libdrm_LIBRARY Libdrm_INCLUDE_DIR)
-- Performing Test HAVE_EGL
-- Performing Test HAVE_EGL - Failed
-- Could NOT find EGL (missing: EGL_INCLUDE_DIR HAVE_EGL)
-- Could NOT find WrapSystemFreetype (missing: __freetype_found) (Required is at least version "2.2.0")
-- Could NOT find Fontconfig (missing: Fontconfig_LIBRARY Fontconfig_INCLUDE_DIR)
-- Could NOT find gbm (missing: gbm_INCLUDE_DIR)
-- Checking for module 'harfbuzz'
--   Package 'harfbuzz', required by 'virtual:world', not found
-- Could NOT find WrapSystemHarfbuzz (missing: HARFBUZZ_LIBRARIES HARFBUZZ_INCLUDE_DIRS) (Required is at least version "2.6.0")
-- Could NOT find Libinput (missing: Libinput_LIBRARY Libinput_INCLUDE_DIR)
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Could NOT find WrapSystemPNG (missing: __png_found)
-- Checking for module 'mtdev'
--   Found mtdev, version 1.1.6
-- Could NOT find OpenGL (missing: OPENGL_INCLUDE_DIR)
-- Could NOT find WrapOpenGL (missing: WrapOpenGL_FOUND)
-- Could NOT find EGL (missing: EGL_INCLUDE_DIR HAVE_EGL)
-- Performing Test HAVE_GLESv2
-- Performing Test HAVE_GLESv2 - Failed
-- Could NOT find GLESv2 (missing: GLESv2_INCLUDE_DIR HAVE_GLESv2 HAVE_GLESv2)
-- Checking for module 'tslib'
--   Package 'tslib', required by 'virtual:world', not found
-- Found Vulkan: /nix/store/gagdd2y8r1fmr8dp9nnwmfblplibxyp0-vulkan-loader-1.2.131.2/lib/libvulkan.so
-- Could NOT find Wayland_Client (missing: Wayland_Client_LIBRARY Wayland_Client_INCLUDE_DIR) (found version "")
-- Could NOT find Wayland_Server (missing: Wayland_Server_LIBRARY Wayland_Server_INCLUDE_DIR) (found version "")
-- Could NOT find Wayland_Cursor (missing: Wayland_Cursor_LIBRARY Wayland_Cursor_INCLUDE_DIR) (found version "")
-- Could NOT find Wayland_Egl (missing: Wayland_Egl_LIBRARY Wayland_Egl_INCLUDE_DIR Wayland_Client_FOUND) (found version "")
-- Could NOT find Wayland (missing: Wayland_LIBRARIES)
-- Could NOT find X11 (missing: X11_X11_INCLUDE_PATH)
-- Could NOT find X11 (missing: X11_X11_INCLUDE_PATH)
Package pthread-stubs was not found in the pkg-config search path.
Perhaps you should add the directory containing `pthread-stubs.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pthread-stubs', required by 'xcb', not found
Package 'xau', required by 'xcb', not found
Package 'xdmcp', required by 'xcb', not found

.... (more repeated output) .... 

-- Found XCB_XVMC: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xvmc.so (found version "1.13.1")
-- Found XCB: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-render.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-
-- XCB: ICCCM requires XCB
-- Could NOT find XCB_ICCCM (missing: XCB_ICCCM_INCLUDE_DIR) (found version "")
-- Could NOT find XCB (missing: ICCCM) (found suitable version "1.13.1", minimum required is "0.3.9")
-- XCB: UTIL requires XCB
-- Could NOT find XCB_UTIL (missing: XCB_UTIL_INCLUDE_DIR) (found version "")
-- Could NOT find XCB (missing: UTIL) (found suitable version "1.13.1", minimum required is "0.3.9")
-- XCB: IMAGE requires XCB;SHM
-- XCB: IMAGE requires XCB;SHM
-- Could NOT find XCB_IMAGE (missing: XCB_IMAGE_INCLUDE_DIR) (found version "")
-- Could NOT find XCB (missing: IMAGE) (found suitable version "1.13.1", minimum required is "0.3.9")
-- XCB: KEYSYMS requires XCB
-- Could NOT find XCB_KEYSYMS (missing: XCB_KEYSYMS_INCLUDE_DIR) (found version "")
-- Could NOT find XCB (missing: KEYSYMS) (found suitable version "1.13.1", minimum required is "0.3.9")
-- XCB: RENDERUTIL requires XCB;RENDER
-- XCB: RENDERUTIL requires XCB;RENDER
-- Could NOT find XCB_RENDERUTIL (missing: XCB_RENDERUTIL_LIBRARY XCB_RENDERUTIL_INCLUDE_DIR) (found version "")
-- Could NOT find XCB (missing: RENDERUTIL) (found suitable version "1.13.1", minimum required is "0.3.9")
-- XCB: RANDR requires XCB
-- Found XCB: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-render.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xvmc.so (found version "1.13.1") found components: RANDR
-- XCB: SHAPE requires XCB
-- Found XCB: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-render.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-shape.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xfixes.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-shm.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-composite.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-damage.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-dpms.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-dri2.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-dri3.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-glx.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-present.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-randr.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-record.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-res.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-screensaver.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-sync.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xf86dri.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xinerama.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xkb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xtest.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xv.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xvmc.so (found version "1.13.1") found components: SHAPE
-- XCB: SHM requires XCB
-- Found XCB: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-render.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-shape.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xfixes.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xvmc.so (found version "1.13.1") found components: SHM
-- XCB: SYNC requires XCB
-- Found XCB: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-render.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xvmc.so (found version "1.13.1") found components: SYNC
-- XCB: XFIXES requires XCB;RENDER;SHAPE
-- XCB: XFIXES requires XCB;RENDER;SHAPE
-- XCB: XFIXES requires XCB;RENDER;SHAPE
-- Found XCB: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-render.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-
-- Could NOT find X11_XCB (missing: X11_XCB_INCLUDE_DIR)
-- XCB: XKB requires XCB
-- Found XCB: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-render.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-shape.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xfixes.so;/nix/storeKB
-- XCB: RENDER requires XCB
-- Found XCB: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-render.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-shape.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xfixes.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-shm.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-composite.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-damage.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-dpms.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-RENDER
-- XCB: GLX requires XCB
-- Found XCB: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-render.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-if3psrvynnz-libxcb-1.13.1/lib/libxcb-xtest.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xv.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xvmc.so (found version "1.13.1") found components: GLX
-- XCB: XINPUT requires XCB
CMake Warning (dev) at qtbase/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake:180 (message):
  XINPUT from XCB was requested: this is EXPERIMENTAL and is likely to
  unavailable on many systems!
Call Stack (most recent call first):
  qtbase/cmake/QtFindPackageHelpers.cmake:113 (find_package)
  qtbase/src/gui/configure.cmake:122 (qt_find_package)
  qtbase/cmake/QtFeature.cmake:452 (include)
  qtbase/src/CMakeLists.txt:12 (qt_feature_evaluate_features)
This warning is for project developers.  Use -Wno-dev to suppress it.

Package pthread-stubs was not found in the pkg-config search path.
Perhaps you should add the directory containing `pthread-stubs.pc'
to the PKG_CONFIG_PATH environment variable

-- Found XCB_XINPUT: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xinput.so (found version "1.13.1")
-- Found XCB: /nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-render.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-
-- Checking for module 'xkbcommon-x11>=0.4.1'
--   Package 'xkbcommon-x11', required by 'virtual:world', not found
-- Checking for module 'xrender'
--   Package 'xrender', required by 'virtual:world', not found
-- Performing Test HAVE_evdev
-- Performing Test HAVE_evdev - Success
-- Performing Test HAVE_integrityfb
-- Performing Test HAVE_integrityfb - Failed
-- Performing Test HAVE_linuxfb
-- Performing Test HAVE_linuxfb - Success
-- Performing Test HAVE_directwrite
-- Performing Test HAVE_directwrite - Failed
-- Performing Test HAVE_directwrite3
-- Performing Test HAVE_directwrite3 - Failed
-- Performing Test HAVE_d2d1
-- Performing Test HAVE_d2d1 - Failed
-- Performing Test HAVE_d2d1_1
-- Performing Test HAVE_d2d1_1 - Failed
-- Tool 'Qt6::moc' will be built from source.
-- Tool 'Qt6::rcc' will be built from source.
-- Tool 'Qt6::tracegen' will be built from source.
-- Tool 'Qt6::cmake_automoc_parser' will be built from source.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Using Qt bundled PCRE2.
-- Found WrapPCRE2: TRUE
-- Using source syncqt found at: /build/qt-everywhere-src-6.0.0/qtbase/bin/syncqt.pl
-- Running syncqt for module: 'QtCore'
-- Could NOT find GLIB2 (missing: GLIB2_LIBRARIES GTHREAD2_LIBRARIES GLIB2_INCLUDE_DIRS)
-- Found the following ICU libraries:
--   i18n (required)
--   uc (required)
--   data (required)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR)
-- Checking for module 'libsystemd'
--   Package 'libsystemd', required by 'virtual:world', not found
-- Checking for module 'libb2'
--   Found libb2, version 0.98.1
-- Could NOT find WrapSystemPCRE2 (missing: PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS __pcre2_found) (Required is at least version "10.20")
-- Could NOT find Slog2 (missing: Slog2_INCLUDE_DIR Slog2_LIBRARY)
-- Performing Test HAVE_DASH_UNDEFINED_SYMBOLS
-- Performing Test HAVE_DASH_UNDEFINED_SYMBOLS - Success
-- Performing Test HAVE_DASH_DASH_NO_UNDEFINED
-- Performing Test HAVE_DASH_DASH_NO_UNDEFINED - Success
readelf: Error: '/bin/ls': No such file
CMake Warning at qtbase/src/corelib/CMakeLists.txt:1213 (message):
  xmlstarlet was not found.  freedesktop.org.xml will not be minified!


-- Running syncqt for module: 'QtZlib'
-- Running syncqt for module: 'QtConcurrent'
-- Running syncqt for module: 'QtSql'
QtSql: created deprecated header(s) { qsql.h }
-- Running syncqt for module: 'QtNetwork'
-- Checking for module 'libproxy-1.0'
--   Package 'libproxy-1.0', required by 'virtual:world', not found

....

/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xv.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xvmc.so;/nix/store/4scczpx4ffrj1b299xlfyif3psrvynnz-libxcb-1.13.1/lib/libxcb-xinput.so (found suitable version "1.13.1", minimum required is "1.12") found components: XINPUT
-- Could NOT find XKB (missing: XKB_INCLUDE_DIR) (Required is at least version "0.5.0")
-- Checking for module 'xkbcommon-x11>=0.4.1'
--   Package 'xkbcommon-x11', required by 'virtual:world', not found
-- Checking for module 'xrender'
--   Package 'xrender', required by 'virtual:world', not found
-- Running syncqt for module: 'QtWidgets'
-- Checking for module 'gtk+-3.0 >= 3.6'
--   Package 'gtk+-3.0', required by 'virtual:world', not found
-- Running syncqt for module: 'QtDeviceDiscoverySupport'
-- Running syncqt for module: 'QtFbSupport'
-- Could NOT find Libinput (missing: Libinput_LIBRARY Libinput_INCLUDE_DIR)
-- Could NOT find XKB (missing: XKB_INCLUDE_DIR)
-- Checking for module 'tslib'
--   Package 'tslib', required by 'virtual:world', not found
-- Checking for module 'mtdev'
--   Found mtdev, version 1.1.6
-- Running syncqt for module: 'QtInputSupport'
-- Running syncqt for module: 'QtTest'
QtTest: created deprecated header(s) { qtest_global.h }
-- Running syncqt for module: 'QtPrintSupport'
-- Could NOT find Cups (missing: CUPS_LIBRARIES CUPS_INCLUDE_DIR)
-- Could NOT find DB2 (missing: DB2_INCLUDE_DIRS DB2_LIBRARIES)
-- Could NOT find MySQL (missing: MySQL_LIBRARIES MySQL_INCLUDE_DIRS)
-- Could NOT find PostgreSQL (missing: PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR)
-- Could NOT find Oracle (missing: Oracle_INCLUDE_DIRS Oracle_LIBRARIES)
-- Could NOT find ODBC (missing: ODBC_LIBRARY ODBC_INCLUDE_DIR)
-- Could NOT find SQLite3 (missing: SQLite3_INCLUDE_DIR SQLite3_LIBRARY)
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Tool 'Qt6::qmake' will be built from source.
Configuring 'qt5compat'
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Using source syncqt found at: /build/qt-everywhere-src-6.0.0/qtbase/bin/syncqt.pl
-- Running syncqt for module: 'QtCore5Compat'
-- Found the following ICU libraries:
--   i18n (required)
--   uc (required)
--   data (required)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR)
-- Performing Test HAVE_ICONV
-- Performing Test HAVE_ICONV - Success
Configuring 'qtsvg'
-- Using source syncqt found at: /build/qt-everywhere-src-6.0.0/qtbase/bin/syncqt.pl
-- Running syncqt for module: 'QtSvg'
-- Running syncqt for module: 'QtSvgWidgets'
Configuring 'qtdeclarative'
-- Could NOT find Qt6OpenGL (missing: Qt6OpenGL_DIR)
-- Could NOT find Qt6OpenGLWidgets (missing: Qt6OpenGLWidgets_DIR)
-- Found PythonInterp: /nix/store/0l519s624pxkpjjgw4hf146n4983fwza-python3-3.8.5/bin/python (found version "3.8.5")
-- Tool 'Qt6::qmltyperegistrar' will be built from source.
-- Using source syncqt found at: /build/qt-everywhere-src-6.0.0/qtbase/bin/syncqt.pl
-- Running syncqt for module: 'QtQml'
-- Performing Test HAVE_cxx14_make_unique
-- Performing Test HAVE_cxx14_make_unique - Success
-- Performing Test HAVE_pointer_32bit
-- Performing Test HAVE_pointer_32bit - Failed
-- Performing Test HAVE_pointer_64bit
-- Performing Test HAVE_pointer_64bit - Success
-- Performing Test HAVE_arm_thumb
-- Performing Test HAVE_arm_thumb - Failed
-- Performing Test HAVE_arm_fp
-- Performing Test HAVE_arm_fp - Success
-- Running syncqt for module: 'QtQmlModels'
-- Running syncqt for module: 'QtQmlWorkerScript'
-- Running syncqt for module: 'QtQuick'
-- Running syncqt for module: 'QtQuickShapes'
-- Running syncqt for module: 'QtQuickTest'
-- Running syncqt for module: 'QtQuickWidgets'
-- Running syncqt for module: 'QtPacketProtocol'
-- Running syncqt for module: 'QtQmlCompiler'
-- Tool 'Qt6::qmlcachegen' will be built from source.
-- Running syncqt for module: 'QtQmlDebug'
-- Tool 'Qt6::qmllint' will be built from source.
-- Tool 'Qt6::qmlimportscanner' will be built from source.
-- Tool 'Qt6::qmlformat' will be built from source.
-- Tool 'Qt6::qml' will be built from source.
-- Tool 'Qt6::qmlprofiler' will be built from source.
-- Tool 'Qt6::qmlpreview' will be built from source.
-- Tool 'Qt6::qmlscene' will be built from source.
-- Tool 'Qt6::qmlplugindump' will be built from source.
-- Tool 'Qt6::qmltestrunner' will be built from source.
Configuring 'qttools'
-- Could NOT find Qt6OpenGL (missing: Qt6OpenGL_DIR)
-- Could NOT find Qt6OpenGLWidgets (missing: Qt6OpenGLWidgets_DIR)
CMake Error at /nix/store/3hx1b38i3klav09vrqn45md87dm00a87-clang-11.0.0/lib/cmake/clang/ClangConfig.cmake:10 (find_package):
  Could not find a package configuration file provided by "LLVM" with any of
  the following names:

    LLVMConfig.cmake
    llvm-config.cmake

  Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
  "LLVM_DIR" to a directory containing one of the above files.  If "LLVM"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  qttools/cmake/FindWrapLibClang.cmake:14 (find_package)
  qtbase/cmake/QtFindPackageHelpers.cmake:113 (find_package)
  qttools/configure.cmake:19 (qt_find_package)
  qtbase/cmake/QtFeature.cmake:452 (include)
  qttools/src/CMakeLists.txt:20 (qt_feature_evaluate_features)


-- Configuring incomplete, errors occurred!
See also "/build/qt-everywhere-src-6.0.0/build/CMakeFiles/CMakeOutput.log".
See also "/build/qt-everywhere-src-6.0.0/build/CMakeFiles/CMakeError.log".
CMake Error at /build/qt-everywhere-src-6.0.0/qtbase/cmake/QtProcessConfigureArgs.cmake:788 (message):
  CMake exited with code 1.


build failed in configurePhase with exit code 1
To attach install cntr and run the following command as root:

   cntr attach -t command cntr-/nix/store/fq2g2pgjq02lh2ffq7mjc5kcmkbp6qa3-qt6

The nested configuration shell scripts that Qt uses doesn’t seem to be causing issues - it’s just CMake not acknowledging the required libraries.

3 Likes

Did you try adding llvm to the inputs? Also, you should open an issue requesting qt6 to be packaged on GitHub, ccing qt5’s maintainer.

I’ve added a packaging request.

Where is pkg-config?

This is likely the issue, CMake’s findPkgConfig will need pkg-config to be available to find some of the packages.

These aren’t valid attrs to mkDerivation, dependencies should be filtered into the respective xxxxxBuildInputs

please take a look at NixOS - Nixpkgs 21.05 manual

I have added a 450 USD bounty to the Qt 6 packaging issue, paid in advance.

4 Likes

im currently at 582/1496 of the buildPhase ; )

https://github.com/NixOS/nixpkgs/pull/141883