languageMachines: move to by-name (#449618)

This commit is contained in:
jopejoe1
2025-10-08 16:11:07 +00:00
committed by GitHub
25 changed files with 309 additions and 358 deletions

View File

@@ -1,34 +1,39 @@
{
lib,
stdenv,
fetchurl,
automake,
autoconf,
fetchFromGitHub,
gitUpdater,
callPackage,
autoreconfHook,
bzip2,
libtar,
libtool,
pkg-config,
autoconf-archive,
libxml2,
icu,
languageMachines,
icu60,
ticcutils,
timbl,
mbt,
libfolia,
ucto,
frogdata,
}:
let
release = lib.importJSON ./release-info/LanguageMachines-frog.json;
in
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "frog";
version = release.version;
src = fetchurl {
inherit (release) url sha256;
name = "frog-v${release.version}.tar.gz";
version = "0.13.7";
src = fetchFromGitHub {
owner = "LanguageMachines";
repo = "frog";
tag = "v${finalAttrs.version}";
hash = "sha256-khc2uZ/dOtWPTnt/ZD6ILxD386MaZt6fsvNTWTCbs+c=";
};
nativeBuildInputs = [
pkg-config
automake
autoconf
autoreconfHook
];
buildInputs = [
bzip2
@@ -36,28 +41,30 @@ stdenv.mkDerivation {
libtool
autoconf-archive
libxml2
icu
languageMachines.ticcutils
languageMachines.timbl
languageMachines.mbt
languageMachines.libfolia
languageMachines.ucto
languageMachines.frogdata
icu60
ticcutils
timbl
mbt
libfolia
ucto
frogdata
];
preConfigure = ''
sh bootstrap.sh
'';
postInstall = ''
# frog expects the data files installed in the same prefix
mkdir -p $out/share/frog/;
for f in ${languageMachines.frogdata}/share/frog/*; do
for f in ${frogdata}/share/frog/*; do
ln -s $f $out/share/frog/;
done;
make check
'';
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests.simple = callPackage ./test.nix { frog = finalAttrs.finalPackage; };
};
meta = with lib; {
description = "Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch";
homepage = "https://languagemachines.github.io/frog";
@@ -72,4 +79,4 @@ stdenv.mkDerivation {
'';
};
}
})

View File

@@ -1,10 +1,10 @@
{
runCommand,
languageMachines,
frog,
}:
runCommand "frog-test" { } ''
${languageMachines.frog}/bin/frog >$out <<EOF
${frog}/bin/frog >$out <<EOF
Dit is een test
EOF

View File

@@ -0,0 +1,53 @@
{
lib,
stdenv,
fetchFromGitHub,
gitUpdater,
autoreconfHook,
libtool,
pkg-config,
autoconf-archive,
frog,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "frogdata";
version = "0.13";
src = fetchFromGitHub {
owner = "LanguageMachines";
repo = "frogdata";
tag = "v${finalAttrs.version}";
hash = "sha256-f3rPjc8iYPVJsL6pez2WBw+rCxy6xm3DzOi8S+PDkvg=";
};
nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs = [
libtool
autoconf-archive
];
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests = {
/**
Reverse dependencies. Does not respect overrides.
*/
reverseDependencies = lib.recurseIntoAttrs {
inherit frog;
};
};
};
meta = with lib; {
description = "Data for Frog, a Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch";
homepage = "https://languagemachines.github.io/frog";
license = licenses.gpl3;
platforms = platforms.all;
maintainers = with maintainers; [ roberth ];
};
})

View File

@@ -1,34 +1,34 @@
{
lib,
stdenv,
fetchurl,
automake,
autoconf,
fetchFromGitHub,
gitUpdater,
autoreconfHook,
libtool,
pkg-config,
autoconf-archive,
libxml2,
icu,
icu60,
bzip2,
libtar,
languageMachines,
ticcutils,
frog,
}:
let
release = lib.importJSON ./release-info/LanguageMachines-libfolia.json;
in
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "libfolia";
version = release.version;
src = fetchurl {
inherit (release) url sha256;
name = "libfolia-${release.version}.tar.gz";
version = "1.7";
src = fetchFromGitHub {
owner = "LanguageMachines";
repo = "libfolia";
tag = "v${finalAttrs.version}";
hash = "sha256-fH+XqTaMf7/8ZA0lwWiD7s7fmGkjni83Q7lv5sh50H4=";
};
nativeBuildInputs = [
pkg-config
automake
autoconf
autoreconfHook
];
buildInputs = [
bzip2
@@ -36,14 +36,25 @@ stdenv.mkDerivation {
autoconf-archive
libtar
libxml2
icu
languageMachines.ticcutils
icu60
ticcutils
];
preConfigure = "sh bootstrap.sh";
# compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554
CXXFLAGS = [ "-DU_USING_ICU_NAMESPACE=1" ];
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests = {
/**
Reverse dependencies. Does not respect overrides.
*/
reverseDependencies = lib.recurseIntoAttrs {
inherit frog;
};
};
};
meta = with lib; {
description = "C++ API for FoLiA documents; an XML-based linguistic annotation format";
mainProgram = "folialint";
@@ -57,4 +68,4 @@ stdenv.mkDerivation {
'';
};
}
})

