ci: ammend qt derivation to run on 20.09

This commit is contained in:
Anton Iakimov 2024-01-19 16:23:26 +01:00
parent ce449003cc
commit 8b551e46cf
No known key found for this signature in database
11 changed files with 57 additions and 79 deletions

View File

@ -582,7 +582,7 @@ ifndef IN_NIX_SHELL
rm -rf tmp/linux
mkdir -p tmp/linux/tools
wget -nv https://github.com/AppImage/AppImageKit/releases/download/continuous/$(_APPIMAGE_TOOL)
mv $(_APPIMAGE_TOOL) tmp/linux/tools/appimagetool
mv $(_APPIMAGE_TOOL) $(APPIMAGE_TOOL)
chmod +x $(APPIMAGE_TOOL)
endif

View File

@ -6,20 +6,22 @@
# - https://nixos.org/nixos/nix-pills/callpackage-design-pattern.html
final: prev: let
inherit (prev) callPackage;
inherit (prev) config stdenv callPackage recurseIntoAttrs makeOverridable fetchurl lib writeShellScriptBin __splicedPackages;
in rec {
linuxdeployqt = callPackage ./pkgs/linuxdeployqt/default.nix { };
# Copyied from d9424d2191d6439a276b69ae1fd0a800586135ca
# 2018-07-27 -> 2020-12-31
# TODO: override and upgrade
# Copy is uses because of initial complexity of package override (probably due to fuse override)
appimagekit = callPackage ./pkgs/appimagekit/default.nix { };
# Requirement from Makefile - 3.19
cmake_3_19 = prev.cmake.overrideAttrs ( attrs : rec {
version = "3.19.7";
src = prev.fetchurl {
url = "${attrs.meta.homepage}files/v${prev.lib.versions.majorMinor version}/cmake-${version}.tar.gz";
src = fetchurl {
url = "${attrs.meta.homepage}files/v${lib.versions.majorMinor version}/cmake-${version}.tar.gz";
# compare with https://cmake.org/files/v${lib.versions.majorMinor version}/cmake-${version}-SHA-256.txt
sha256 = "sha256-WKFfDVagr8zDzFNxI0/Oc/zGyPnb13XYmOUQuDF1WI4=";
};
@ -28,10 +30,34 @@ in rec {
# Copyied from bootstrap121 from 0e2a36815d2310886458ac1aab14350160e6b12a
# autoPatchelfHook is disabled
# TODO: compile, not binary
# Binary is used because of initial complexity of both package override and copy from newer nixpkgs
go_1_20 = callPackage ./pkgs/go/bootstrap120.nix { };
# Fix for linuxdeployqt so it's not upset shell interpreter from host system
lddWrapped = prev.writeShellScriptBin "ldd" ''
# Fix for linuxdeployqt running ldd from nix with system shell
# ERROR: findDependencyInfo: "/bin/sh: /nix/store/HASH-glibc-2.31-74/lib/libc.so.6: version `GLIBC_2.33' not found (required by /bin/sh)\n/bin/sh: /nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/sh)"
# $ head $(which ldd)
# #! /bin/sh
lddWrapped = writeShellScriptBin "ldd" ''
"${final.bash}/bin/sh" "${final.glibc.bin}/bin/ldd" "$@"
'';
# Qt 5.15.8 copy from 76973ae3b30a88ea415f27ff53809ab8f452e2ec
# Edited:
# - temporary break Darwin support
# - remove unsupported testers, env., config.allowAliases
# - mkDerivation without finalAttrs
# - change fetch* parameter from hash to sha256, rmove fetchLFS
# - fix makeSetupHook
# - switch from makeScopeWithSplicing back to makeScope
# See diff for a full list of changes
qt515_8 = recurseIntoAttrs (makeOverridable
(import ./pkgs/qt-5/5.15) {
inherit (__splicedPackages)
newScope generateSplicesForMkScope lib fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper
bison cups dconf harfbuzz libGL perl gtk3 python3
darwin buildPackages;
inherit (__splicedPackages.gst_all_1) gstreamer gst-plugins-base;
inherit config stdenv;
});
alsa-lib = prev.alsaLib;
}

View File

@ -7,7 +7,7 @@ Check for any minor version changes.
*/
{ makeScopeWithSplicing, generateSplicesForMkScope
{ newScope, generateSplicesForMkScope
, lib, stdenv, fetchurl, fetchgit, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper
, bison, cups ? null, harfbuzz, libGL, perl, python3
, gstreamer, gst-plugins-base, gtk3, dconf
@ -57,19 +57,19 @@ let
qtwebengine = [
(fetchpatch {
url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a6f16c6daea3b5a1f7bc9f175d1645922c131563/qt5/qt5-webengine-python3.patch";
hash = "sha256-rUSDwTucXVP3Obdck7LRTeKZ+JYQSNhQ7+W31uHZ9yM=";
sha256 = "sha256-rUSDwTucXVP3Obdck7LRTeKZ+JYQSNhQ7+W31uHZ9yM=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/Homebrew/formula-patches/7ae178a617d1e0eceb742557e63721af949bd28a/qt5/qt5-webengine-chromium-python3.patch";
stripLen = 1;
extraPrefix = "src/3rdparty/";
hash = "sha256-MZGYeMdGzwypfKoSUaa56K3inbcGRx7he/+AFyk5ekA=";
sha256 = "sha256-MZGYeMdGzwypfKoSUaa56K3inbcGRx7he/+AFyk5ekA=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/Homebrew/formula-patches/7ae178a617d1e0eceb742557e63721af949bd28a/qt5/qt5-webengine-gcc12.patch";
stripLen = 1;
extraPrefix = "src/3rdparty/";
hash = "sha256-s4GsGMJTBNWw2gTJuIEP3tqT82AmTsR2mbj59m2p6rM=";
sha256 = "sha256-s4GsGMJTBNWw2gTJuIEP3tqT82AmTsR2mbj59m2p6rM=";
})
] ++ lib.optionals stdenv.isDarwin [
./qtwebengine-darwin-no-platform-check.patch
@ -134,10 +134,6 @@ let
inherit bison cups harfbuzz libGL;
withGtk3 = !stdenv.isDarwin; inherit dconf gtk3;
inherit developerBuild decryptSslTraffic;
inherit (darwin.apple_sdk_11_0.frameworks) AGL AppKit ApplicationServices AVFoundation Carbon Cocoa CoreAudio CoreBluetooth
CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit;
libobjc = darwin.apple_sdk_11_0.objc4;
xcbuild = darwin.apple_sdk_11_0.xcodebuild;
};
qt3d = callPackage ../modules/qt3d.nix {};
@ -212,7 +208,7 @@ let
qmake = makeSetupHook {
name = "qmake-hook";
propagatedBuildInputs = [ self.qtbase.dev ];
deps = [ self.qtbase.dev ];
substitutions = {
inherit debug;
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
@ -221,12 +217,10 @@ let
wrapQtAppsHook = makeSetupHook {
name = "wrap-qt5-apps-hook";
propagatedBuildInputs = [ self.qtbase.dev buildPackages.makeWrapper ]
++ lib.optional stdenv.isLinux self.qtwayland.dev;
deps =
[ self.qtbase.dev buildPackages.makeWrapper ]
++ optional stdenv.isLinux self.qtwayland.dev;
} ../hooks/wrap-qt-apps-hook.sh;
} // lib.optionalAttrs config.allowAliases {
# remove before 23.11
overrideScope' = lib.warn "qt5 now uses makeScopeWithSplicing which does not have \"overrideScope'\", use \"overrideScope\"." self.overrideScope;
};
in makeScopeWithSplicing (generateSplicesForMkScope "qt5") (_: {}) (_: {}) addPackages
self = lib.makeScope newScope addPackages;
in self

View File

@ -13,7 +13,6 @@ let
src = override.src or
fetchgit {
inherit (args) url rev sha256;
fetchLFS = false;
fetchSubmodules = true;
deepClone = false;
leaveDotGit = false;
@ -37,7 +36,7 @@ lib.mapAttrs mk (lib.importJSON ./srcs-generated.json)
catapult = fetchgit {
url = "https://chromium.googlesource.com/catapult";
rev = "5eedfe23148a234211ba477f76fc2ea2e8529189";
hash = "sha256-LPfBCEB5tJOljXpptsNk0sHGtJf/wIRL7fccN79Nh6o=";
sha256 = "sha256-LPfBCEB5tJOljXpptsNk0sHGtJf/wIRL7fccN79Nh6o=";
};
qtwebengine =

View File

@ -5,5 +5,5 @@ qtModule {
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
# error: use of undeclared identifier 'stat64'
env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dstat64=stat";
NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dstat64=stat";
}

View File

@ -3,9 +3,6 @@
, coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3
, which
# darwin support
, libiconv, libobjc, xcbuild, AGL, AppKit, ApplicationServices, AVFoundation, Carbon, Cocoa, CoreAudio, CoreBluetooth
, CoreLocation, CoreServices, DiskArbitration, Foundation, OpenGL, MetalKit, IOKit
, dbus, fontconfig, freetype, glib, harfbuzz, icu, libdrm, libX11, libXcomposite
, libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng , libxcb
@ -27,14 +24,13 @@
, debug ? false
, developerBuild ? false
, decryptSslTraffic ? false
, testers
}:
let
debugSymbols = debug || developerBuild;
in
stdenv.mkDerivation (finalAttrs: {
stdenv.mkDerivation {
pname = "qtbase";
inherit qtCompatVersion src version;
debug = debugSymbols;
@ -50,10 +46,6 @@ stdenv.mkDerivation (finalAttrs: {
pcre2
] ++ (
if stdenv.isDarwin then [
# TODO: move to buildInputs, this should not be propagated.
AGL AppKit ApplicationServices AVFoundation Carbon Cocoa CoreAudio CoreBluetooth
CoreLocation CoreServices DiskArbitration Foundation OpenGL
libobjc libiconv MetalKit IOKit
] else [
dbus glib udev
@ -79,8 +71,7 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional (mysqlSupport) libmysqlclient
++ lib.optional (postgresql != null) postgresql;
nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which ]
++ lib.optionals stdenv.isDarwin [ xcbuild ];
nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which ];
propagatedNativeBuildInputs = [ lndir ];
@ -122,15 +113,6 @@ stdenv.mkDerivation (finalAttrs: {
patchShebangs ./bin
'' + (
if stdenv.isDarwin then ''
sed -i \
-e 's|/usr/bin/xcode-select|xcode-select|' \
-e 's|/usr/bin/xcrun|xcrun|' \
-e 's|/usr/bin/xcodebuild|xcodebuild|' \
-e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
./configure
substituteInPlace ./mkspecs/common/mac.conf \
--replace "/System/Library/Frameworks/OpenGL.framework/" "${OpenGL}/Library/Frameworks/OpenGL.framework/" \
--replace "/System/Library/Frameworks/AGL.framework/" "${AGL}/Library/Frameworks/AGL.framework/"
'' else lib.optionalString libGLSupported ''
sed -i mkspecs/common/linux.conf \
-e "/^QMAKE_INCDIR_OPENGL/ s|$|${libGL.dev or libGL}/include|" \
@ -179,7 +161,7 @@ stdenv.mkDerivation (finalAttrs: {
done
'';
env.NIX_CFLAGS_COMPILE = toString ([
NIX_CFLAGS_COMPILE = toString ([
"-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields
''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"''
''-DLIBRESOLV_SO="${stdenv.cc.libc.out}/lib/libresolv"''
@ -343,8 +325,6 @@ stdenv.mkDerivation (finalAttrs: {
setupHook = ../hooks/qtbase-setup-hook.sh;
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
homepage = "https://www.qt.io/";
description = "A cross-platform application framework for C++";
@ -372,4 +352,4 @@ stdenv.mkDerivation (finalAttrs: {
platforms = platforms.unix;
};
})
}

View File

@ -3,5 +3,5 @@
qtModule {
pname = "qtserialport";
qtInputs = [ qtbase ];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-DNIXPKGS_LIBUDEV=\"${lib.getLib systemd}/lib/libudev\"";
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-DNIXPKGS_LIBUDEV=\"${lib.getLib systemd}/lib/libudev\"";
}

View File

@ -36,7 +36,7 @@ qtModule {
"bin/macdeployqt"
];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
setupHook = ../hooks/qttools-setup-hook.sh;
}

View File

@ -102,7 +102,7 @@ qtModule {
--replace "-Wl,-fatal_warnings" ""
'') + postPatch;
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
# with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
"-Wno-class-memaccess"
] ++ lib.optionals (stdenv.hostPlatform.gcc.arch or "" == "sandybridge") [

View File

@ -35,7 +35,7 @@ qtModule {
"-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF"
];
env.NIX_CFLAGS_COMPILE = toString ([
NIX_CFLAGS_COMPILE = toString ([
# with gcc7 this warning blows the log over Hydra's limit
"-Wno-expansion-to-defined"
]

View File

@ -3,8 +3,8 @@
}:
let
qtCustom = (with pkgs.qt515;
# TODO:check the required modules after Qt upgrade
qtCustom = (with pkgs.qt515_8;
# TODO:check the required modules
env "qt-custom-${qtbase.version}" ([
qtbase
qtdeclarative
@ -18,13 +18,12 @@ let
qtgraphicaleffects
qtwebengine
qtlocation
# qtlottie # TODO: was missing in 5.15.2, review after upgrade
]));
in pkgs.mkShell {
name = "status-desktop-build-shell";
# TODO:check the required packages after Qt upgrade
# TODO:check the required packages
buildInputs = with pkgs; [
bash curl wget git file unzip jq lsb-release which cacert gnupg
linuxdeployqt appimagekit
@ -53,20 +52,8 @@ in pkgs.mkShell {
export PATH="${pkgs.lddWrapped}/bin:$PATH"
'';
# Used to workaround missing lib links in qt-custom
# TODO:check if it's still needed after Qt upgrade
LIBRARY_PATH = with pkgs.qt515; pkgs.lib.makeLibraryPath [
qtdeclarative
qtmultimedia
qtquickcontrols
qtquickcontrols2
qtsvg
qtwebchannel
qtwebview
];
# Used for linuxdeployqt
# TODO:check if qt modules are still needed here after Qt upgrade
# TODO:check which deps are needed
LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath (
[
alsaLib
@ -84,15 +71,7 @@ in pkgs.mkShell {
libxkbcommon
p11-kit
zlib
] ++ (with qt515; [
qtbase
qtdeclarative
qtlocation
qtmultimedia
qtquickcontrols2
qtsvg
qtwebengine
]) ++ (with xorg; [
] ++ (with xorg; [
libICE
libSM
libX11