From 87dba28e72f59617665704029cf4fdda97f93da2 Mon Sep 17 00:00:00 2001 From: FliegendeWurst Date: Fri, 20 Dec 2024 17:37:39 +0100 Subject: [PATCH 1/2] mozc: devendor protobuf This also fixes the build for GCC 14. --- pkgs/by-name/mo/mozc/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/mo/mozc/package.nix b/pkgs/by-name/mo/mozc/package.nix index a1b0e804f4525..f32de2fd5f625 100644 --- a/pkgs/by-name/mo/mozc/package.nix +++ b/pkgs/by-name/mo/mozc/package.nix @@ -4,6 +4,7 @@ fetchFromGitHub, qt6, pkg-config, + protobuf_27, bazel, ibus, unzip, @@ -18,7 +19,7 @@ let in buildBazelPackage rec { pname = "mozc"; - version = "2.30.5544.102"; + version = "2.30.5544.102"; # make sure to update protobuf if needed src = fetchFromGitHub { owner = "google"; @@ -63,6 +64,9 @@ buildBazelPackage rec { bazelTargets = [ "package" ]; postPatch = '' + # replace protobuf with our own + rm -r src/third_party/protobuf + cp -r ${protobuf_27.src} src/third_party/protobuf substituteInPlace src/config.bzl \ --replace-fail "/usr/bin/xdg-open" "${xdg-utils}/bin/xdg-open" \ --replace-fail "/usr" "$out" From 178429a71b397f024ca62433d973dfa7c468f748 Mon Sep 17 00:00:00 2001 From: FliegendeWurst Date: Fri, 20 Dec 2024 18:46:13 +0100 Subject: [PATCH 2/2] fcitx5-mozc: use our protobuf --- pkgs/by-name/fc/fcitx5-mozc/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/fc/fcitx5-mozc/package.nix b/pkgs/by-name/fc/fcitx5-mozc/package.nix index 0e7d0c865e44c..f7a9ec71328c0 100644 --- a/pkgs/by-name/fc/fcitx5-mozc/package.nix +++ b/pkgs/by-name/fc/fcitx5-mozc/package.nix @@ -8,6 +8,7 @@ mozc, nixosTests, pkg-config, + protobuf_27, python3, stdenv, unzip, @@ -15,7 +16,7 @@ buildBazelPackage { pname = "fcitx5-mozc"; - version = "2.30.5544.102"; + version = "2.30.5544.102"; # make sure to update protobuf if needed src = fetchFromGitHub { owner = "fcitx"; @@ -38,6 +39,9 @@ buildBazelPackage { ]; postPatch = '' + # replace protobuf with our own + rm -r src/third_party/protobuf + cp -r ${protobuf_27.src} src/third_party/protobuf sed -i -e 's|^\(LINUX_MOZC_SERVER_DIR = \).\+|\1"${mozc}/lib/mozc"|' src/config.bzl '';