View File

@@ -1,33 +1,34 @@
{
lib,
stdenv,
fetchurl,
automake,
autoconf,
fetchFromGitHub,
gitUpdater,
autoreconfHook,
bzip2,
libtar,
libtool,
pkg-config,
autoconf-archive,
libxml2,
languageMachines,
ticcutils,
timbl,
frog,
}:
let
release = lib.importJSON ./release-info/LanguageMachines-mbt.json;
in
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "mbt";
version = release.version;
src = fetchurl {
inherit (release) url sha256;
name = "mbt-${release.version}.tar.gz";
version = "3.2.16";
src = fetchFromGitHub {
owner = "LanguageMachines";
repo = "mbt";
tag = "v${finalAttrs.version}";
hash = "sha256-O/LhLWgLwDctkRYjds+AM9fGMIRX3eCnJhRIXyVrJ04=";
};
nativeBuildInputs = [
pkg-config
automake
autoconf
autoreconfHook
];
buildInputs = [
bzip2
@@ -35,13 +36,22 @@ stdenv.mkDerivation {
libtool
autoconf-archive
libxml2
languageMachines.ticcutils
languageMachines.timbl
ticcutils
timbl
];
patches = [ ./mbt-add-libxml2-dep.patch ];
preConfigure = ''
sh bootstrap.sh
'';
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests = {
/**
Reverse dependencies. Does not respect overrides.
*/
reverseDependencies = lib.recurseIntoAttrs {
inherit frog;
};
};
};
meta = with lib; {
description = "Memory Based Tagger";
@@ -57,4 +67,4 @@ stdenv.mkDerivation {
'';
};
}
})

View File

@@ -1,34 +1,36 @@
{
lib,
stdenv,
fetchurl,
automake,
autoconf,
fetchFromGitHub,
gitUpdater,
libtool,
autoreconfHook,
pkg-config,
autoconf-archive,
libxml2,
zlib,
bzip2,
libtar,
frog,
timblserver,
}:
let
release = lib.importJSON ./release-info/LanguageMachines-ticcutils.json;
in
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "ticcutils";
version = release.version;
src = fetchurl {
inherit (release) url sha256;
name = "ticcutils-${release.version}.tar.gz";
version = "0.15";
src = fetchFromGitHub {
owner = "LanguageMachines";
repo = "ticcutils";
tag = "v${finalAttrs.version}";
hash = "sha256-1+Plo2yZyDJWn/Yk4pawQGzwdx2UBfER9ZYAYLgYGh0=";
};
nativeBuildInputs = [
pkg-config
automake
autoconf
autoreconfHook
];
buildInputs = [
libtool
autoconf-archive
@@ -39,7 +41,18 @@ stdenv.mkDerivation {
libtar
# broken but optional: boost
];
preConfigure = "sh bootstrap.sh";
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests = {
/**
Reverse dependencies. Does not respect overrides.
*/
reverseDependencies = lib.recurseIntoAttrs {
inherit frog timblserver;
};
};
};
meta = with lib; {
description = "This module contains useful functions for general use in the TiCC software stack and beyond";
@@ -49,4 +62,4 @@ stdenv.mkDerivation {
maintainers = with maintainers; [ roberth ];
};
}
})

View File

