summary refs log tree commit diff
path: root/pkgs/tools/text
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/text')
-rw-r--r--pkgs/tools/text/difftastic/default.nix6
-rw-r--r--pkgs/tools/text/html2text/default.nix3
-rw-r--r--pkgs/tools/text/invoice2data/default.nix5
-rw-r--r--pkgs/tools/text/mdbook/default.nix11
-rw-r--r--pkgs/tools/text/mecab/base.nix4
-rw-r--r--pkgs/tools/text/source-highlight/default.nix16
-rw-r--r--pkgs/tools/text/vale/default.nix6
7 files changed, 41 insertions, 10 deletions
diff --git a/pkgs/tools/text/difftastic/default.nix b/pkgs/tools/text/difftastic/default.nix
index 1db60b38a8d..98c3db975ed 100644
--- a/pkgs/tools/text/difftastic/default.nix
+++ b/pkgs/tools/text/difftastic/default.nix
@@ -4,6 +4,7 @@
 , fetchFromGitHub
 , testers
 , difftastic
+, stdenv
 }:
 
 let
@@ -32,6 +33,11 @@ rustPlatform.buildRustPackage rec {
     };
   };
 
+  # Work around https://github.com/NixOS/nixpkgs/issues/166205.
+  env = lib.optionalAttrs stdenv.cc.isClang {
+    NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
+  };
+
   postPatch = ''
     patch -d $cargoDepsCopy/libmimalloc-sys-0.1.24/c_src/mimalloc \
       -p1 < ${mimallocPatch}
