From 4a1a1058e08fcec4bdd864fe28ce0d93fc22993f Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 30 Dec 2024 06:21:50 +0000 Subject: [PATCH 1/7] poco: 1.13.3 -> 1.14.1 Changes: - https://github.com/pocoproject/poco/releases/tag/poco-1.14.0-release - https://github.com/pocoproject/poco/releases/tag/poco-1.14.1-release --- pkgs/by-name/po/poco/package.nix | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/po/poco/package.nix b/pkgs/by-name/po/poco/package.nix index 86a8eba7aff3..e473a6ceae42 100644 --- a/pkgs/by-name/po/poco/package.nix +++ b/pkgs/by-name/po/poco/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, pkg-config, zlib, @@ -10,18 +11,19 @@ sqlite, openssl, unixODBC, + utf8proc, libmysqlclient, }: stdenv.mkDerivation rec { pname = "poco"; - version = "1.13.3"; + version = "1.14.1"; src = fetchFromGitHub { owner = "pocoproject"; repo = "poco"; - sha256 = "sha256-ryBQjzg1DyYd/LBZzjHxq8m/7ZXRSKNNGRkIII0eHK0="; + hash = "sha256-acq2eja61sH/QHwMPmiDNns2jvXRTk0se/tHj9XRSiU="; rev = "poco-${version}-release"; }; @@ -32,8 +34,10 @@ stdenv.mkDerivation rec { buildInputs = [ unixODBC + utf8proc libmysqlclient ]; + propagatedBuildInputs = [ zlib pcre2 @@ -50,8 +54,19 @@ stdenv.mkDerivation rec { MYSQL_DIR = libmysqlclient; MYSQL_INCLUDE_DIR = "${MYSQL_DIR}/include/mysql"; - configureFlags = [ - "--unbundled" + cmakeFlags = [ + # use nix provided versions of sqlite, zlib, pcre, expat, ... instead of bundled versions + (lib.cmakeBool "POCO_UNBUNDLED" true) + ]; + + patches = [ + # Remove on next release + (fetchpatch { + name = "disable-included-pcre-if-pcre-is-linked-staticly"; + # this happens when building pkgsStatic.poco + url = "https://patch-diff.githubusercontent.com/raw/pocoproject/poco/pull/4879.patch"; + hash = "sha256-VFWuRuf0GPYFp43WKI8utl+agP+7a5biLg7m64EMnVo="; + }) ]; postFixup = '' From dbe579759179759e07ed45eeb13dadae91cc7254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ha=CC=88cker?= Date: Sat, 15 Feb 2025 20:15:24 +0100 Subject: [PATCH 2/7] pothos: fix the build against poco-1.14 --- pkgs/applications/radio/pothos/cstring.patch | 50 ++++++++++++++++++++ pkgs/applications/radio/pothos/default.nix | 8 ++++ 2 files changed, 58 insertions(+) create mode 100644 pkgs/applications/radio/pothos/cstring.patch diff --git a/pkgs/applications/radio/pothos/cstring.patch b/pkgs/applications/radio/pothos/cstring.patch new file mode 100644 index 000000000000..4e8957c3f122 --- /dev/null +++ b/pkgs/applications/radio/pothos/cstring.patch @@ -0,0 +1,50 @@ +Submodule blocks contains modified content +diff --git a/blocks/file/BinaryFileSink.cpp b/blocks/file/BinaryFileSink.cpp +index 31c9a41..0083b0d 100644 +--- a/blocks/file/BinaryFileSink.cpp ++++ b/blocks/file/BinaryFileSink.cpp +@@ -13,6 +13,7 @@ + #endif //_MSC_VER + #include + #include ++#include + + #ifndef O_BINARY + #define O_BINARY 0 +diff --git a/blocks/file/BinaryFileSource.cpp b/blocks/file/BinaryFileSource.cpp +index 0151231..379d383 100644 +--- a/blocks/file/BinaryFileSource.cpp ++++ b/blocks/file/BinaryFileSource.cpp +@@ -13,6 +13,7 @@ + #endif //_MSC_VER + #include + #include ++#include + + #ifndef O_BINARY + #define O_BINARY 0 +diff --git a/blocks/file/TextFileSink.cpp b/blocks/file/TextFileSink.cpp +index b4b2f08..2be66e2 100644 +--- a/blocks/file/TextFileSink.cpp ++++ b/blocks/file/TextFileSink.cpp +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + /*********************************************************************** + * |PothosDoc Text File Sink +Submodule soapy contains modified content +diff --git a/soapy/DemoController.cpp b/soapy/DemoController.cpp +index 4ce8ead..9a4e742 100644 +--- a/soapy/DemoController.cpp ++++ b/soapy/DemoController.cpp +@@ -6,6 +6,7 @@ + #include + #include + #include //min/max ++#include + + /*********************************************************************** + * |PothosDoc SDR Demo Controller diff --git a/pkgs/applications/radio/pothos/default.nix b/pkgs/applications/radio/pothos/default.nix index 641df521c7fd..afa1fcf14bc8 100644 --- a/pkgs/applications/radio/pothos/default.nix +++ b/pkgs/applications/radio/pothos/default.nix @@ -18,6 +18,7 @@ alsa-lib, muparserx, python3, + utf8proc, }: mkDerivation rec { @@ -41,8 +42,14 @@ mkDerivation rec { url = "https://github.com/pothosware/PothosCore/commit/092d1209b0fd0aa8a1733706c994fa95e66fd017.patch"; hash = "sha256-bZXG8kD4+1LgDV8viZrJ/DMjg8UvW7b5keJQDXurfkA="; }) + # various source files are missing imports of + # https://github.com/pothosware/PothosBlocks/issues/80 + ./cstring.patch ]; + # poco 1.14 requires c++17 + NIX_CFLAGS_COMPILE = [ "-std=gnu++17" ]; + nativeBuildInputs = [ cmake pkg-config @@ -62,6 +69,7 @@ mkDerivation rec { alsa-lib muparserx python3 + utf8proc ]; postInstall = '' From a82c5f1e7ea296c7d1cff246a1fc79590614e249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ha=CC=88cker?= Date: Sun, 16 Feb 2025 20:03:29 +0100 Subject: [PATCH 3/7] craftos-pc: fix the build against poco-1.14 Upstream seems to have errors, where it doesn't include all the poco headers it requires for it to build. I've provided a patch and opened a pull request upstream to get it merged: https://github.com/MCJack123/craftos2/issues/391 --- .../craftos-pc/fix-poco-header-includes.patch | 37 +++++++++++ pkgs/by-name/cr/craftos-pc/package.nix | 61 +++++++++++++------ 2 files changed, 80 insertions(+), 18 deletions(-) create mode 100644 pkgs/by-name/cr/craftos-pc/fix-poco-header-includes.patch diff --git a/pkgs/by-name/cr/craftos-pc/fix-poco-header-includes.patch b/pkgs/by-name/cr/craftos-pc/fix-poco-header-includes.patch new file mode 100644 index 000000000000..6eba17581e0b --- /dev/null +++ b/pkgs/by-name/cr/craftos-pc/fix-poco-header-includes.patch @@ -0,0 +1,37 @@ +diff --git a/src/configuration.cpp b/src/configuration.cpp +index 2196121..0c5cf27 100644 +--- a/src/configuration.cpp ++++ b/src/configuration.cpp +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + #include "platform.hpp" + #include "runtime.hpp" + #include "terminal/SDLTerminal.hpp" +diff --git a/src/main.cpp b/src/main.cpp +index 9ab0814..38976a2 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -34,6 +34,7 @@ static void* releaseNotesThread(void* data); + #include + #include + #include ++#include + #ifndef __EMSCRIPTEN__ + #include + #include +diff --git a/src/util.hpp b/src/util.hpp +index b8ab2d1..c643b96 100644 +--- a/src/util.hpp ++++ b/src/util.hpp +@@ -21,6 +21,8 @@ extern "C" { + #include + #include + #include ++#include ++#include + #include + #include + #include diff --git a/pkgs/by-name/cr/craftos-pc/package.nix b/pkgs/by-name/cr/craftos-pc/package.nix index 535b50b0f138..24ea3494efcf 100644 --- a/pkgs/by-name/cr/craftos-pc/package.nix +++ b/pkgs/by-name/cr/craftos-pc/package.nix @@ -1,17 +1,18 @@ -{ lib -, stdenv -, fetchFromGitHub -, callPackage -, patchelf -, unzip -, poco -, openssl -, SDL2 -, SDL2_mixer -, ncurses -, libpng -, pngpp -, libwebp +{ + lib, + stdenv, + fetchFromGitHub, + callPackage, + patchelf, + unzip, + poco, + openssl, + SDL2, + SDL2_mixer, + ncurses, + libpng, + pngpp, + libwebp, }: let @@ -41,8 +42,20 @@ stdenv.mkDerivation rec { hash = "sha256-DbxAsXxpsa42dF6DaLmgIa+Hs/PPqJ4dE97PoKxG2Ig="; }; - nativeBuildInputs = [ patchelf unzip ]; - buildInputs = [ poco openssl SDL2 SDL2_mixer ncurses libpng pngpp libwebp ]; + nativeBuildInputs = [ + patchelf + unzip + ]; + buildInputs = [ + poco + openssl + SDL2 + SDL2_mixer + ncurses + libpng + pngpp + libwebp + ]; strictDeps = true; preBuild = '' @@ -57,6 +70,12 @@ stdenv.mkDerivation rec { runHook postBuild ''; + patches = [ + # fix includes of poco headers + # https://github.com/MCJack123/craftos2/issues/391 + ./fix-poco-header-includes.patch + ]; + dontStrip = true; installPhase = '' @@ -87,9 +106,15 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Implementation of the CraftOS-PC API written in C++ using SDL"; homepage = "https://www.craftos-pc.cc"; - license = with licenses; [ mit free ]; + license = with licenses; [ + mit + free + ]; platforms = platforms.linux; - maintainers = with maintainers; [ siraben tomodachi94 ]; + maintainers = with maintainers; [ + siraben + tomodachi94 + ]; mainProgram = "craftos"; }; } From b542ec2c625617525422bdc751d192744e00bb66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ha=CC=88cker?= Date: Sun, 16 Feb 2025 21:20:40 +0100 Subject: [PATCH 4/7] collabora-online: fix build against poco-1.14 This adds some missing includes for collabora online to actually use the poco-json library. Upstream pull request at https://github.com/CollaboraOnline/online/issues/11175 --- pkgs/by-name/co/collabora-online/package.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/co/collabora-online/package.nix b/pkgs/by-name/co/collabora-online/package.nix index 62c33c455c32..23968d6bae2c 100644 --- a/pkgs/by-name/co/collabora-online/package.nix +++ b/pkgs/by-name/co/collabora-online/package.nix @@ -3,6 +3,7 @@ cairo, cppunit, fetchFromGitHub, + fetchpatch, fetchNpmDeps, lib, libcap, @@ -63,7 +64,15 @@ stdenv.mkDerivation (finalAttrs: { "--with-lokit-path=${libreoffice-collabora.src}/include" ]; - patches = [ ./fix-file-server-regex.patch ]; + patches = [ + ./fix-file-server-regex.patch + # Remove after next release + (fetchpatch { + name = "add-missing-includes-for-poco-1.14.1"; + url = "https://patch-diff.githubusercontent.com/raw/CollaboraOnline/online/pull/11196.patch"; + hash = "sha256-ke4dOxITFHK3xMXIdp+zzUEGYMyDxMJrbbXTN+LaoVU="; + }) + ]; postPatch = '' cp ${./package-lock.json} ${finalAttrs.npmRoot}/package-lock.json From 9576655173d019172731c4e5e8fe5f86641c60b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ha=CC=88cker?= Date: Mon, 17 Feb 2025 21:15:56 +0100 Subject: [PATCH 5/7] mumble: format in standard nix format. --- .../networking/mumble/default.nix | 249 +++++++++++------- 1 file changed, 155 insertions(+), 94 deletions(-) diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix index ddca7c3bad51..43f91c227027 100644 --- a/pkgs/applications/networking/mumble/default.nix +++ b/pkgs/applications/networking/mumble/default.nix @@ -1,111 +1,171 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, qt5, cmake -, avahi, boost, libopus, libsndfile, protobuf, speex, libcap -, alsa-lib, python3 -, rnnoise -, nixosTests -, poco -, flac -, libogg -, libvorbis -, stdenv_32bit -, iceSupport ? true, zeroc-ice -, jackSupport ? false, libjack2 -, pipewireSupport ? true, pipewire -, pulseSupport ? true, libpulseaudio -, speechdSupport ? false, speechd-minimal +{ + lib, + stdenv, + fetchFromGitHub, + fetchpatch, + pkg-config, + qt5, + cmake, + avahi, + boost, + libopus, + libsndfile, + protobuf, + speex, + libcap, + alsa-lib, + python3, + rnnoise, + nixosTests, + poco, + flac, + libogg, + libvorbis, + stdenv_32bit, + iceSupport ? true, + zeroc-ice, + jackSupport ? false, + libjack2, + pipewireSupport ? true, + pipewire, + pulseSupport ? true, + libpulseaudio, + speechdSupport ? false, + speechd-minimal, }: let - generic = overrides: source: (overrides.stdenv or stdenv).mkDerivation (source // overrides // { - pname = overrides.type; - version = source.version; + generic = + overrides: source: + (overrides.stdenv or stdenv).mkDerivation ( + source + // overrides + // { + pname = overrides.type; + version = source.version; - nativeBuildInputs = [ cmake pkg-config python3 qt5.wrapQtAppsHook qt5.qttools ] - ++ (overrides.nativeBuildInputs or [ ]); + nativeBuildInputs = [ + cmake + pkg-config + python3 + qt5.wrapQtAppsHook + qt5.qttools + ] ++ (overrides.nativeBuildInputs or [ ]); - buildInputs = [ avahi boost poco protobuf ] - ++ (overrides.buildInputs or [ ]); + buildInputs = [ + avahi + boost + poco + protobuf + ] ++ (overrides.buildInputs or [ ]); - cmakeFlags = [ - "-D g15=OFF" - "-D CMAKE_CXX_STANDARD=17" # protobuf >22 requires C++ 17 - ] ++ (overrides.configureFlags or [ ]); + cmakeFlags = [ + "-D g15=OFF" + "-D CMAKE_CXX_STANDARD=17" # protobuf >22 requires C++ 17 + ] ++ (overrides.configureFlags or [ ]); - preConfigure = '' - patchShebangs scripts - ''; + preConfigure = '' + patchShebangs scripts + ''; - passthru.tests.connectivity = nixosTests.mumble; + passthru.tests.connectivity = nixosTests.mumble; - meta = with lib; { - description = "Low-latency, high quality voice chat software"; - homepage = "https://mumble.info"; - license = licenses.bsd3; - maintainers = with maintainers; [ felixsinger lilacious ]; - platforms = platforms.linux; - }; - }); + meta = with lib; { + description = "Low-latency, high quality voice chat software"; + homepage = "https://mumble.info"; + license = licenses.bsd3; + maintainers = with maintainers; [ + felixsinger + lilacious + ]; + platforms = platforms.linux; + }; + } + ); - client = source: generic { - type = "mumble"; + client = + source: + generic { + type = "mumble"; - nativeBuildInputs = [ qt5.qttools ]; - buildInputs = [ flac libogg libopus libsndfile libvorbis qt5.qtsvg rnnoise speex ] - ++ lib.optional (!jackSupport) alsa-lib - ++ lib.optional jackSupport libjack2 - ++ lib.optional speechdSupport speechd-minimal - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional pipewireSupport pipewire; + nativeBuildInputs = [ qt5.qttools ]; + buildInputs = + [ + flac + libogg + libopus + libsndfile + libvorbis + qt5.qtsvg + rnnoise + speex + ] + ++ lib.optional (!jackSupport) alsa-lib + ++ lib.optional jackSupport libjack2 + ++ lib.optional speechdSupport speechd-minimal + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional pipewireSupport pipewire; - configureFlags = [ - "-D server=OFF" - "-D bundled-celt=ON" - "-D bundled-opus=OFF" - "-D bundled-speex=OFF" - "-D bundle-qt-translations=OFF" - "-D update=OFF" - "-D overlay-xcompile=OFF" - "-D oss=OFF" - "-D warnings-as-errors=OFF" # conversion error workaround - ] ++ lib.optional (!speechdSupport) "-D speechd=OFF" - ++ lib.optional (!pulseSupport) "-D pulseaudio=OFF" - ++ lib.optional (!pipewireSupport) "-D pipewire=OFF" - ++ lib.optional jackSupport "-D alsa=OFF -D jackaudio=ON"; + configureFlags = + [ + "-D server=OFF" + "-D bundled-celt=ON" + "-D bundled-opus=OFF" + "-D bundled-speex=OFF" + "-D bundle-qt-translations=OFF" + "-D update=OFF" + "-D overlay-xcompile=OFF" + "-D oss=OFF" + "-D warnings-as-errors=OFF" # conversion error workaround + ] + ++ lib.optional (!speechdSupport) "-D speechd=OFF" + ++ lib.optional (!pulseSupport) "-D pulseaudio=OFF" + ++ lib.optional (!pipewireSupport) "-D pipewire=OFF" + ++ lib.optional jackSupport "-D alsa=OFF -D jackaudio=ON"; - env.NIX_CFLAGS_COMPILE = lib.optionalString speechdSupport "-I${speechd-minimal}/include/speech-dispatcher"; + env.NIX_CFLAGS_COMPILE = lib.optionalString speechdSupport "-I${speechd-minimal}/include/speech-dispatcher"; - postFixup = '' - wrapProgram $out/bin/mumble \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath (lib.optional pulseSupport libpulseaudio ++ lib.optional pipewireSupport pipewire)}" - ''; - } source; + postFixup = '' + wrapProgram $out/bin/mumble \ + --prefix LD_LIBRARY_PATH : "${ + lib.makeLibraryPath ( + lib.optional pulseSupport libpulseaudio ++ lib.optional pipewireSupport pipewire + ) + }" + ''; + } source; - server = source: generic { - type = "murmur"; + server = + source: + generic { + type = "murmur"; - configureFlags = [ - "-D client=OFF" - ] ++ lib.optional (!iceSupport) "-D ice=OFF" - ++ lib.optionals iceSupport [ - "-D Ice_HOME=${lib.getDev zeroc-ice};${lib.getLib zeroc-ice}" - "-D CMAKE_PREFIX_PATH=${lib.getDev zeroc-ice};${lib.getLib zeroc-ice}" - "-D Ice_SLICE_DIR=${lib.getDev zeroc-ice}/share/ice/slice" + configureFlags = + [ + "-D client=OFF" + ] + ++ lib.optional (!iceSupport) "-D ice=OFF" + ++ lib.optionals iceSupport [ + "-D Ice_HOME=${lib.getDev zeroc-ice};${lib.getLib zeroc-ice}" + "-D CMAKE_PREFIX_PATH=${lib.getDev zeroc-ice};${lib.getLib zeroc-ice}" + "-D Ice_SLICE_DIR=${lib.getDev zeroc-ice}/share/ice/slice" + ]; + + buildInputs = [ libcap ] ++ lib.optional iceSupport zeroc-ice; + } source; + + overlay = + source: + generic { + stdenv = stdenv_32bit; + type = "mumble-overlay"; + + configureFlags = [ + "-D server=OFF" + "-D client=OFF" + "-D overlay=ON" ]; - - buildInputs = [ libcap ] - ++ lib.optional iceSupport zeroc-ice; - } source; - - overlay = source: generic { - stdenv = stdenv_32bit; - type = "mumble-overlay"; - - configureFlags = [ - "-D server=OFF" - "-D client=OFF" - "-D overlay=ON" - ]; - } source; + } source; source = rec { version = "1.5.735"; @@ -119,8 +179,9 @@ let fetchSubmodules = true; }; }; -in { - mumble = lib.recursiveUpdate (client source) {meta.mainProgram = "mumble";}; - murmur = lib.recursiveUpdate (server source) {meta.mainProgram = "mumble-server";}; +in +{ + mumble = lib.recursiveUpdate (client source) { meta.mainProgram = "mumble"; }; + murmur = lib.recursiveUpdate (server source) { meta.mainProgram = "mumble-server"; }; overlay = overlay source; } From 00e7e2644c915578b50743b04846e5619d0e6362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ha=CC=88cker?= Date: Mon, 17 Feb 2025 21:16:30 +0100 Subject: [PATCH 6/7] mumble: fix build against poco 1.14.1 --- pkgs/applications/networking/mumble/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix index 43f91c227027..3205630ce61c 100644 --- a/pkgs/applications/networking/mumble/default.nix +++ b/pkgs/applications/networking/mumble/default.nix @@ -13,6 +13,7 @@ protobuf, speex, libcap, + utf8proc, alsa-lib, python3, rnnoise, @@ -99,6 +100,7 @@ let qt5.qtsvg rnnoise speex + utf8proc ] ++ lib.optional (!jackSupport) alsa-lib ++ lib.optional jackSupport libjack2 From 33f6d24bad78dd77d3085a5936d269504c0e8ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ha=CC=88cker?= Date: Tue, 18 Feb 2025 21:13:37 +0100 Subject: [PATCH 7/7] multipass: fix build against poco-1.14.1 --- pkgs/by-name/mu/multipass/multipassd.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/mu/multipass/multipassd.nix b/pkgs/by-name/mu/multipass/multipassd.nix index 2cc6f9b6fb06..e328ca783914 100644 --- a/pkgs/by-name/mu/multipass/multipassd.nix +++ b/pkgs/by-name/mu/multipass/multipassd.nix @@ -24,6 +24,7 @@ qt6, slang, stdenv, + utf8proc, xterm, }: @@ -120,6 +121,7 @@ stdenv.mkDerivation { protobuf qt6.qtbase qt6.qtwayland + utf8proc ]; nativeBuildInputs = [