@@ -1,33 +1,34 @@
{
lib,
stdenv,
fetchurl,
automake,
autoconf,
fetchFromGitHub,
gitUpdater,
autoreconfHook,
libtool,
pkg-config,
autoconf-archive,
libxml2,
bzip2,
libtar,
languageMachines,
ticcutils,
frog,
timblserver,
}:
let
release = lib.importJSON ./release-info/LanguageMachines-timbl.json;
in
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "timbl";
version = release.version;
src = fetchurl {
inherit (release) url sha256;
name = "timbl-${release.version}.tar.gz";
version = "6.4.9";
src = fetchFromGitHub {
owner = "LanguageMachines";
repo = "timbl";
tag = "v${finalAttrs.version}";
hash = "sha256-6hg/NiA5c5txyB7xYSlxA2WzAyNTF6JpupLpmzfxOYg=";
};
nativeBuildInputs = [
pkg-config
automake
autoconf
autoreconfHook
];
buildInputs = [
bzip2
@@ -35,9 +36,20 @@ stdenv.mkDerivation {
libtool
autoconf-archive
libxml2
languageMachines.ticcutils
ticcutils
];
preConfigure = "sh bootstrap.sh";
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests = {
/**
Reverse dependencies. Does not respect overrides.
*/
reverseDependencies = lib.recurseIntoAttrs {
inherit frog timblserver;
};
};
};
meta = with lib; {
description = "TiMBL implements several memory-based learning algorithms";
@@ -54,4 +66,4 @@ stdenv.mkDerivation {
'';
};
}
})

View File

@@ -1,33 +1,33 @@
{
lib,
stdenv,
fetchurl,
automake,
autoconf,
fetchFromGitHub,
gitUpdater,
autoreconfHook,
bzip2,
libtar,
libtool,
pkg-config,
autoconf-archive,
libxml2,
languageMachines,
ticcutils,
timbl,
}:
let
release = lib.importJSON ./release-info/LanguageMachines-timblserver.json;
in
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "timblserver";
version = release.version;
src = fetchurl {
inherit (release) url sha256;
name = "timblserver-${release.version}.tar.gz";
version = "1.11";
src = fetchFromGitHub {
owner = "LanguageMachines";
repo = "timblserver";
tag = "v${finalAttrs.version}";
hash = "sha256-TE6fsgr/L5GcBjFKlU6S1DiT8OKP6i7TVirxj/OfhlM=";
};
nativeBuildInputs = [
pkg-config
automake
autoconf
autoreconfHook
];
buildInputs = [
bzip2
@@ -35,10 +35,13 @@ stdenv.mkDerivation {
libtool
autoconf-archive
libxml2
languageMachines.ticcutils
languageMachines.timbl
ticcutils
timbl
];
preConfigure = "sh bootstrap.sh";
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
};
meta = with lib; {
description = "This server for TiMBL implements several memory-based learning algorithms";
@@ -54,4 +57,4 @@ stdenv.mkDerivation {
'';
};
}
})

View File

@@ -1,58 +1,71 @@
{
lib,
stdenv,
fetchurl,
automake,
autoconf,
fetchFromGitHub,
gitUpdater,
autoreconfHook,
libtool,
pkg-config,
autoconf-archive,
libxml2,
icu,
icu60,
bzip2,
libtar,
languageMachines,
ticcutils,
libfolia,
uctodata,
frog,
}:
let
release = lib.importJSON ./release-info/LanguageMachines-ucto.json;
in
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "ucto";
version = release.version;
src = fetchurl {
inherit (release) url sha256;
name = "ucto-${release.version}.tar.gz";
version = "0.9.6";
src = fetchFromGitHub {
owner = "LanguageMachines";
repo = "ucto";
tag = "v${finalAttrs.version}";
hash = "sha256-DFQ4ePE3n3zg0mrqUNHzE3Hi81n1IurYjhh6YVAghEE=";
};
nativeBuildInputs = [
pkg-config
automake
autoconf
autoreconfHook
];
buildInputs = [
bzip2
libtool
autoconf-archive
icu
icu60
libtar
libxml2
languageMachines.ticcutils
languageMachines.libfolia
languageMachines.uctodata
ticcutils
libfolia
uctodata
# TODO textcat from libreoffice? Pulls in X11 dependencies?
];
preConfigure = "sh bootstrap.sh;";
postInstall = ''
# ucto expects the data files installed in the same prefix
mkdir -p $out/share/ucto/;
for f in ${languageMachines.uctodata}/share/ucto/*; do
for f in ${uctodata}/share/ucto/*; do
echo "Linking $f"
ln -s $f $out/share/ucto/;
done;
'';
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests = {
/**
Reverse dependencies. Does not respect overrides.
*/
reverseDependencies = lib.recurseIntoAttrs {
inherit frog;
};
};
};
meta = with lib; {
description = "Rule-based tokenizer for natural language";
mainProgram = "ucto";
@@ -68,4 +81,4 @@ stdenv.mkDerivation {
'';
};
}
})

View File

