nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit 90404e83c3751d61649ce218db53679e9fe35c41
parent 0f5cf689600f0ca053281fa8b7cdecc85ab1e10c
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Mon, 13 Sep 2021 22:48:47 +0300

Add qt6

Diffstat:
Mpkgs/default.nix | 1+
Apkgs/development/libraries/qt-6/default.nix | 112+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkgs/development/libraries/qt-6/icu.nix | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 207 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -77,6 +77,7 @@ lib.makeScope newScope ( hfst = callPackage ./development/libraries/hfst { }; libshell = callPackage ./development/libraries/libshell { }; microjson = callPackage ./development/libraries/microjson { }; + qt6 = callPackage ./development/libraries/qt-6 { }; ### DEVELOPMENT / PERL MODULES diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix @@ -0,0 +1,112 @@ +# https://gist.github.com/rprospero/dd8e16bad9f842409c85e63ade31c355 +{ lib, stdenv, fetchurl, requireFile, python3Packages, p7zip, libmysqlclient, autoPatchelfHook +, dbus, libxkbcommon, gdk-pixbuf, libdrm, libgssglue, mysql, gtkd +, cups, pango, postgresql, libGL, libglvnd, xorg, unixODBC }: + +let + aqt = python3Packages.buildPythonPackage rec { + pname = "aqtinstall"; + version = "1.2.4"; + src = python3Packages.fetchPypi { + inherit pname version; + sha256 = "fmaAYOSHrx5LVUoPlIw0p/0jMRVGSPE+teEVlNurz10="; + }; + propagatedBuildInputs = [ + python3Packages.setuptools-scm + python3Packages.texttable + python3Packages.patch + python3Packages.requests + semantic_version + p7zip + ]; + pipInstallFlags = [ "--no-deps" ]; + + doCheck = false; + }; + + semantic_version = python3Packages.buildPythonPackage rec { + pname = "semantic_version"; + version = "2.8.5"; + src = python3Packages.fetchPypi { + inherit pname version; + sha256 = "0sst4FWHYpNGebmhBOguynr0SMn0l00fPuzP9lHfilQ="; + }; + # propagatedBuildInputs = + # [ python3Packages.setuptools-scm python3Packages.semantic_verion ]; + # pipInstallFlags = [ "--no-deps" ]; + + doCheck = false; + }; + + qtbase = requireFile { + name = "6.1.1-0-202106031044qtbase-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z"; + message = '' + Download https://mirrors.ukfast.co.uk/sites/qt.io/online/qtsdkrepository/linux_x64/desktop/qt6_611/qt.qt6.611.gcc_64/6.1.1-0-202106031044qtbase-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z + and add it to the nix store with nix-store --add-fixed sha256 <FILE>. + ''; + sha256 = "fcE1ShAuAbKPihOG4OILnijM0mgAsa5l8V8V1bOYykM="; + }; + qtsvg = requireFile { + name = "6.1.1-0-202106031044qtsvg-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z"; + message = '' + Download https://mirrors.ukfast.co.uk/sites/qt.io/online/qtsdkrepository/linux_x64/desktop/qt6_611/qt.qt6.611.gcc_64/6.1.1-0-202106031044qtsvg-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z + and add it to the nix store with nix-store --add-fixed sha256 <FILE>. + ''; + sha256 = "zO9CAMNN7k5k51V4JcrCZFbAag3sn2gmd0YoYvh+qng="; + }; + +in stdenv.mkDerivation { + pname = "qt6"; + version = "6.1.1"; + unpackPhase = '' + ${p7zip}/bin/7z x ${qtbase} -o$out + ${p7zip}/bin/7z x ${qtsvg} -o$out + ''; + installPhase = '' + mkdir $out/lib + ln -s ${libmysqlclient}/lib/mysql/libmysqlclient.so $out/lib/libmysqlclient.so.21 + patchelf --set-rpath $out/lib $out/6.1.1/gcc_64/lib/libQt6Core.so.6.1.1 + echo No Install + ''; + nativeBuildInputs = [ autoPatchelfHook ]; + autoPatchelfIgnoreMissingDeps = false; + buildInputs = [ + dbus + libxkbcommon + stdenv.cc.cc.lib + + gdk-pixbuf + libdrm + (import ./icu.nix { + inherit lib stdenv fetchurl; + version = "56.1"; + sha256 = "OmTpEFxzTc9jHAs+1gQEUxvObA9aZL/hpkAqTMIxSBY="; + }) + libgssglue + mysql + libmysqlclient.dev + gtkd + + cups + pango + postgresql + libGL + libglvnd + libglvnd.dev + xorg.xcbutil + xorg.xcbutilwm + xorg.xcbutilkeysyms + xorg.xcbutilimage + xorg.xcbutilrenderutil + unixODBC + ]; + + meta = with lib; { + homepage = "http://www.qt.io"; + description = "A cross-platform application framework for C++"; + license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ]; + maintainers = [ maintainers.sikmir ]; + platforms = platforms.unix; + ci.skip = true; + }; +} diff --git a/pkgs/development/libraries/qt-6/icu.nix b/pkgs/development/libraries/qt-6/icu.nix @@ -0,0 +1,94 @@ +# https://gist.github.com/rprospero/dd8e16bad9f842409c85e63ade31c355 +{ lib, stdenv, fetchurl, version, sha256, patches ? [], patchFlags ? [] }: + +let + buildRootOnly = false; + pname = "icu4c"; + + baseAttrs = { + src = fetchurl { + url = "https://github.com/unicode-org/icu/releases/download/release-${lib.replaceChars [ "." ] [ "-" ] version}/icu4c-${lib.replaceChars [ "." ] [ "_" ] version}-src.tgz"; + inherit sha256; + }; + + postUnpack = '' + sourceRoot=''${sourceRoot}/source + echo Source root reset to ''${sourceRoot} + ''; + + # https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27 + postPatch = if (stdenv.hostPlatform.libc == "glibc" || stdenv.hostPlatform.libc == "musl") && lib.versionOlder version "62.1" + then "substituteInPlace i18n/digitlst.cpp --replace '<xlocale.h>' '<locale.h>'" + else null; # won't find locale_t on darwin + + inherit patchFlags patches; + + preConfigure = '' + sed -i -e "s|/bin/sh|${stdenv.shell}|" configure + + # $(includedir) is different from $(prefix)/include due to multiple outputs + sed -i -e 's|^\(CPPFLAGS = .*\) -I\$(prefix)/include|\1 -I$(includedir)|' config/Makefile.inc.in + '' + lib.optionalString stdenv.isAarch32 '' + # From https://archlinuxarm.org/packages/armv7h/icu/files/icudata-stdlibs.patch + sed -e 's/LDFLAGSICUDT=-nodefaultlibs -nostdlib/LDFLAGSICUDT=/' -i config/mh-linux + ''; + + configureFlags = [ "--disable-debug" ] + ++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) "--enable-rpath"; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Unicode and globalization support library"; + homepage = "http://site.icu-project.org/"; + maintainers = [ maintainers.sikmir ]; + platforms = platforms.all; + skip.ci = true; + }; + }; + + realAttrs = baseAttrs // { + name = pname + "-" + version; + + outputs = [ "out" "dev" ]; + outputBin = "dev"; + + # remove dependency on bootstrap-tools in early stdenv build + postInstall = lib.optionalString stdenv.isDarwin '' + sed -i 's/INSTALL_CMD=.*install/INSTALL_CMD=install/' $out/lib/icu/${version}/pkgdata.inc + '' + (let + replacements = [ + { from = "\${prefix}/include"; to = "${placeholder "dev"}/include"; } # --cppflags-searchpath + { from = "\${pkglibdir}/Makefile.inc"; to = "${placeholder "dev"}/lib/icu/Makefile.inc"; } # --incfile + { from = "\${pkglibdir}/pkgdata.inc"; to = "${placeholder "dev"}/lib/icu/pkgdata.inc"; } # --incpkgdatafile + ]; + in '' + substituteInPlace "$dev/bin/icu-config" \ + ${lib.concatMapStringsSep " " (r: "--replace '${r.from}' '${r.to}'") replacements} + ''); + + postFixup = ''moveToOutput lib/icu "$dev" ''; + }; + + buildRootOnlyAttrs = baseAttrs // { + name = pname + "-build-root-" + version; + + preConfigure = baseAttrs.preConfigure + '' + mkdir build + cd build + configureScript=../configure + ''; + + postBuild = '' + cd .. + mv build $out + echo "Doing build-root only, exiting now" >&2 + exit 0 + ''; + }; + + attrs = if buildRootOnly + then buildRootOnlyAttrs + else realAttrs; +in +stdenv.mkDerivation attrs