push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
{
lib,
stdenv,
fetchurl,
updateAutotoolsGnuConfigScriptsHook,
xz,
coreutils ? null,
}:
# Note: this package is used for bootstrapping fetchurl, and thus
# cannot use fetchpatch! All mutable patches (generated by GitHub or
# cgit) that are needed here should be included directly in Nixpkgs as
# files.
stdenv.mkDerivation rec {
pname = "diffutils";
version = "3.12";
src = fetchurl {
url = "mirror://gnu/diffutils/diffutils-${version}.tar.xz";
hash = "sha256-fIt/n8hgkUH96pzs6FJJ0whiQ5H/Yd7a9Sj8szdyff0=";
};
outputs = [
"out"
"info"
];
patches = [
# Fixes test-float-h failure on ppc64 with C23
# https://lists.gnu.org/archive/html/bug-gnulib/2025-07/msg00021.html
# Multiple upstream commits squashed with adjustments, see header
./gnulib-float-h-tests-port-to-C23-PowerPC-GCC.patch
]
++ lib.optionals stdenv.hostPlatform.useLLVM [
./musl-llvm.patch
];
nativeBuildInputs = [
updateAutotoolsGnuConfigScriptsHook
(lib.getBin xz)
];
# If no explicit coreutils is given, use the one from stdenv.
buildInputs = [ coreutils ];
# Disable stack-related gnulib tests on x86_64-darwin because they have problems running under
# Rosetta 2: test-c-stack hangs, test-sigsegv-catch-stackoverflow and test-sigaction fail.
postPatch =
if
((stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) || (stdenv.hostPlatform.isAarch32))
then
''
sed -i -E 's:[[:space:]]test-c-stack2?\.sh::g' gnulib-tests/Makefile.in
sed -i -E 's:[[:space:]]test-sigsegv-catch-stackoverflow[12]\$\(EXEEXT\)::g' gnulib-tests/Makefile.in
sed -i -E 's:[[:space:]]test-sigaction\$\(EXEEXT\)::g' gnulib-tests/Makefile.in
''
else if stdenv.hostPlatform.isFreeBSD then
''
sed -i -E 's:test-time::g' gnulib-tests/Makefile.in
''
else
null;
configureFlags =
# "pr" need not be on the PATH as a run-time dep, so we need to tell
# configure where it is. Covers the cross and native case alike.
lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr"
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"gl_cv_func_getopt_gnu=yes"
"gl_cv_func_strcasecmp_works=yes"
];
# Test failure on QEMU only (#300550)
doCheck = !stdenv.buildPlatform.isRiscV64;
meta = with lib; {
homepage = "https://www.gnu.org/software/diffutils/diffutils.html";
description = "Commands for showing the differences between files (diff, cmp, etc.)";
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = lib.teams.helsinki-systems.members;
};
}

View File