@@ -1,35 +1,47 @@
{
lib,
stdenv,
fetchurl,
automake,
autoconf,
fetchFromGitHub,
gitUpdater,
autoreconfHook,
libtool,
pkg-config,
autoconf-archive,
frog,
}:
let
release = lib.importJSON ./release-info/LanguageMachines-uctodata.json;
in
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "uctodata";
version = release.version;
src = fetchurl {
inherit (release) url sha256;
name = "uctodata-${release.version}.tar.gz";
version = "0.4";
src = fetchFromGitHub {
owner = "LanguageMachines";
repo = "uctodata";
tag = "v${finalAttrs.version}";
hash = "sha256-4P9icZSm+DYGxGobSGzSExTv+ZQaLjkJ0gvOI27byRk=";
};
nativeBuildInputs = [
pkg-config
automake
autoconf
autoreconfHook
];
buildInputs = [
libtool
autoconf-archive
];
preConfigure = "sh bootstrap.sh";
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests = {
/**
Reverse dependencies. Does not respect overrides.
*/
reverseDependencies = lib.recurseIntoAttrs {
inherit frog;
};
};
};
meta = with lib; {
description = "Rule-based tokenizer for natural language";
@@ -45,4 +57,4 @@ stdenv.mkDerivation {
'';
};
}
})

View File

@@ -1,45 +0,0 @@
{
lib,
stdenv,
fetchurl,
automake,
autoconf,
libtool,
pkg-config,
autoconf-archive,
}:
let
release = lib.importJSON ./release-info/LanguageMachines-frogdata.json;
in
stdenv.mkDerivation {
pname = "frogdata";
version = release.version;
src = fetchurl {
inherit (release) url sha256;
name = "frogdata-${release.version}.tar.gz";
};
nativeBuildInputs = [
pkg-config
automake
autoconf
];
buildInputs = [
libtool
autoconf-archive
];
preConfigure = ''
sh bootstrap.sh
'';
meta = with lib; {
description = "Data for Frog, a Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch";
homepage = "https://languagemachines.github.io/frog";
license = licenses.gpl3;
platforms = platforms.all;
maintainers = with maintainers; [ roberth ];
};
}

View File

@@ -1,18 +0,0 @@
{ pkgs }:
let
inherit (pkgs) callPackage;
icu = pkgs.icu60;
in
{
ticcutils = callPackage ./ticcutils.nix { };
libfolia = callPackage ./libfolia.nix { inherit icu; };
ucto = callPackage ./ucto.nix { inherit icu; };
uctodata = callPackage ./uctodata.nix { };
timbl = callPackage ./timbl.nix { };
timblserver = callPackage ./timblserver.nix { };
mbt = callPackage ./mbt.nix { };
frog = callPackage ./frog.nix { inherit icu; };
frogdata = callPackage ./frogdata.nix { };
test = callPackage ./test.nix { };
}

View File

@@ -1,5 +0,0 @@
{
"version": "v0.13.7",
"url": "https://api.github.com/repos/LanguageMachines/frog/tarball/v0.13.7",
"sha256": "0swyfi3g862n888qj8v8kd18745hasy0vnc70i9qlv0ji0321bnf"
}

View File

@@ -1,5 +0,0 @@
{
"version": "0.13",
"url": "https://api.github.com/repos/LanguageMachines/frogdata/tarball/v0.13",
"sha256": "13mhv8qacl0n20ddl1ay49xi6h2m0a149ya3rrsmaah3x4adb4sg"
}

View File

@@ -1,5 +0,0 @@
{
"version": "v1.7",
"url": "https://api.github.com/repos/LanguageMachines/libfolia/tarball/v1.7",
"sha256": "0hpxdry7n2887klryc587xv46p6z6jp6hz9x7k2pk5v7jb0z4s65"
}

View File

@@ -1,5 +0,0 @@
{
"version": "v3.2.16",
"url": "https://api.github.com/repos/LanguageMachines/mbt/tarball/v3.2.16",
"sha256": "0f9f5l84m0lmmv4km9myn3yhy67jbmk3qn2fi40dy025gx4l0x3x"
}

View File

@@ -1,5 +0,0 @@
{
"version": "v0.15",
"url": "https://api.github.com/repos/LanguageMachines/ticcutils/tarball/v0.15",
"sha256": "0lssb1klx2flmr6fy78j37i5lbq3gfhzjx24j6n72ndm2rvprvcn"
}

View File

@@ -1,5 +0,0 @@
{
"version": "v6.4.9",
"url": "https://api.github.com/repos/LanguageMachines/timbl/tarball/v6.4.9",
"sha256": "1279npc3xlq05hnkylpbkgg941gjhvl6sd5fw4vgwcx2rwmmlaay"
}

View File

