···1{ lib, makeWrapper, tesseractBase, languages
023# A list of languages like [ "eng" "spa" … ] or `null` for all available languages
4, enableLanguages ? null
···12}:
1314let
15- passthru = { inherit tesseractBase languages tessdata; };
16-17 tesseractWithData = tesseractBase.overrideAttrs (_: {
18 inherit tesseractBase tessdata;
19···47 exit 1
48 fi
49 '';
050 });
5152- tesseract = (if enableLanguages == [] then tesseractBase else tesseractWithData) // passthru;
0000000000000000000000000053in
54 if enableLanguagesHash == null then
55 tesseract
···1{ lib, makeWrapper, tesseractBase, languages
2+, runCommand, imagemagick
34# A list of languages like [ "eng" "spa" … ] or `null` for all available languages
5, enableLanguages ? null
···13}:
1415let
0016 tesseractWithData = tesseractBase.overrideAttrs (_: {
17 inherit tesseractBase tessdata;
18···46 exit 1
47 fi
48 '';
49+50 });
5152+ passthru = { inherit tesseractBase languages tessdata; };
53+54+ # Only run test when all languages are available
55+ test = lib.optionalAttrs (enableLanguages == null) {
56+ tests.default = runCommand "tesseract-test-ocr" {
57+ buildInputs = [
58+ tesseractWithData
59+ imagemagick
60+ ];
61+ } ''
62+ text="hello nix"
63+64+ convert -size 400x40 xc:white -font 'DejaVu-Sans' -pointsize 20 \
65+ -fill black -annotate +5+20 "$text" /tmp/test-img.png 2>/dev/null
66+ ocrResult=$(tesseract /tmp/test-img.png - | tr -d "\f")
67+68+ if [[ $ocrResult != $text ]]; then
69+ echo "OCR test failed"
70+ echo "expected: '$text'"
71+ echo "actual: '$ocrResult'"
72+ exit 1
73+ fi
74+ touch $out
75+ '';
76+ };
77+78+ tesseract = (if enableLanguages == [] then tesseractBase else tesseractWithData) // passthru // test;
79in
80 if enableLanguagesHash == null then
81 tesseract
···111## other
112113, crashreporterSupport ? false
114-, safeBrowsingSupport ? false
115116# As stated by Sylvestre Ledru (@sylvestre) on Nov 22, 2017 at
117# https://github.com/NixOS/nixpkgs/issues/31843#issuecomment-346372756 we
···111## other
112113, crashreporterSupport ? false
0114115# As stated by Sylvestre Ledru (@sylvestre) on Nov 22, 2017 at
116# https://github.com/NixOS/nixpkgs/issues/31843#issuecomment-346372756 we
···1617buildGoPackage rec {
18 pname = "gitea";
19- version = "1.16.6";
2021 # not fetching directly from the git repo, because that lacks several vendor files for the web UI
22 src = fetchurl {
23 url = "https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-src-${version}.tar.gz";
24- sha256 = "sha256-LlAnTTFuqbMa7QPf51D6+RalWuYqTKlSlxGXyt4h0aE=";
25 };
2627 unpackPhase = ''
···1617buildGoPackage rec {
18 pname = "gitea";
19+ version = "1.16.7";
2021 # not fetching directly from the git repo, because that lacks several vendor files for the web UI
22 src = fetchurl {
23 url = "https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-src-${version}.tar.gz";
24+ sha256 = "sha256-UVmbFtHC4W3WF+DptdHMMUoe8UE5TVgoM9QRuczSrEg=";
25 };
2627 unpackPhase = ''
+22
pkgs/data/fonts/lao/default.nix
···0000000000000000000000
···1+{ fetchzip, lib }:
2+3+let
4+ version = "0.0.20060226";
5+in
6+fetchzip {
7+ name = "lao-${version}";
8+ url = "mirror://debian/pool/main/f/fonts-lao/fonts-lao_${version}.orig.tar.xz";
9+ sha256 = "sha256-Ti3DNOgLR5VBJ1mSe8M+qs4UYbCR7qOPgqxRfmHa+jY=";
10+11+ postFetch = ''
12+ mkdir -p $out/share/fonts
13+ tar xf $downloadedFile --strip-components=1 -C $out/share/fonts fonts-lao-${version}/Phetsarath_OT.ttf
14+ '';
15+16+ meta = with lib; {
17+ description = "TrueType font for Lao language";
18+ license = licenses.gpl2Plus;
19+ maintainers = with lib.maintainers; [ serge ];
20+ platforms = platforms.all;
21+ };
22+}
···8 exit 1
9fi
100011# Version of Pulumi from
12# https://www.pulumi.com/docs/get-started/install/versions/
13-VERSION="3.30.0"
1415# An array of plugin names. The respective repository inside Pulumi's
16# Github organization is called pulumi-$name by convention.
···157 echo " };"
158 echo "}"
159160-} > data.nix
···8 exit 1
9fi
1011+SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
12+13# Version of Pulumi from
14# https://www.pulumi.com/docs/get-started/install/versions/
15+VERSION="3.31.0"
1617# An array of plugin names. The respective repository inside Pulumi's
18# Github organization is called pulumi-$name by convention.
···159 echo " };"
160 echo "}"
161162+} > "${SCRIPT_DIR}/data.nix"