@@ -0,0 +1,230 @@
Applies the following incremental gnulib commits:
- 55a366a06fbd98bf13adc531579e3513cee97a32
- 65ed9d3b24ad09fd61d326c83e7f1b05f6e9d65f
- ce8e9de0bf34bc63dffc67ab384334c509175f64
- 6164b4cb0887b5331a4e64449107decd37d32735
With adjustments specific to the structure & differences in diffutils:
- gnulib code is completely contained in gnulib-tests (flat, no separate lib directory)
- A Makefile.in is used for the test flags instead of the fancy automake modules
in the upstream gnulib project, so we add -lm to the float test there.
Surrounding texts in this file are slightly different in every project.
---
diff '--color=auto' -ruN a/gnulib-tests/float.c b/gnulib-tests/float.c
--- a/gnulib-tests/float.c 2025-01-02 03:33:12.000000000 +0100
+++ b/gnulib-tests/float.c 2025-07-09 21:20:34.116794411 +0200
@@ -23,7 +23,7 @@
#if GNULIB_defined_long_double_union
# if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
const union gl_long_double_union gl_LDBL_MAX =
- { { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
+ { { DBL_MAX, DBL_MAX / 0x1p53 } };
# elif defined __i386__
const union gl_long_double_union gl_LDBL_MAX =
{ { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
diff '--color=auto' -ruN a/gnulib-tests/float.in.h b/gnulib-tests/float.in.h
--- a/gnulib-tests/float.in.h 2025-01-02 03:33:12.000000000 +0100
+++ b/gnulib-tests/float.in.h 2025-07-09 21:20:34.117010190 +0200
@@ -113,44 +113,38 @@
# define LDBL_MAX_10_EXP 4932
#endif
-/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
- wrong.
- On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong. */
-#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+/* On PowerPC with gcc 15 when using __ibm128 long double, the value of
+ LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX, and LDBL_NORM_MAX are wrong. */
+#if ((defined _ARCH_PPC || defined _POWER) && LDBL_MANT_DIG == 106 \
+ && defined __GNUC__)
# undef LDBL_MIN_EXP
# define LDBL_MIN_EXP DBL_MIN_EXP
# undef LDBL_MIN_10_EXP
# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
# undef LDBL_MIN
# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
-#endif
-#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
# undef LDBL_MAX
-/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
- It is not easy to define:
- #define LDBL_MAX 1.79769313486231580793728971405302307166e308L
- is too small, whereas
- #define LDBL_MAX 1.79769313486231580793728971405302307167e308L
- is too large. Apparently a bug in GCC decimal-to-binary conversion.
- Also, I can't get values larger than
- #define LDBL63 ((long double) (1ULL << 63))
- #define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
- #define LDBL945 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
- #define LDBL1008 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
- #define LDBL_MAX (LDBL1008 * 65535.0L + LDBL945 * (long double) 9223372036821221375ULL + LDBL882 * (long double) 4611686018427387904ULL)
- which is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xF8000000 }.
- So, define it like this through a reference to an external variable
+/* LDBL_MAX is 2**1024 - 2**918, represented as: { 0x7FEFFFFF, 0xFFFFFFFF,
+ 0x7C9FFFFF, 0xFFFFFFFF }.
+
+ Do not write it as a constant expression, as GCC would likely treat
+ that as infinity due to the vagaries of this platform's funky arithmetic.
+ Instead, define it through a reference to an external variable.
+ Like the following, but using a union to avoid type mismatches:
- const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL };
+ const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / 0x1p53 };
extern const long double LDBL_MAX;
- or through a pointer cast
+ The following alternative would not work as well when GCC is optimizing:
+
+ #define LDBL_MAX (*(long double const *) (double[])
+ { DBL_MAX, DBL_MAX / 0x1p53 })
- #define LDBL_MAX \
- (*(const long double *) (double[]) { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL })
+ The following alternative would require GCC 6 or later:
- Unfortunately, this is not a constant expression, and the latter expression
- does not work well when GCC is optimizing.. */
+ #define LDBL_MAX __builtin_pack_longdouble (DBL_MAX, DBL_MAX / 0x1p53)
+
+ Unfortunately none of the alternatives are constant expressions. */
# if !GNULIB_defined_long_double_union
union gl_long_double_union
{
@@ -161,6 +155,8 @@
# endif
extern const union gl_long_double_union gl_LDBL_MAX;
# define LDBL_MAX (gl_LDBL_MAX.ld)
+# undef LDBL_NORM_MAX
+# define LDBL_NORM_MAX LDBL_MAX
#endif
/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong.
@@ -181,6 +177,21 @@
# endif
#endif
+/* On PowerPC platforms, 'long double' has a double-double representation.
+ Up to ISO C 17, this was outside the scope of ISO C because it can represent
+ numbers with mantissas of the form 1.<52 bits><many zeroes><52 bits>, such as
+ 1.0L + 4.94065645841246544176568792868221e-324L = 1 + 2^-1074; see
+ ISO C 17 § 5.2.4.2.2.(3).
+ In ISO C 23, wording has been included that makes this 'long double'
+ representation compliant; see ISO C 23 § 5.2.5.3.3.(8)-(9). In this setting,
+ numbers with mantissas of the form 1.<52 bits><many zeroes><52 bits> are
+ called "unnormalized". And since LDBL_EPSILON must be normalized (per
+ ISO C 23 § 5.2.5.3.3.(33)), it must be 2^-105. */
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */
+#endif
+
/* ============================ ISO C11 support ============================ */
/* 'float' properties */
@@ -309,7 +320,11 @@
# endif
#endif
#ifndef LDBL_NORM_MAX
-# define LDBL_NORM_MAX LDBL_MAX
+# ifdef __LDBL_NORM_MAX__
+# define LDBL_NORM_MAX __LDBL_NORM_MAX__
+# else
+# define LDBL_NORM_MAX LDBL_MAX
+# endif
#endif
#ifndef LDBL_SNAN
/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
diff '--color=auto' -ruN a/gnulib-tests/Makefile.in b/gnulib-tests/Makefile.in
--- a/gnulib-tests/Makefile.in 2025-04-09 04:36:30.000000000 +0200
+++ b/gnulib-tests/Makefile.in 2025-07-09 21:20:45.260378342 +0200
@@ -1059,7 +1059,7 @@
test_filenamecat_DEPENDENCIES = $(am__DEPENDENCIES_2)
test_float_h_SOURCES = test-float-h.c
test_float_h_OBJECTS = test-float-h.$(OBJEXT)
-test_float_h_LDADD = $(LDADD)
+test_float_h_LDADD = $(LDADD) -lm
test_float_h_DEPENDENCIES = libtests.a ../lib/libdiffutils.a \
libtests.a ../lib/libdiffutils.a libtests.a \
$(am__DEPENDENCIES_1)
diff '--color=auto' -ruN a/gnulib-tests/test-float-h.c b/gnulib-tests/test-float-h.c
--- a/gnulib-tests/test-float-h.c 2025-01-02 03:33:12.000000000 +0100
+++ b/gnulib-tests/test-float-h.c 2025-07-09 21:20:34.117248712 +0200
@@ -101,6 +101,8 @@
/* ------------------------------------------------------------------------- */
+#include <math.h>
+
#include "fpucw.h"
#include "isnanf-nolibm.h"
#include "isnand-nolibm.h"
@@ -396,6 +398,44 @@
/* -------------------- Check macros for 'long double' -------------------- */
+static int
+test_isfinitel (long double volatile x)
+{
+ if (x != x)
+ return 0;
+ long double volatile zero = x * 0;
+ return zero == 0;
+}
+
+/* Return X after normalization. This makes a difference on platforms
+ where long double can represent unnormalized values. For example,
+ suppose x = 1 + 2**-106 on PowerPC with IBM long double where
+ FLT_RADIX = 2, LDBL_MANT_DIG = 106, and LDBL_EPSILON = 2**-105.
+ Then 1 < x < 1 + LDBL_EPSILON, and normalize_long_double (x) returns 1. */
+static long double
+normalize_long_double (long double volatile x)
+{
+ if (FLT_RADIX == 2 && test_isfinitel (x))
+ {
+ int xexp;
+ long double volatile
+ frac = frexpl (x, &xexp),
+ significand = frac * pow2l (LDBL_MANT_DIG),
+ normalized_significand = truncl (significand),
+ normalized_x = normalized_significand * pow2l (xexp - LDBL_MANT_DIG);
+
+ /* The test_isfinitel defends against PowerPC with IBM long double,
+ which fritzes out near LDBL_MAX. */
+ if (test_isfinitel (normalized_x))
+ x = normalized_x;
+ }
+ else
+ {
+ /* Hope that X is already normalized. */
+ }
+ return x;
+}
+
static void
test_long_double (void)
{
@@ -455,7 +495,7 @@
for (n = 0; n <= 2 * LDBL_MANT_DIG; n++)
{
volatile long double half_n = pow2l (- n); /* 2^-n */
- volatile long double x = me - half_n;
+ volatile long double x = normalize_long_double (me - half_n);
if (x < me)
ASSERT (x <= 1.0L);
}
@@ -483,8 +523,12 @@
ASSERT (!LDBL_IS_IEC_60559);
#endif
+ printf("LDBL_NORM_MAX: %LF\n", LDBL_NORM_MAX);
+ printf("LDBL_MAX: %LF\n", LDBL_MAX);
+ printf("normalize_long_double(LDBL_MAX): %LF\n", normalize_long_double(LDBL_MAX));
+
/* Check the value of LDBL_NORM_MAX. */
- ASSERT (LDBL_NORM_MAX == LDBL_MAX);
+ ASSERT (LDBL_NORM_MAX == normalize_long_double (LDBL_MAX));
/* Check the value of LDBL_SNAN. */
ASSERT (isnanl (LDBL_SNAN));

View File

@@ -0,0 +1,15 @@
---
gnulib-tests/test-c32ispunct.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/gnulib-tests/test-c32ispunct.c
+++ b/gnulib-tests/test-c32ispunct.c
@@ -255,7 +255,7 @@ main (int argc, char *argv[])
is = for_character ("\360\235\204\200", 4);
ASSERT (is != 0);
#endif
- #if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__) || defined __ANDROID__)
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__) || defined __ANDROID__)
/* U+E003A TAG COLON */
is = for_character ("\363\240\200\272", 4);
ASSERT (is == 0);

View File

@@ -0,0 +1,124 @@
{
lib,
stdenv,
fetchurl,
removeReferencesTo,
runtimeShellPackage,
texinfo,
interactive ? false,
readline,
autoreconfHook, # no-pma fix
/*
Test suite broke on:
stdenv.hostPlatform.isCygwin # XXX: `test-dup2' segfaults on Cygwin 6.1
|| stdenv.hostPlatform.isDarwin # XXX: `locale' segfaults
|| stdenv.hostPlatform.isSunOS # XXX: `_backsmalls1' fails, locale stuff?
|| stdenv.hostPlatform.isFreeBSD
*/
doCheck ? (interactive && stdenv.hostPlatform.isLinux),
glibcLocales ? null,
locale ? null,
}:
assert (doCheck && stdenv.hostPlatform.isLinux) -> glibcLocales != null;
stdenv.mkDerivation rec {
pname = "gawk" + lib.optionalString interactive "-interactive";
version = "5.3.2";
src = fetchurl {
url = "mirror://gnu/gawk/gawk-${version}.tar.xz";
hash = "sha256-+MNIZQnecFGSE4sA7ywAu73Q6Eww1cB9I/xzqdxMycw=";
};
# PIE is incompatible with the "persistent malloc" ("pma") feature.
# While build system attempts to pass -no-pie to gcc. nixpkgs' `ld`
# wrapped still passes `-pie` flag to linker and breaks linkage.
# Let's disable "pie" until `ld` is fixed to do the right thing.
hardeningDisable = [ "pie" ];
# When we do build separate interactive version, it makes sense to always include man.
outputs = [
"out"
"info"
]
++ lib.optional (!interactive) "man";
strictDeps = true;
# no-pma fix
nativeBuildInputs = [
autoreconfHook
texinfo
]
++ lib.optionals interactive [
removeReferencesTo
]
++ lib.optionals (doCheck && stdenv.hostPlatform.isLinux) [
glibcLocales
];
buildInputs =
lib.optionals interactive [
runtimeShellPackage
readline
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
locale
];
configureFlags = [
(if interactive then "--with-readline=${readline.dev}" else "--without-readline")
];
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
# TODO: figure out a better way to unbreak _NSGetExecutablePath invocations
NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration";
};
makeFlags = [
"AR=${stdenv.cc.targetPrefix}ar"
];
inherit doCheck;
postInstall =
(
if interactive then
''
remove-references-to -t "$NIX_CC" "$out"/bin/gawkbug
patchShebangs --host "$out"/bin/gawkbug
''
else
''
rm "$out"/bin/gawkbug
''
)
+ ''
rm "$out"/bin/gawk-*
ln -s gawk.1 "''${!outputMan}"/share/man/man1/awk.1
'';
meta = {
homepage = "https://www.gnu.org/software/gawk/";
description = "GNU implementation of the Awk programming language";
longDescription = ''
Many computer users need to manipulate text files: extract and then
operate on data from parts of certain lines while discarding the rest,
make changes in various text files wherever certain patterns appear,
and so on. To write a program to do these things in a language such as
C or Pascal is a time-consuming inconvenience that may take many lines
of code. The job is easy with awk, especially the GNU implementation:
Gawk.
The awk utility interprets a special-purpose programming language that
makes it possible to handle many data-reformatting jobs with just a few
lines of code.
'';
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix ++ lib.platforms.windows;
teams = [ lib.teams.helsinki-systems ];
mainProgram = "gawk";
};
}

View File

@@ -0,0 +1,62 @@
diff --git a/haru/pdf.c b/haru/pdf.c
index d16f573..3129427 100644
--- a/haru/pdf.c
+++ b/haru/pdf.c
@@ -105,7 +105,7 @@ static awk_scalar_t HPDF_CS_PATTERN_node;
/* LineCap */
static awk_scalar_t HPDF_BUTT_END_node;
static awk_scalar_t HPDF_ROUND_END_node;
-static awk_scalar_t HPDF_PROJECTING_SCUARE_END_node;
+static awk_scalar_t HPDF_PROJECTING_SQUARE_END_node;
/* _LineJoin */
static awk_scalar_t HPDF_MITER_JOIN_node;
@@ -248,7 +248,7 @@ static awk_scalar_t HPDF_ENCODER_UNKNOWN_node;
/* ByteType */
static awk_scalar_t HPDF_BYTE_TYPE_SINGLE_node;
static awk_scalar_t HPDF_BYTE_TYPE_LEAD_node;
-static awk_scalar_t HPDF_BYTE_TYPE_TRIAL_node;
+static awk_scalar_t HPDF_BYTE_TYPE_TRAIL_node;
static awk_scalar_t HPDF_BYTE_TYPE_UNKNOWN_node;
/* TextAlignment */
@@ -308,7 +308,7 @@ static const struct varinit varinit[] = {
ENTRY(HPDF_CS_PATTERN, 1)
ENTRY(HPDF_BUTT_END, 1)
ENTRY(HPDF_ROUND_END, 1)
- ENTRY(HPDF_PROJECTING_SCUARE_END, 1)
+ ENTRY(HPDF_PROJECTING_SQUARE_END, 1)
ENTRY(HPDF_MITER_JOIN, 1)
ENTRY(HPDF_ROUND_JOIN, 1)
ENTRY(HPDF_BEVEL_JOIN, 1)
@@ -417,7 +417,7 @@ static const struct varinit varinit[] = {
ENTRY(HPDF_ENCODER_UNKNOWN, 1)
ENTRY(HPDF_BYTE_TYPE_SINGLE, 1)
ENTRY(HPDF_BYTE_TYPE_LEAD, 1)
- ENTRY(HPDF_BYTE_TYPE_TRIAL, 1)
+ ENTRY(HPDF_BYTE_TYPE_TRAIL, 1)
ENTRY(HPDF_BYTE_TYPE_UNKNOWN, 1)
ENTRY(HPDF_TALIGN_LEFT, 1)
ENTRY(HPDF_TALIGN_RIGHT, 1)
diff --git a/haru/pdf.h b/haru/pdf.h
index a4ef39a..07cf168 100644
--- a/haru/pdf.h
+++ b/haru/pdf.h
@@ -86,7 +86,7 @@
#define DEFAULT_HPDF_BUTT_END HPDF_BUTT_END
#define DEFAULT_HPDF_ROUND_END HPDF_ROUND_END
-#define DEFAULT_HPDF_PROJECTING_SCUARE_END HPDF_PROJECTING_SCUARE_END
+#define DEFAULT_HPDF_PROJECTING_SQUARE_END HPDF_PROJECTING_SQUARE_END
/* _LineJoin */
#define DEFAULT_HPDF_MITER_JOIN HPDF_MITER_JOIN
@@ -229,7 +229,7 @@
/* ByteType */
#define DEFAULT_HPDF_BYTE_TYPE_SINGLE HPDF_BYTE_TYPE_SINGLE
#define DEFAULT_HPDF_BYTE_TYPE_LEAD HPDF_BYTE_TYPE_LEAD
-#define DEFAULT_HPDF_BYTE_TYPE_TRIAL HPDF_BYTE_TYPE_TRIAL
+#define DEFAULT_HPDF_BYTE_TYPE_TRAIL HPDF_BYTE_TYPE_TRAIL
#define DEFAULT_HPDF_BYTE_TYPE_UNKNOWN HPDF_BYTE_TYPE_UNKNOWN
/* TextAlignment */

View File

@@ -0,0 +1,20 @@
{
runCommand,
gawk,
extensions,
makeWrapper,
}:
runCommand "gawk-with-extensions"
{
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ gawk ] ++ extensions;
}
''
mkdir -p $out/bin
for i in ${gawk}/bin/*; do
name="$(basename "$i")"
makeWrapper $i $out/bin/$name \
--prefix AWKLIBPATH : "${gawk}/lib/gawk:''${AWKLIBPATH:-}"
done
''

View File

@@ -0,0 +1,221 @@
{
lib,
stdenv,
recurseIntoAttrs,
fetchgit,
pkg-config,
autoreconfHook,
autoconf,
automake,
libiconv,
libtool,
texinfo,
gettext,
gawk,
rapidjson,
gd,
libharu,
lmdb,
gmp,
glibcLocales,
mpfr,
more,
libpq,
hiredis,
expat,
tre,
}:
let
buildExtension = lib.makeOverridable (
{
name,
gawkextlib,
extraBuildInputs ? [ ],
doCheck ? true,
patches ? [ ],
extraPostPatch ? "",
env ? { },
broken ? null,
}:
let
is_extension = gawkextlib != null;
in
stdenv.mkDerivation rec {
pname = "gawkextlib-${name}";
version = "unstable-2022-10-20";
src = fetchgit {
url = "git://git.code.sf.net/p/gawkextlib/code";
rev = "f6c75b4ac1e0cd8d70c2f6c7a8d58b4d94cfde97";
sha256 = "sha256-0p3CrQ3TBl7UcveZytK/9rkAzn69RRM2GwY2eCeqlkg=";
};
inherit patches;
postPatch = ''
cd ${name}
''
+ extraPostPatch;
nativeBuildInputs = [
autoconf
automake
libtool
autoreconfHook
pkg-config
texinfo
gettext
];
buildInputs = [ gawk ] ++ extraBuildInputs;
propagatedBuildInputs = lib.optional is_extension gawkextlib;
setupHook = if is_extension then ./setup-hook.sh else null;
inherit gawk;
inherit env;
inherit doCheck;
nativeCheckInputs = [ more ];
meta = {
homepage = "https://sourceforge.net/projects/gawkextlib/";
description = "Dynamically loaded extension libraries for GNU AWK";
mainProgram = "xmlgawk";
longDescription = ''
The gawkextlib project provides several extension libraries for
gawk (GNU AWK), as well as libgawkextlib containing some APIs that
are useful for building gawk extension libraries. These libraries
enable gawk to process XML data, interact with a PostgreSQL
database, use the GD graphics library, and perform unlimited
precision MPFR calculations.
'';
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ tomberek ];
}
// lib.optionalAttrs (broken != null) { inherit broken; };
}
);
gawkextlib = buildExtension {
gawkextlib = null;
name = "lib";
};
libs = {
abort = buildExtension {
inherit gawkextlib;
name = "abort";
};
aregex = buildExtension {
inherit gawkextlib;
name = "aregex";
extraBuildInputs = [ tre ];
};
csv = buildExtension {
inherit gawkextlib;
name = "csv";
};
errno = buildExtension {
inherit gawkextlib;
name = "errno";
extraPostPatch = ''
substituteInPlace Makefile.am --replace-fail 'cpp -M' '${stdenv.cc.targetPrefix}cpp -M'
'';
};
gd = buildExtension {
inherit gawkextlib;
name = "gd";
extraBuildInputs = [ gd ];
# GCC 14 makes this an error by default, remove when fixed upstream
env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};
haru = buildExtension {
inherit gawkextlib;
name = "haru";
extraBuildInputs = [ libharu ];
patches = [
# Renames references to two identifiers with typos that libharu fixed in 2.4.4
# https://github.com/libharu/libharu/commit/88271b73c68c521a49a15e3555ef00395aa40810
./fix-typos-corrected-in-libharu-2.4.4.patch
];
# GCC 14 makes this an error by default, remove when fixed upstream
env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};
json = buildExtension {
inherit gawkextlib;
name = "json";
extraBuildInputs = [ rapidjson ];
};
lmdb = buildExtension {
inherit gawkextlib;
name = "lmdb";
extraPostPatch = ''
substituteInPlace Makefile.am --replace-fail 'cpp -M' '${stdenv.cc.targetPrefix}cpp -M'
'';
extraBuildInputs = [ lmdb ];
# mdb_env_open(env, /dev/null)
#! No such device
# mdb_env_open(env, /dev/null)
#! Operation not supported by device
doCheck = !stdenv.hostPlatform.isDarwin;
};
mbs = buildExtension {
inherit gawkextlib;
name = "mbs";
extraBuildInputs = [ glibcLocales ];
#! "spät": length: 5, mbs_length: 6, wcswidth: 4
doCheck = !stdenv.hostPlatform.isDarwin;
};
mpfr = buildExtension {
inherit gawkextlib;
name = "mpfr";
extraBuildInputs = [
gmp
mpfr
];
};
nl_langinfo = buildExtension {
inherit gawkextlib;
name = "nl_langinfo";
};
pgsql = buildExtension {
inherit gawkextlib;
name = "pgsql";
extraBuildInputs = [ libpq ];
};
redis = buildExtension {
inherit gawkextlib;
name = "redis";
extraBuildInputs = [ hiredis ];
};
select = buildExtension {
inherit gawkextlib;
name = "select";
extraPostPatch = ''
substituteInPlace Makefile.am --replace-fail 'cpp -M' '${stdenv.cc.targetPrefix}cpp -M'
'';
};
timex = buildExtension {
inherit gawkextlib;
name = "timex";
};
xml = buildExtension {
inherit gawkextlib;
name = "xml";
extraBuildInputs = [
expat
libiconv
];
# gawk: xmlbase:14: fatal: load_ext: cannot open library `../.libs/xml.so`
broken = !stdenv.buildPlatform.canExecute stdenv.hostPlatform;
};
};
in
recurseIntoAttrs (
libs
// {
inherit gawkextlib buildExtension;
full = builtins.attrValues libs;
}
)

View File

@@ -0,0 +1,6 @@
local oldOpts="-u"
shopt -qo nounset || oldOpts="+u"
set +u
. @gawk@/etc/profile.d/gawk.sh
gawklibpath_append @out@/lib/gawk
set "$oldOpts"

View File

@@ -0,0 +1,48 @@
{
mkDerivation,
lib,
stdenv,
fetchFromGitHub,
qmake,
boost,
}:
mkDerivation rec {
pname = "glogg";
version = "1.1.4";
src = fetchFromGitHub {
owner = "nickbnf";
repo = "glogg";
rev = "v${version}";
sha256 = "0hf1c2m8n88frmxmyn0ndr8129p7iky49nq565sw1asaydm5z6pb";
};
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace glogg.pro \
--replace "boost_program_options-mt" "boost_program_options"
'';
nativeBuildInputs = [ qmake ];
buildInputs = [ boost ];
qmakeFlags = [ "VERSION=${version}" ];
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/Applications
mv $out/bin/glogg.app $out/Applications/glogg.app
rm -fr $out/{bin,share}
'';
meta = with lib; {
description = "Fast, smart log explorer";
mainProgram = "glogg";
longDescription = ''
A multi-platform GUI application to browse and search through long or complex log files. It is designed with programmers and system administrators in mind. glogg can be seen as a graphical, interactive combination of grep and less.
'';
homepage = "https://glogg.bonnefon.org/";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ c0bw3b ];
};
}

View File

@@ -0,0 +1,122 @@
{
lib,
stdenv,
updateAutotoolsGnuConfigScriptsHook,
glibcLocales,
fetchurl,
pcre2,
libiconv,
perl,
runtimeShellPackage,
}:
# Note: this package is used for bootstrapping fetchurl, and thus
# cannot use fetchpatch! All mutable patches (generated by GitHub or
# cgit) that are needed here should be included directly in Nixpkgs as
# files.
let
version = "3.12";
in
stdenv.mkDerivation {
pname = "gnugrep";
inherit version;
src = fetchurl {
url = "mirror://gnu/grep/grep-${version}.tar.xz";
hash = "sha256-JkmyfA6Q5jLq3NdXvgbG6aT0jZQd5R58D4P/dkCKB7k=";
};
patches = [
# Fixes test-float-h failure on ppc64 with C23
# https://lists.gnu.org/archive/html/bug-gnulib/2025-07/msg00021.html
# Multiple upstream commits squashed with adjustments, see header
./gnulib-float-h-tests-port-to-C23-PowerPC-GCC.patch
];
# Some gnulib tests fail
# - on Musl: https://github.com/NixOS/nixpkgs/pull/228714
# - on x86_64-darwin: https://github.com/NixOS/nixpkgs/pull/228714#issuecomment-1576826330
postPatch =
if stdenv.hostPlatform.isMusl || (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) then
''
sed -i 's:gnulib-tests::g' Makefile.in
''
else
null;
nativeCheckInputs = [
perl
glibcLocales
];
outputs = [
"out"
"info"
]; # the man pages are rather small
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
buildInputs = [
pcre2
libiconv
]
++ lib.optional (!stdenv.hostPlatform.isWindows) runtimeShellPackage;
# cygwin: FAIL: multibyte-white-space
# freebsd: FAIL mb-non-UTF8-performance
# x86_64-darwin: fails 'stack-overflow' tests on Rosetta 2 emulator
# aarch32: fails 'stack-overflow' when run on qemu under x86_64
doCheck =
!stdenv.hostPlatform.isCygwin
&& !stdenv.hostPlatform.isFreeBSD
&& !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64)
&& !stdenv.buildPlatform.isRiscV64
&& !stdenv.hostPlatform.isAarch32;
# On macOS, force use of mkdir -p, since Grep's fallback
# (./install-sh) is broken.
preConfigure = ''
export MKDIR_P="mkdir -p"
'';
enableParallelBuilding = true;
# Fix reference to sh in bootstrap-tools, and invoke grep via
# absolute path rather than looking at argv[0].
postInstall = ''
rm $out/bin/egrep $out/bin/fgrep
echo "#! /bin/sh" > $out/bin/egrep
echo "exec $out/bin/grep -E \"\$@\"" >> $out/bin/egrep
echo "#! /bin/sh" > $out/bin/fgrep
echo "exec $out/bin/grep -F \"\$@\"" >> $out/bin/fgrep
chmod +x $out/bin/egrep $out/bin/fgrep
'';
env = lib.optionalAttrs stdenv.hostPlatform.isMinGW {
NIX_CFLAGS_COMPILE = "-Wno-error=format-security";
};
meta = with lib; {
homepage = "https://www.gnu.org/software/grep/";
description = "GNU implementation of the Unix grep command";
longDescription = ''
The grep command searches one or more input files for lines
containing a match to a specified pattern. By default, grep
prints the matching lines.
'';
license = licenses.gpl3Plus;
maintainers = [
maintainers.das_j
maintainers.m00wl
];
platforms = platforms.all;
mainProgram = "grep";
};
passthru = {
inherit pcre2;
};
}

View File

@@ -0,0 +1,230 @@
Applies the following incremental gnulib commits:
- 55a366a06fbd98bf13adc531579e3513cee97a32
- 65ed9d3b24ad09fd61d326c83e7f1b05f6e9d65f
- ce8e9de0bf34bc63dffc67ab384334c509175f64
- 6164b4cb0887b5331a4e64449107decd37d32735
With adjustments specific to the structure & differences in gnugrep:
- gnulib code is completely contained in gnulib-tests (flat, no separate lib directory)
- A Makefile.in is used for the test flags instead of the fancy automake modules
in the upstream gnulib project, so we add -lm to the float test there.
Surrounding texts in this file are slightly different in every project.
---
diff '--color=auto' -ruN a/gnulib-tests/float.c b/gnulib-tests/float.c
--- a/gnulib-tests/float.c 2025-01-02 03:33:12.000000000 +0100
+++ b/gnulib-tests/float.c 2025-07-09 06:45:05.176372632 +0200
@@ -23,7 +23,7 @@
#if GNULIB_defined_long_double_union
# if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
const union gl_long_double_union gl_LDBL_MAX =
- { { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
+ { { DBL_MAX, DBL_MAX / 0x1p53 } };
# elif defined __i386__
const union gl_long_double_union gl_LDBL_MAX =
{ { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
diff '--color=auto' -ruN a/gnulib-tests/float.in.h b/gnulib-tests/float.in.h
--- a/gnulib-tests/float.in.h 2025-01-02 03:33:12.000000000 +0100
+++ b/gnulib-tests/float.in.h 2025-07-09 06:44:02.203541534 +0200
@@ -113,44 +113,38 @@
# define LDBL_MAX_10_EXP 4932
#endif
-/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
- wrong.
- On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong. */
-#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+/* On PowerPC with gcc 15 when using __ibm128 long double, the value of
+ LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX, and LDBL_NORM_MAX are wrong. */
+#if ((defined _ARCH_PPC || defined _POWER) && LDBL_MANT_DIG == 106 \
+ && defined __GNUC__)
# undef LDBL_MIN_EXP
# define LDBL_MIN_EXP DBL_MIN_EXP
# undef LDBL_MIN_10_EXP
# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
# undef LDBL_MIN
# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
-#endif
-#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
# undef LDBL_MAX
-/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
- It is not easy to define:
- #define LDBL_MAX 1.79769313486231580793728971405302307166e308L
- is too small, whereas
- #define LDBL_MAX 1.79769313486231580793728971405302307167e308L
- is too large. Apparently a bug in GCC decimal-to-binary conversion.
- Also, I can't get values larger than
- #define LDBL63 ((long double) (1ULL << 63))
- #define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
- #define LDBL945 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
- #define LDBL1008 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
- #define LDBL_MAX (LDBL1008 * 65535.0L + LDBL945 * (long double) 9223372036821221375ULL + LDBL882 * (long double) 4611686018427387904ULL)
- which is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xF8000000 }.
- So, define it like this through a reference to an external variable
+/* LDBL_MAX is 2**1024 - 2**918, represented as: { 0x7FEFFFFF, 0xFFFFFFFF,
+ 0x7C9FFFFF, 0xFFFFFFFF }.
+
+ Do not write it as a constant expression, as GCC would likely treat
+ that as infinity due to the vagaries of this platform's funky arithmetic.
+ Instead, define it through a reference to an external variable.
+ Like the following, but using a union to avoid type mismatches:
- const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL };
+ const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / 0x1p53 };
extern const long double LDBL_MAX;
- or through a pointer cast
+ The following alternative would not work as well when GCC is optimizing:
+
+ #define LDBL_MAX (*(long double const *) (double[])
+ { DBL_MAX, DBL_MAX / 0x1p53 })
- #define LDBL_MAX \
- (*(const long double *) (double[]) { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL })
+ The following alternative would require GCC 6 or later:
- Unfortunately, this is not a constant expression, and the latter expression
- does not work well when GCC is optimizing.. */
+ #define LDBL_MAX __builtin_pack_longdouble (DBL_MAX, DBL_MAX / 0x1p53)
+
+ Unfortunately none of the alternatives are constant expressions. */
# if !GNULIB_defined_long_double_union
union gl_long_double_union
{
@@ -161,6 +155,8 @@
# endif
extern const union gl_long_double_union gl_LDBL_MAX;
# define LDBL_MAX (gl_LDBL_MAX.ld)
+# undef LDBL_NORM_MAX
+# define LDBL_NORM_MAX LDBL_MAX
#endif
/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong.
@@ -181,6 +177,21 @@
# endif
#endif
+/* On PowerPC platforms, 'long double' has a double-double representation.
+ Up to ISO C 17, this was outside the scope of ISO C because it can represent
+ numbers with mantissas of the form 1.<52 bits><many zeroes><52 bits>, such as
+ 1.0L + 4.94065645841246544176568792868221e-324L = 1 + 2^-1074; see
+ ISO C 17 § 5.2.4.2.2.(3).
+ In ISO C 23, wording has been included that makes this 'long double'
+ representation compliant; see ISO C 23 § 5.2.5.3.3.(8)-(9). In this setting,
+ numbers with mantissas of the form 1.<52 bits><many zeroes><52 bits> are
+ called "unnormalized". And since LDBL_EPSILON must be normalized (per
+ ISO C 23 § 5.2.5.3.3.(33)), it must be 2^-105. */
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */
+#endif
+
/* ============================ ISO C11 support ============================ */
/* 'float' properties */
@@ -309,7 +320,11 @@
# endif
#endif
#ifndef LDBL_NORM_MAX
-# define LDBL_NORM_MAX LDBL_MAX
+# ifdef __LDBL_NORM_MAX__
+# define LDBL_NORM_MAX __LDBL_NORM_MAX__
+# else
+# define LDBL_NORM_MAX LDBL_MAX
+# endif
#endif
#ifndef LDBL_SNAN
/* For sh, beware of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111814>. */
diff '--color=auto' -ruN a/gnulib-tests/Makefile.in b/gnulib-tests/Makefile.in
--- a/gnulib-tests/Makefile.in 2025-04-10 17:51:23.000000000 +0200
+++ b/gnulib-tests/Makefile.in 2025-07-09 06:35:48.276939180 +0200
@@ -1056,7 +1056,7 @@
../lib/libgreputils.a libtests.a $(am__DEPENDENCIES_1)
test_float_h_SOURCES = test-float-h.c
test_float_h_OBJECTS = test-float-h.$(OBJEXT)
-test_float_h_LDADD = $(LDADD)
+test_float_h_LDADD = $(LDADD) -lm
test_float_h_DEPENDENCIES = libtests.a ../lib/libgreputils.a \
libtests.a ../lib/libgreputils.a libtests.a \
$(am__DEPENDENCIES_1)
diff '--color=auto' -ruN a/gnulib-tests/test-float-h.c b/gnulib-tests/test-float-h.c
--- a/gnulib-tests/test-float-h.c 2025-01-02 03:33:12.000000000 +0100
+++ b/gnulib-tests/test-float-h.c 2025-07-09 06:54:02.794407115 +0200
@@ -101,6 +101,8 @@
/* ------------------------------------------------------------------------- */
+#include <math.h>
+
#include "fpucw.h"
#include "isnanf-nolibm.h"
#include "isnand-nolibm.h"
@@ -396,6 +398,44 @@
/* -------------------- Check macros for 'long double' -------------------- */
+static int
+test_isfinitel (long double volatile x)
+{
+ if (x != x)
+ return 0;
+ long double volatile zero = x * 0;
+ return zero == 0;
+}
+
+/* Return X after normalization. This makes a difference on platforms
+ where long double can represent unnormalized values. For example,
+ suppose x = 1 + 2**-106 on PowerPC with IBM long double where
+ FLT_RADIX = 2, LDBL_MANT_DIG = 106, and LDBL_EPSILON = 2**-105.
+ Then 1 < x < 1 + LDBL_EPSILON, and normalize_long_double (x) returns 1. */
+static long double
+normalize_long_double (long double volatile x)
+{
+ if (FLT_RADIX == 2 && test_isfinitel (x))
+ {
+ int xexp;
+ long double volatile
+ frac = frexpl (x, &xexp),
+ significand = frac * pow2l (LDBL_MANT_DIG),
+ normalized_significand = truncl (significand),
+ normalized_x = normalized_significand * pow2l (xexp - LDBL_MANT_DIG);
+
+ /* The test_isfinitel defends against PowerPC with IBM long double,
+ which fritzes out near LDBL_MAX. */
+ if (test_isfinitel (normalized_x))
+ x = normalized_x;
+ }
+ else
+ {
+ /* Hope that X is already normalized. */
+ }
+ return x;
+}
+
static void
test_long_double (void)
{
@@ -455,7 +495,7 @@
for (n = 0; n <= 2 * LDBL_MANT_DIG; n++)
{
volatile long double half_n = pow2l (- n); /* 2^-n */
- volatile long double x = me - half_n;
+ volatile long double x = normalize_long_double (me - half_n);
if (x < me)
ASSERT (x <= 1.0L);
}
@@ -483,8 +523,12 @@
ASSERT (!LDBL_IS_IEC_60559);
#endif
+ printf("LDBL_NORM_MAX: %LF\n", LDBL_NORM_MAX);
+ printf("LDBL_MAX: %LF\n", LDBL_MAX);
+ printf("normalize_long_double(LDBL_MAX): %LF\n", normalize_long_double(LDBL_MAX));
+
/* Check the value of LDBL_NORM_MAX. */
- ASSERT (LDBL_NORM_MAX == LDBL_MAX);
+ ASSERT (LDBL_NORM_MAX == normalize_long_double (LDBL_MAX));
/* Check the value of LDBL_SNAN. */
ASSERT (isnanl (LDBL_SNAN));

View File

@@ -0,0 +1,49 @@
{
lib,
stdenv,
fetchurl,
ed,
autoreconfHook,
}:
stdenv.mkDerivation rec {
pname = "patch";
version = "2.8";
src = fetchurl {
url = "mirror://gnu/patch/patch-${version}.tar.xz";
hash = "sha256-+Hzuae7CtPy/YKOWsDCtaqNBXxkqpffuhMrV4R9/WuM=";
};
# This test is filesystem-dependent - observed failing on ZFS
postPatch = lib.optionalString stdenv.hostPlatform.isFreeBSD ''
sed -E -i -e '/bad-filenames/d' tests/Makefile.am
'';
nativeBuildInputs = [ autoreconfHook ];
configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"ac_cv_func_strnlen_working=yes"
];
doCheck = stdenv.hostPlatform.libc != "musl"; # not cross;
nativeCheckInputs = [ ed ];
meta = {
description = "GNU Patch, a program to apply differences to files";
mainProgram = "patch";
longDescription = ''
GNU Patch takes a patch file containing a difference listing
produced by the diff program and applies those differences to one or
more original files, producing patched versions.
'';
homepage = "https://savannah.gnu.org/projects/patch";
license = lib.licenses.gpl3Plus;
maintainers = [ ];
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchurl,
updateAutotoolsGnuConfigScriptsHook,
perl,
}:
stdenv.mkDerivation rec {
pname = "gnused";
version = "4.9";
src = fetchurl {
url = "mirror://gnu/sed/sed-${version}.tar.xz";
sha256 = "sha256-biJrcy4c1zlGStaGK9Ghq6QteYKSLaelNRljHSSXUYE=";
};
outputs = [
"out"
"info"
];
nativeBuildInputs = [
updateAutotoolsGnuConfigScriptsHook
perl
];
preConfigure = "patchShebangs ./build-aux/help2man";
# Prevents attempts of running 'help2man' on cross-built binaries.
PERL = if stdenv.hostPlatform == stdenv.buildPlatform then null else "missing";
meta = {
homepage = "https://www.gnu.org/software/sed/";
description = "GNU sed, a batch stream editor";
longDescription = ''
Sed (stream editor) isn't really a true text editor or text
processor. Instead, it is used to filter text, i.e., it takes
text input and performs some operation (or set of operations) on
it and outputs the modified text. Sed is typically used for
extracting part of a file using pattern matching or substituting
multiple occurrences of a string within a file.
'';
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ mic92 ];
mainProgram = "sed";
};
}

View File

@@ -0,0 +1,84 @@
{
lib,
stdenv,
fetchFromGitLab,
getopt,
lua,
boost,
libxcrypt,
pkg-config,
swig,
perl,
gcc,
}:
let
self = stdenv.mkDerivation rec {
pname = "highlight";
version = "4.16";
src = fetchFromGitLab {
owner = "saalen";
repo = "highlight";
rev = "v${version}";
hash = "sha256-SAOlW2IaYY2GzQ+1FClqm62pcxdtf1cow2R4MRS/2Vg=";
};
enableParallelBuilding = true;
nativeBuildInputs = [
pkg-config
swig
perl
]
++ lib.optional stdenv.hostPlatform.isDarwin gcc;
buildInputs = [
getopt
lua
boost
libxcrypt
];
postPatch = ''
substituteInPlace src/makefile \
--replace "shell pkg-config" "shell $PKG_CONFIG"
substituteInPlace makefile \
--replace 'gzip' 'gzip -n'
''
+ lib.optionalString stdenv.cc.isClang ''
substituteInPlace src/makefile \
--replace 'CXX=g++' 'CXX=clang++'
'';
preConfigure = ''
makeFlags="PREFIX=$out conf_dir=$out/etc/highlight/ CXX=$CXX AR=$AR"
'';
# This has to happen _before_ the main build because it does a
# `make clean' for some reason.
preBuild = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
make -C extras/swig $makeFlags perl
'';
postCheck = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
perl -Iextras/swig extras/swig/testmod.pl
'';
preInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
mkdir -p $out/${perl.libPrefix}
install -m644 extras/swig/highlight.{so,pm} $out/${perl.libPrefix}
make -C extras/swig clean # Clean up intermediate files.
'';
meta = with lib; {
description = "Source code highlighting tool";
mainProgram = "highlight";
homepage = "http://www.andre-simon.de/doku/highlight/en/highlight.php";
platforms = platforms.unix;
maintainers = [ ];
};
};
in
if stdenv.hostPlatform.isDarwin then self else perl.pkgs.toPerlModule self

View File

@@ -0,0 +1,74 @@
{
lib,
curl,
stdenv,
fetchFromGitHub,
rustPlatform,
pkg-config,
asciidoctor,
openssl,
ansi2html,
installShellFiles,
}:
rustPlatform.buildRustPackage rec {
pname = "mdcat";
version = "2.7.1";
src = fetchFromGitHub {
owner = "swsnr";
repo = "mdcat";
rev = "mdcat-${version}";
hash = "sha256-j6BFXx5cyjE3+fo1gGKlqpsxrm3i9HfQ9tJGNNjjLwo=";
};
patches = [
./fix-clippy.diff
];
nativeBuildInputs = [
pkg-config
asciidoctor
installShellFiles
];
buildInputs = [
curl
openssl
];
cargoHash = "sha256-8A0RLbFkh3fruZAbjJzipQvuFLchqIRovPcc6MSKdOc=";
nativeCheckInputs = [ ansi2html ];
# Skip tests that use the network and that include files.
checkFlags = [
"--skip magic::tests::detect_mimetype_of_larger_than_magic_param_bytes_max_length"
"--skip magic::tests::detect_mimetype_of_magic_param_bytes_max_length"
"--skip magic::tests::detect_mimetype_of_png_image"
"--skip magic::tests::detect_mimetype_of_svg_image"
"--skip resources::tests::read_url_with_http_url_fails_when_size_limit_is_exceeded"
"--skip resources::tests::read_url_with_http_url_fails_when_status_404"
"--skip resources::tests::read_url_with_http_url_returns_content_when_status_200"
"--skip iterm2_tests_render_md_samples_images_md"
];
postInstall = ''
installManPage $releaseDir/build/mdcat-*/out/mdcat.1
ln -sr $out/bin/{mdcat,mdless}
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for bin in mdcat mdless; do
installShellCompletion --cmd $bin \
--bash <($out/bin/$bin --completions bash) \
--fish <($out/bin/$bin --completions fish) \
--zsh <($out/bin/$bin --completions zsh)
done
'';
meta = with lib; {
description = "cat for markdown";
homepage = "https://github.com/swsnr/mdcat";
changelog = "https://github.com/swsnr/mdcat/releases/tag/mdcat-${version}";
license = with licenses; [ mpl20 ];
maintainers = with maintainers; [ SuperSandro2000 ];
};
}

View File

@@ -0,0 +1,14 @@
diff --git a/pulldown-cmark-mdcat/src/terminal/osc.rs b/pulldown-cmark-mdcat/src/terminal/osc.rs
index 8fa2db6..dc2a2da 100644
--- a/pulldown-cmark-mdcat/src/terminal/osc.rs
+++ b/pulldown-cmark-mdcat/src/terminal/osc.rs
@@ -20,9 +20,6 @@ pub fn write_osc<W: Write + ?Sized>(writer: &mut W, command: &str) -> Result<()>
Ok(())
}
-#[derive(Debug, PartialEq, Eq, Copy, Clone)]
-pub struct Osc8Links;
-
/// Whether the given `url` needs to get an explicit host.
///
/// [OSC 8] links require that `file://` URLs give an explicit hostname, as