@@ -1,5 +0,0 @@
{
"version": "v1.11",
"url": "https://api.github.com/repos/LanguageMachines/timblserver/tarball/v1.11",
"sha256": "02k8c704wr5miy82w6zj0imm7sdfnxf3db34qiaa8l3myhn17qlw"
}

View File

@@ -1,5 +0,0 @@
{
"version": "v0.9.6",
"url": "https://api.github.com/repos/LanguageMachines/ucto/tarball/v0.9.6",
"sha256": "0fxq4j32g7kp6789xz23651c4v2j7zlz87cshfv9g1xjs7jxns3f"
}

View File

@@ -1,5 +0,0 @@
{
"version": "v0.4",
"url": "https://api.github.com/repos/LanguageMachines/uctodata/tarball/v0.4",
"sha256": "02c78qmwi9ijpk5wila3p62fmfdy1rpmlvvzbxs3wg0rdb0nwvd2"
}

View File

@@ -1,79 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell --packages curl
#!nix-shell --packages jq
#!nix-shell --packages parallel
#!nix-shell -i bash
# Exit immediately if a command exits with a non-zero status.
# Exit when a producer fails in a pipe
# Treat undefined variable references as errors
set -e -o pipefail -u
# Check if working directory is (probably) right
test "./update" = $0 || {
echo "The working directory ought to be the same is the update script location. Please invoke as ./update" 1>&2
exit 1
}
# Create temporary directory with automatic cleanup
readonly MY_TMP="$(mktemp -d)"
cleanup () {
rm -rf "$MY_TMP"
}
trap cleanup EXIT
# stdout: file containing release info and a convenient placeholder
# for the sha256 attribute
getRelease () {
local owner="$1"
local repo="$2"
local out="$MY_TMP/$owner--$repo-release"
curl -fSs https://api.github.com/repos/"$owner"/"$repo"/releases/latest \
| jq '{ version: .name, url: .tarball_url, sha256: "__SHA256__" }' \
> "$out"
echo "$out"
}
# 'getters' for the release info file
# stdout: unquoted tarball url
releaseUrl () {
local file="$1"
jq -r '.url' <"$file"
}
# stdout: unquoted version
releaseVersion () {
local file="$1"
jq -r '.version' <"$file"
}
# Fetch release tarball and compute hash
# stdout: base32 sha256 to be used in fetchurl
getReleaseHash () {
local file="$1"
local name="$2"
nix-prefetch-url "$(releaseUrl "$file")" --name "$name-$(releaseVersion "$file").tar.gz"
}
# Write a release info file to release-info/$owner-$repo.json
updateRelease () {
local owner="$1"
local repo="$2"
local r="$(getRelease "$owner" "$repo")"
local hash="$(getReleaseHash "$r" "$repo")"
sed \
-e s/__SHA256__/"$hash"/\
<"$r" \
>"release-info/$owner-$repo.json"
}
updateRelease LanguageMachines frogdata
updateRelease LanguageMachines frog
updateRelease LanguageMachines libfolia
updateRelease LanguageMachines mbt
updateRelease LanguageMachines ticcutils
updateRelease LanguageMachines timbl
updateRelease LanguageMachines timblserver
updateRelease LanguageMachines ucto
updateRelease LanguageMachines uctodata

View File

@@ -1316,6 +1316,18 @@ mapAliases {
### L ###
l3afpad = throw "'l3afpad' has been removed due to lack of maintenance upstream. Consider using 'xfce.mousepad' instead"; # Added 2024-09-14
languageMachines = {
ticcutils = ticcutils;
libfolia = libfolia;
ucto = ucto;
uctodata = uctodata;
timbl = timbl;
timblserver = timblserver;
mbt = mbt;
frog = frog;
frogdata = frogdata;
test = frog.tests.simple;
}; # Added 2025-10-07
larynx = piper-tts; # Added 2023-05-09
LASzip = laszip; # Added 2024-06-12
LASzip2 = laszip_2; # Added 2024-06-12

View File

@@ -7273,8 +7273,6 @@ with pkgs;
};
};
frog = res.languageMachines.frog;
fontconfig = callPackage ../development/libraries/fontconfig { };
makeFontsConf = callPackage ../development/libraries/fontconfig/make-fonts-conf.nix { };
@@ -7744,12 +7742,6 @@ with pkgs;
stdenv = gccStdenv;
};
languageMachines = recurseIntoAttrs (
import ../development/libraries/languagemachines/packages.nix {
inherit pkgs;
}
);
lcms = lcms2;
libagar = callPackage ../development/libraries/libagar { };