diff --git a/pkgs/tools/text/html2text/default.nix b/pkgs/tools/text/html2text/default.nix
index fff3e44baf6..7ef802e925f 100644
--- a/pkgs/tools/text/html2text/default.nix
+++ b/pkgs/tools/text/html2text/default.nix
@@ -13,6 +13,9 @@ stdenv.mkDerivation rec {
     substituteInPlace configure \
         --replace /bin/echo echo \
         --replace CXX=unknown ':'
+  '' + lib.optionalString stdenv.cc.isClang ''
+    substituteInPlace HTMLParser.C \
+      --replace "register " ""
   '';
 
   # the --prefix has no effect
diff --git a/pkgs/tools/text/invoice2data/default.nix b/pkgs/tools/text/invoice2data/default.nix
index fd5ead9e0c3..aed1bd2afd5 100644
--- a/pkgs/tools/text/invoice2data/default.nix
+++ b/pkgs/tools/text/invoice2data/default.nix
@@ -10,14 +10,14 @@
 
 python3.pkgs.buildPythonApplication rec {
   pname = "invoice2data";
-  version = "0.4.2";
+  version = "0.4.4";
   format = "setuptools";
 
   src = fetchFromGitHub {
     owner = "invoice-x";
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-ss2h8cg0sga+lzJyQHckrZB/Eb63Oj3FkqmGqWCzCQ8=";
+    hash = "sha256-pAvkp8xkHYi/7ymbxaT7/Jhu44j2P8emm8GyXC6IBnI=";
   };
 
   patches = [
@@ -38,6 +38,7 @@ python3.pkgs.buildPythonApplication rec {
     pdfminer-six
     pillow
     pyyaml
+    setuptools
   ];
 
   makeWrapperArgs = ["--prefix" "PATH" ":" (lib.makeBinPath [
diff --git a/pkgs/tools/text/mdbook/default.nix b/pkgs/tools/text/mdbook/default.nix
index e0529c77917..95483b8465e 100644
--- a/pkgs/tools/text/mdbook/default.nix
+++ b/pkgs/tools/text/mdbook/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, nix, rustPlatform, CoreServices }:
+{ lib, stdenv, fetchFromGitHub, nix, rustPlatform, CoreServices, installShellFiles }:
 
 rustPlatform.buildRustPackage rec {
   pname = "mdbook";
@@ -13,8 +13,17 @@ rustPlatform.buildRustPackage rec {
 
   cargoHash = "sha256-D0XhrweO0A1+81Je4JZ0lmnbIHstNvefpmogCyB4FEE=";
 
+  nativeBuildInputs = [ installShellFiles ];
+
   buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ];
 
+  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
+    installShellCompletion --cmd mdbook \
+      --bash <($out/bin/mdbook completions bash) \
+      --fish <($out/bin/mdbook completions fish) \
+      --zsh  <($out/bin/mdbook completions zsh )
+  '';
+
   passthru = {
     tests = {
       inherit nix;
diff --git a/pkgs/tools/text/mecab/base.nix b/pkgs/tools/text/mecab/base.nix
index 572ec28c075..ea572104238 100644
--- a/pkgs/tools/text/mecab/base.nix
+++ b/pkgs/tools/text/mecab/base.nix
@@ -15,5 +15,9 @@ finalAttrs: {
     "--with-charset=utf8"
   ];
 
+  # mecab uses several features that have been removed in C++17.
+  # Force the language mode to C++14, so that it can compile with clang 16.
+  makeFlags = [ "CXXFLAGS=-std=c++14" ];
+
   doCheck = true;
 }
diff --git a/pkgs/tools/text/source-highlight/default.nix b/pkgs/tools/text/source-highlight/default.nix
index c8a775e6445..d20b3692f31 100644
--- a/pkgs/tools/text/source-highlight/default.nix
+++ b/pkgs/tools/text/source-highlight/default.nix
@@ -14,16 +14,24 @@ stdenv.mkDerivation rec {
   patches = [
     # gcc-11 compat upstream patch
     (fetchpatch {
-      url = "http://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=904949c9026cb772dc93fbe0947a252ef47127f4";
-      sha256 = "1wnj0jmkmrwjww7qk9dvfxh8h06jdn7mi8v2fvwh95b6x87z5l47";
+      url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=904949c9026cb772dc93fbe0947a252ef47127f4";
+      hash = "sha256-h9DyD+pmlQT5dmKjWI9t0gCIYHe7pYkP55LnOqsE0vI=";
       excludes = [ "ChangeLog" ];
     })
 
     # Upstream fix for clang-13 and gcc-12 test support
     (fetchpatch {
       name = "gcc-12.patch";
-      url = "http://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9";
-      sha256 = "1v33zd2766k7cdgmajw2lffw9wd7v4f8z01f40z53f6bp608nr62";
+      url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9";
+      hash = "sha256-wmSLgLnLuFE+IC6AjxzZp/HEnaOCS1VfY2cac0T7Y+w=";
+    })
+  ] ++ lib.optionals stdenv.cc.isClang [
+    # Adds compatibility with C++17 by removing the `register` storage class specifier.
+    (fetchpatch {
+      name = "remove-register-keyword";
+      url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=416b39758dba2c74515584514a959ad1b0ad50d1";
+      hash = "sha256-R5A7IGHhU82EqceMCsuNBanhRz4dFVqiaH8637dr7jw=";
+      includes = [ "lib/*" ];
     })
   ];
 
diff --git a/pkgs/tools/text/vale/default.nix b/pkgs/tools/text/vale/default.nix
index d4ed3ba55a9..7ae0de13ed9 100644
--- a/pkgs/tools/text/vale/default.nix
+++ b/pkgs/tools/text/vale/default.nix
@@ -2,7 +2,7 @@
 
 buildGoModule rec {
   pname = "vale";
-  version = "2.29.6";
+  version = "2.29.7";
 
   subPackages = [ "cmd/vale" ];
   outputs = [ "out" "data" ];
@@ -11,10 +11,10 @@ buildGoModule rec {
     owner = "errata-ai";
     repo = "vale";
     rev = "v${version}";
-    hash = "sha256-0btFCTpVB50097yQEggpm1rmm4aciTgfdLAkczQ1mj4=";
+    hash = "sha256-5fOEZG+ucp9EpizNHvKzqksnDzV8x0miGSKnTelxmzs=";
   };
 
-  vendorHash = "sha256-EbhLz4agDWAlALfBcGUbVNz+teUvgroxzaSN8T19AJY=";
+  vendorHash = "sha256-FnzuumOIvjpoDr+yBaRc8UjMDNW8mgrJiz1ZyzNW0Ts=";
 
   postInstall = ''
     mkdir -p $data/share/vale