View File

@@ -0,0 +1,23 @@
{ fetchurl, libiconv }:
finalAttrs: {
version = "0.996";
src = fetchurl {
url = "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE";
name = "mecab-${finalAttrs.version}.tar.gz";
hash = "sha256-4HMyV4MTW3LmZhRceBu0j62lg9UiT7JJD7bBQDumnFk=";
};
buildInputs = [ libiconv ];
configureFlags = [
"--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;
}

View File

@@ -0,0 +1,34 @@
{
lib,
stdenv,
fetchurl,
mecab-ipadic,
libiconv,
}:
let
mecab-base = import ./base.nix { inherit fetchurl libiconv; };
in
stdenv.mkDerivation (
finalAttrs:
(
(mecab-base finalAttrs)
// {
pname = "mecab";
postInstall = ''
mkdir -p $out/lib/mecab/dic
ln -s ${mecab-ipadic} $out/lib/mecab/dic/ipadic
'';
meta = with lib; {
description = "Japanese morphological analysis system";
homepage = "http://taku910.github.io/mecab";
license = licenses.bsd3;
platforms = platforms.unix;
mainProgram = "mecab";
maintainers = with maintainers; [ auntie ];
};
}
)
)

View File

@@ -0,0 +1,31 @@
{
lib,
stdenv,
fetchurl,
mecab-nodic,
buildPackages,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mecab-ipadic";
version = "2.7.0-20070801";
src = fetchurl {
url = "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7MWVlSDBCSXZMTXM";
name = "mecab-ipadic-${finalAttrs.version}.tar.gz";
hash = "sha256-ti9SfYgcUEV2uu2cbvZWFVRlixdc5q4AlqYDB+SeNSM=";
};
buildInputs = [ mecab-nodic ];
configureFlags = [
"--with-charset=utf8"
"--with-dicdir=${placeholder "out"}"
]
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
"--with-mecab-config=${lib.getExe' buildPackages.mecab "mecab-config"}"
]
++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
"--with-mecab-config=${lib.getExe' (lib.getDev mecab-nodic) "mecab-config"}"
];
})

View File

@@ -0,0 +1,18 @@
{
stdenv,
fetchurl,
libiconv,
}:
let
mecab-base = import ./base.nix { inherit fetchurl libiconv; };
in
stdenv.mkDerivation (
finalAttrs:
(
(mecab-base finalAttrs)
// {
pname = "mecab-nodic";
}
)
)

View File

@@ -0,0 +1,27 @@
{
lib,
pythonPackages,
fetchurl,
}:
pythonPackages.buildPythonApplication rec {
pname = "mir.qualia";
version = "2.0.0";
format = "setuptools";
doCheck = false; # 2.0.0-released pytests are broken
buildInputs = with pythonPackages; [ pytest ];
src = fetchurl {
url = "mirror://pypi/m/mir.qualia/mir.qualia-${version}.tar.gz";
sha256 = "1ybq6jb5clh9hw0sp3idp4hjv2gkm9yiaph48gcc208affflc8m9";
};
meta = {
description = "Dynamically enable sections of config files";
mainProgram = "qualia";
homepage = "https://github.com/darkfeline/mir.qualia";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.srhb ];
};
}

View File

@@ -0,0 +1,31 @@
{
lib,
stdenv,
fetchurl,
}:
# This package requires a locale ru_RU.cp1251 locale entry.
# Waiting for a better idea, I created it modifying a store file using:
# localedef -f CP1251 -i ru_RU ru_RU.CP1251
# The store file mentioned is in "${glibc.out}/lib/locale/locale-archive"
stdenv.mkDerivation {
pname = "multitran-data";
version = "0.3";
src = fetchurl {
url = "mirror://sourceforge/multitran/multitran-data.tar.bz2";
sha256 = "9c2ff5027c2fe72b0cdf056311cd7543f447feb02b455982f20d4a3966b7828c";
};
patchPhase = ''
sed -i -e 's@\$(DESTDIR)/usr@'$out'@' Makefile
'';
meta = {
homepage = "https://multitran.sourceforge.net/";
description = "Multitran data english-russian";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "libbtree";
version = "0.0.1alpha2";
src = fetchurl {
url = "mirror://sourceforge/multitran/libbtree-${version}.tar.bz2";
sha256 = "34a584e45058950337ff9342693b6739b52c3ce17e66440526c4bd6f9575802c";
};
patchPhase = ''
sed -i -e 's@\$(DESTDIR)/usr@'$out'@' src/Makefile;
'';
meta = {
homepage = "https://multitran.sourceforge.net/";
description = "Multitran lib: library for reading Multitran's BTREE database format";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,31 @@
{
lib,
stdenv,
fetchurl,
libmtsupport,
}:
stdenv.mkDerivation rec {
pname = "libfacet";
version = "0.0.1alpha2";
src = fetchurl {
url = "mirror://sourceforge/multitran/libfacet-${version}.tar.bz2";
sha256 = "dc53351c4035a3c27dc6c1d0410e808346fbc107e7e7c112ec65c59d0df7a144";
};
buildInputs = [ libmtsupport ];
patchPhase = ''
sed -i -e 's@\$(DESTDIR)/usr@'$out'@' \
-e 's@/usr/include/mt/support@${libmtsupport}/include/mt/support@' \
src/Makefile;
'';
meta = {
homepage = "https://multitran.sourceforge.net/";
description = "Multitran lib: enchanced locale facets";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchurl,
libmtsupport,
libfacet,
libbtree,
multitrandata,
}:
stdenv.mkDerivation rec {
pname = "libmtquery";
version = "0.0.1alpha3";
src = fetchurl {
url = "mirror://sourceforge/multitran/libmtquery-${version}.tar.bz2";
sha256 = "e24c7c15772445f1b14871928d84dd03cf93bd88f9d2b2ed1bf0257c2cf2b15e";
};
buildInputs = [
libmtsupport
libfacet
libbtree
multitrandata
];
NIX_LDFLAGS = "-lbtree";
patchPhase = ''
sed -i -e 's@\$(DESTDIR)/usr@'$out'@' \
-e 's@/usr/include/mt/support@${libmtsupport}/include/mt/support@' \
-e 's@/usr/include/btree@${libbtree}/include/btree@' \
-e 's@/usr/include/facet@${libfacet}/include/facet@' \
src/Makefile testsuite/Makefile;
sed -i -e 's@/usr/share/multitran@${multitrandata}/share/multitran@' src/config.cc
'';
meta = {
homepage = "https://multitran.sourceforge.net/";
description = "Multitran lib: main engine to query translations";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "libmtsupport";
version = "0.0.1alpha2";
src = fetchurl {
url = "mirror://sourceforge/multitran/libmtsupport-${version}.tar.bz2";
sha256 = "481f0f1ec15d7274f1e4eb93e7d060df10a181efd037eeff5e8056d283a9298b";
};
patchPhase = ''
sed -i -e 's@\$(DESTDIR)/usr@'$out'@' src/Makefile;
'';
meta = {
homepage = "https://multitran.sourceforge.net/";
description = "Multitran lib: basic useful functions";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,50 @@
{
lib,
stdenv,
fetchurl,
libmtsupport,
libfacet,
libbtree,
libmtquery,
help2man,
}:
stdenv.mkDerivation rec {
pname = "mt-utils";
version = "0.0.1alpha3";
src = fetchurl {
url = "mirror://sourceforge/multitran/mt-utils-${version}.tar.bz2";
sha256 = "e407702c90c5272882386914e1eeca5f6c5039393af9a44538536b94867b0a0e";
};
buildInputs = [
libmtsupport
libfacet
libbtree
libmtquery
help2man
];
patchPhase = ''
sed -i -e 's@\$(DESTDIR)/usr@'$out'@' \
-e 's@/usr/include/mt/support@${libmtsupport}/include/mt/support@' \
-e 's@/usr/include/btree@${libbtree}/include/btree@' \
-e 's@/usr/include/facet@${libfacet}/include/facet@' \
-e 's@/usr/include/mt/query@${libmtquery}/include/mt/query@' \
-e 's@-lmtquery@-lmtquery -lmtsupport -lfacet@' \
src/Makefile;
# Fixing multibyte locale output
sed -i -e 's@message.length()@message.length()*5@' \
src/converter.cc;
'';
meta = {
homepage = "https://multitran.sourceforge.net/";
description = "Multitran: simple command line utilities for dictionary maintenance";
mainProgram = "mtquery";
license = lib.licenses.gpl2Only;
maintainers = [ ];
platforms = with lib.platforms; linux;
};
}

View File

@@ -0,0 +1,265 @@
{
lib,
newScope,
fetchFromGitHub,
unzip,
stdenvNoCC,
}:
let
base = {
version = "0-unstable-2024-07-29";
nativeBuildInputs = [ unzip ];
dontBuild = true;
dontFixup = true;
meta = with lib; {
description = "NLTK Data";
homepage = "https://github.com/nltk/nltk_data";
license = licenses.asl20;
platforms = platforms.all;
maintainers = with maintainers; [
bengsparks
happysalada
];
};
};
makeNltkDataPackage =
{
pname,
location,
hash,
}:
let
src = fetchFromGitHub {
owner = "nltk";
repo = "nltk_data";
rev = "cfe82914f3c2d24363687f1db3b05e8b9f687e2b";
inherit hash;
sparseCheckout = [ "packages/${location}/${pname}.zip" ];
};
in
stdenvNoCC.mkDerivation (
base
// {
inherit pname src;
inherit (base) version;
installPhase = ''
runHook preInstall
mkdir -p $out
unzip ${src}/packages/${location}/${pname}.zip
mkdir -p $out/${location}
cp -R ${pname}/ $out/${location}
runHook postInstall
'';
}
);
makeChunker =
pname:
makeNltkDataPackage {
inherit pname;
location = "chunkers";
hash = "sha256-kemjqaCM9hlKAdMw8oVJnp62EAC9rMQ50dKg7wlAwEc=";
};
makeCorpus =
pname:
makeNltkDataPackage {
inherit pname;
location = "corpora";
hash = "sha256-8lMjW5YI8h6dHJ/83HVY2OYGDyKPpgkUAKPISiAKqqk=";
};
makeGrammar =
pname:
makeNltkDataPackage {
inherit pname;
location = "grammars";
hash = "sha256-pyLEcX3Azv8j1kCGvVYonuiNgVJxtWt7veU0S/yNbIM=";
};
makeHelp =
pname:
makeNltkDataPackage {
inherit pname;
location = "help";
hash = "sha256-97mYLNES5WujLF5gD8Ul4cJ6LqSzz+jDzclUsdBeHNE=";
};
makeMisc =
pname:
makeNltkDataPackage {
inherit pname;
location = "misc";
hash = "sha256-XtizfEsc8TYWqvvC/eSFdha2ClC5/ZiJM8nue0vXLb4=";
};
makeModel =
pname:
makeNltkDataPackage {
inherit pname;
location = "models";
hash = "sha256-iq3weEgCci6rgLW2j28F2eRLprJtInGXKe/awJPSVG4=";
};
makeTagger =
pname:
makeNltkDataPackage {
inherit pname;
location = "taggers";
hash = "sha256-tl3Cn2okhBkUtTXvAmFRx72Brez6iTGRdmFTwFmpk3M=";
};
makeTokenizer =
pname:
makeNltkDataPackage {
inherit pname;
location = "tokenizers";
hash = "sha256-OzMkruoYbFKqzuimOXIpE5lhHz8tmSqOFoLT+fjdTVg=";
};
makeStemmer =
pname:
makeNltkDataPackage {
inherit pname;
location = "stemmers";
hash = "sha256-mNefwOPVJGz9kXV3LV4DuV7FJpNir/Nwg4ujd0CogEk=";
};
in
lib.makeScope newScope (self: {
## Chunkers
maxent-ne-chunker = makeChunker "maxent_ne_chunker";
maxent-ne-chunker-tab = makeChunker "maxent_ne_chunker_tab";
## Corpora
abc = makeCorpus "abc";
alpino = makeCorpus "alpino";
bcp47 = makeCorpus "bcp47";
biocreative-ppi = makeCorpus "biocreative_ppi";
brown = makeCorpus "brown";
brown-tei = makeCorpus "brown_tei";
cess-cat = makeCorpus "cess_cat";
cess-esp = makeCorpus "cess_esp";
chat80 = makeCorpus "chat80";
city-database = makeCorpus "city_database";
cmudict = makeCorpus "cmudict";
comparative-sentences = makeCorpus "comparative_sentences";
comtrans = makeCorpus "comtrans";
conll2000 = makeCorpus "conll2000";
conll2002 = makeCorpus "conll2002";
conll2007 = makeCorpus "conll2007";
crubadan = makeCorpus "crubadan";
dependency-treebank = makeCorpus "dependency_treebank";
dolch = makeCorpus "dolch";
europarl-raw = makeCorpus "europarl_raw";
extended-omw = makeCorpus "extended_omw";
floresta = makeCorpus "floresta";
framenet-v15 = makeCorpus "framenet_v15";
framenet-v17 = makeCorpus "framenet_v17";
gazetteers = makeCorpus "gazetteers";
genesis = makeCorpus "genesis";
gutenberg = makeCorpus "gutenberg";
ieer = makeCorpus "ieer";
inaugural = makeCorpus "inaugural";
indian = makeCorpus "indian";
jeita = makeCorpus "jeita";
kimmo = makeCorpus "kimmo";
knbc = makeCorpus "knbc";
lin-thesaurus = makeCorpus "lin_thesaurus";
mac-morpho = makeCorpus "mac_morpho";
machado = makeCorpus "machado";
masc-tagged = makeCorpus "masc_tagged";
movie-reviews = makeCorpus "movie_reviews";
mte-teip5 = makeCorpus "mte_teip5";
names = makeCorpus "names";
nombank-1-0 = makeCorpus "nombank.1.0";
nonbreaking-prefixes = makeCorpus "nonbreaking_prefixes";
nps-chat = makeCorpus "nps_chat";
omw = makeCorpus "omw";
omw-1-4 = makeCorpus "omw-1.4";
opinion-lexicon = makeCorpus "opinion_lexicon";
panlex-swadesh = makeCorpus "panlex_swadesh";
paradigms = makeCorpus "paradigms";
pe08 = makeCorpus "pe08";
pil = makeCorpus "pil";
pl196x = makeCorpus "pl196x";
ppattach = makeCorpus "ppattach";
problem-reports = makeCorpus "problem_reports";
product-reviews-1 = makeCorpus "product_reviews_1";
product-reviews-2 = makeCorpus "product_reviews_2";
propbank = makeCorpus "propbank";
pros-cons = makeCorpus "pros_cons";
ptb = makeCorpus "ptb";
qc = makeCorpus "qc";
reuters = makeCorpus "reuters";
rte = makeCorpus "rte";
semcor = makeCorpus "semcor";
senseval = makeCorpus "senseval";
sentence-polarity = makeCorpus "sentence_polarity";
sentiwordnet = makeCorpus "sentiwordnet";
shakespeare = makeCorpus "shakespeare";
sinica-treebank = makeCorpus "sinica_treebank";
smultron = makeCorpus "smultron";
state-union = makeCorpus "state_union";
stopwords = makeCorpus "stopwords";
subjectivity = makeCorpus "subjectivity";
swadesh = makeCorpus "swadesh";
switchboard = makeCorpus "switchboard";
timit = makeCorpus "timit";
toolbox = makeCorpus "toolbox";
treebank = makeCorpus "treebank";
twitter-samples = makeCorpus "twitter_samples";
udhr = makeCorpus "udhr";
udhr2 = makeCorpus "udhr2";
unicode-samples = makeCorpus "unicode_samples";
universal-treebanks-v20 = makeCorpus "universal_treebanks_v20";
verbnet = makeCorpus "verbnet";
verbnet3 = makeCorpus "verbnet3";
webtext = makeCorpus "webtext";
wordnet = makeCorpus "wordnet";
wordnet-ic = makeCorpus "wordnet_ic";
wordnet2021 = makeCorpus "wordnet2021";
wordnet2022 = makeCorpus "wordnet2022";
wordnet31 = makeCorpus "wordnet31";
words = makeCorpus "words";
ycoe = makeCorpus "ycoe";
## Grammars
basque-grammars = makeGrammar "basque_grammars";
book-grammars = makeGrammar "book_grammars";
large-grammars = makeGrammar "large_grammars";
sample-grammars = makeGrammar "sample_grammars";
spanish-grammars = makeGrammar "spanish_grammars";
## Help
tagsets-json = makeHelp "tagsets_json";
## Misc
mwa-ppdb = makeMisc "mwa_ppdb";
perluniprops = makeMisc "perluniprops";
## Models
bllip-wsj-no-aux = makeModel "bllip_wsj_no_aux";
moses-sample = makeModel "moses_sample";
wmt15-eval = makeModel "wmt15_eval";
word2vec-sample = makeModel "word2vec_sample";
## Taggers
averaged-perceptron-tagger = makeTagger "averaged_perceptron_tagger";
averaged-perceptron-tagger-eng = makeTagger "averaged_perceptron_tagger_eng";
averaged-perceptron-tagger-ru = makeTagger "averaged_perceptron_tagger_ru";
averaged-perceptron-tagger-rus = makeTagger "averaged_perceptron_tagger_rus";
maxent-treebank-pos-tagger = makeTagger "maxent_treebank_pos_tagger";
maxent-treebank-pos-tagger-tab = makeTagger "maxent_treebank_pos_tagger_tab";
universal-tagset = makeTagger "universal_tagset";
## Tokenizers
punkt = makeTokenizer "punkt";
punkt-tab = makeTokenizer "punkt_tab";
## Stemmers
porter-test = makeStemmer "porter_test";
rslp = makeStemmer "rslp";
snowball-data = makeStemmer "snowball_data";
})

View File

@@ -0,0 +1,10 @@
{ callPackage, ... }@args:
callPackage ./generic.nix (
args
// {
version = "0.3.3";
sha256 = "0g5df00cj4nczrmr4k791l7la0sq2wnf8rn981fsrz1f3d2yix4i";
patches = [ ./drop-comments.patch ]; # we would get into a cycle when using fetchpatch on this one
}
)

View File

@@ -0,0 +1,12 @@
{ callPackage, python3, ... }@args:
callPackage ./generic.nix (
args
// {
version = "0.4.2";
sha256 = "sha256-iHWwll/jPeYriQ9s15O+f6/kGk5VLtv2QfH+1eu/Re0=";
# for gitdiff
extraBuildInputs = [ python3 ];
patches = [ ./Make-grepdiff1-test-case-pcre-aware.patch ];
}
)

View File

@@ -0,0 +1,36 @@
From 1208a632aaeca43f3846116197d645394fbae45d Mon Sep 17 00:00:00 2001
From: Tim Waugh <twaugh@redhat.com>
Date: Wed, 27 Aug 2025 09:36:01 +0100
Subject: [PATCH] Make grepdiff1 test-case pcre-aware
The test case needs a different pattern when configured with/without pcre2.
Fixed: #61
Assisted-by: Cursor
---
tests/grepdiff1/run-test | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tests/grepdiff1/run-test b/tests/grepdiff1/run-test
index c4311f8..ebb6023 100755
--- a/tests/grepdiff1/run-test
+++ b/tests/grepdiff1/run-test
@@ -20,7 +20,16 @@ cat << EOF > diff
+b
EOF
-${GREPDIFF} '\+a' diff 2>errors >index || exit 1
+# Check if PCRE2 is being used by examining the help output
+if ${GREPDIFF} --help 2>&1 | grep -q "PCRE regexes are used by default"; then
+ # PCRE2 is enabled - need to escape the plus sign
+ PATTERN='\+a'
+else
+ # Standard regex - plus sign doesn't need escaping
+ PATTERN='+a'
+fi
+
+${GREPDIFF} "$PATTERN" diff 2>errors >index || exit 1
[ -s errors ] && exit 1
cat << EOF | cmp - index || exit 1

View File

@@ -0,0 +1,9 @@
{ callPackage, ... }@args:
callPackage ./generic.nix (
args
// {
version = "0.3.4";
sha256 = "0xp8mcfyi5nmb5a2zi5ibmyshxkb1zv1dgmnyn413m7ahgdx8mfg";
}
)

View File

@@ -0,0 +1,84 @@
From 58987954647f51dc42fb13b7759923c6170dd905 Mon Sep 17 00:00:00 2001
From: Tim Waugh <twaugh@redhat.com>
Date: Fri, 9 May 2014 16:23:27 +0100
Subject: Make --clean drop comments after '@@' lines as well (trac #29).
diff --git a/Makefile.am b/Makefile.am
index 99ad2a3..f3c6dbc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -198,6 +198,7 @@ TESTS = tests/newline1/run-test \
tests/convert1/run-test \
tests/convert2/run-test \
tests/clean1/run-test \
+ tests/clean2/run-test \
tests/stdin/run-test
# These ones don't work yet.
diff --git a/src/filterdiff.c b/src/filterdiff.c
index 383e72b..6ca2316 100644
--- a/src/filterdiff.c
+++ b/src/filterdiff.c
@@ -2,7 +2,7 @@
* filterdiff - extract (or exclude) a diff from a diff file
* lsdiff - show which files are modified by a patch
* grepdiff - show files modified by a patch containing a regexp
- * Copyright (C) 2001, 2002, 2003, 2004, 2008, 2009, 2011 Tim Waugh <twaugh@redhat.com>
+ * Copyright (C) 2001, 2002, 2003, 2004, 2008, 2009, 2011, 2013, 2014 Tim Waugh <twaugh@redhat.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -408,7 +408,8 @@ do_unified (FILE *f, char *header[2], int match, char **line,
" Hunk #%lu, %s",
hunknum, bestname);
- fputs (trailing, output_to);
+ fputs (clean_comments ? "\n" : trailing,
+ output_to);
break;
case Before:
// Note the initial line number
diff --git a/tests/clean2/run-test b/tests/clean2/run-test
new file mode 100755
index 0000000..42320df
--- /dev/null
+++ b/tests/clean2/run-test
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# This is a filterdiff(1) testcase.
+# Test: Make sure --clean removes hunk-level comments.
+
+
+. ${top_srcdir-.}/tests/common.sh
+
+cat << EOF > diff
+non-diff line
+--- a/file1
++++ b/file1
+@@ -0,0 +1 @@ this is a hunk-level comment
++a
+EOF
+
+${FILTERDIFF} --clean diff 2>errors >filtered || exit 1
+[ -s errors ] && exit 1
+
+cat << EOF | cmp - filtered || exit 1
+--- a/file1
++++ b/file1
+@@ -0,0 +1 @@
++a
+EOF
+
+${FILTERDIFF} --clean -x file1 diff 2>errors >filtered || exit 1
+[ -s errors ] && exit 1
+cat << EOF | cmp - filtered || exit 1
+--- a/file1
++++ b/file1
+@@ -0,0 +1 @@
++a
+EOF
--
cgit v0.10.1

View File

@@ -0,0 +1,54 @@
{
lib,
stdenv,
fetchurl,
perl,
makeWrapper,
version,
sha256,
patches ? [ ],
extraBuildInputs ? [ ],
...
}:
stdenv.mkDerivation rec {
pname = "patchutils";
inherit version patches;
src = fetchurl {
url = "http://cyberelk.net/tim/data/patchutils/stable/${pname}-${version}.tar.xz";
inherit sha256;
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl ] ++ extraBuildInputs;
hardeningDisable = [ "format" ];
# tests fail when building in parallel
enableParallelBuilding = false;
postInstall = ''
for bin in $out/bin/{splitdiff,rediff,editdiff,dehtmldiff}; do
wrapProgram "$bin" \
--prefix PATH : "$out/bin"
done
'';
doCheck = lib.versionAtLeast version "0.3.4";
preCheck = ''
patchShebangs tests
chmod +x scripts/*
''
+ lib.optionalString (lib.versionOlder version "0.4.2") ''
find tests -type f -name 'run-test' \
-exec sed -i '{}' -e 's|/bin/echo|echo|g' \;
'';
meta = with lib; {
description = "Tools to manipulate patch files";
homepage = "http://cyberelk.net/tim/software/patchutils";
license = licenses.gpl2Plus;
platforms = platforms.all;
maintainers = with maintainers; [ artturin ];
};
}

View File

@@ -0,0 +1,3 @@
source "https://rubygems.org"
gem "uniscribe"

View File

@@ -0,0 +1,37 @@
GEM
remote: https://rubygems.org/
specs:
characteristics (1.4.0)
unicode-categories (~> 1.7)
paint (2.2.1)
rationalist (2.0.1)
symbolify (1.4.0)
characteristics (>= 0.8, < 2.0)
unicode-categories (1.7.0)
unicode-display_width (2.1.0)
unicode-emoji (2.9.0)
unicode-version (~> 1.0)
unicode-name (1.10.0)
unicode-types (~> 1.7)
unicode-sequence_name (1.10.0)
unicode-types (1.7.0)
unicode-version (1.1.0)
uniscribe (1.7.0)
characteristics (~> 1.4)
paint (>= 0.9, < 3.0)
rationalist (~> 2.0, >= 2.0.1)
symbolify (~> 1.4)
unicode-display_width (~> 2.1)
unicode-emoji (~> 2.9)
unicode-name (~> 1.10)
unicode-sequence_name (~> 1.10)
unicode-version (~> 1.1)
PLATFORMS
ruby
DEPENDENCIES
uniscribe
BUNDLED WITH
2.1.4

View File

@@ -0,0 +1,37 @@
{
stdenv,
lib,
bundlerEnv,
bundlerUpdateScript,
makeWrapper,
}:
let
rubyEnv = bundlerEnv {
name = "uniscribe";
gemdir = ./.;
};
in
stdenv.mkDerivation {
pname = "uniscribe";
version = (import ./gemset.nix).uniscribe.version;
nativeBuildInputs = [ makeWrapper ];
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin
makeWrapper ${rubyEnv}/bin/uniscribe $out/bin/uniscribe
'';
passthru.updateScript = bundlerUpdateScript "uniscribe";
meta = with lib; {
description = "Explains Unicode characters/code points: Displays their name, category, and shows compositions";
mainProgram = "uniscribe";
homepage = "https://github.com/janlelis/uniscribe";
license = licenses.mit;
maintainers = with maintainers; [ kjeremy ];
};
}

File diff suppressed because it is too large Load Diff