uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
35
pkgs/applications/graphics/tesseract/fetch-language-hashes
Executable file
35
pkgs/applications/graphics/tesseract/fetch-language-hashes
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Usage:
|
||||
# ./fetch-language-hashes <tessdataRev> [<language code>…]
|
||||
#
|
||||
# Fetches all languages if no language codes are given.
|
||||
#
|
||||
# Example:
|
||||
# ./fetch-language-hashes 4.0.0 eng spa
|
||||
#
|
||||
# Output:
|
||||
# eng = "0iy0...";
|
||||
# spa = "15kw...";
|
||||
|
||||
set -e
|
||||
|
||||
(( $# >= 1 )) || exit 1
|
||||
tessdataRev=$1
|
||||
shift
|
||||
|
||||
if (( $# > 0 )); then
|
||||
langCodes="$@"
|
||||
else
|
||||
repoPage=$(curl -fs https://github.com/tesseract-ocr/tessdata/tree/$tessdataRev || {
|
||||
>&2 echo "Invalid tessdataRev: $tessdataRev"
|
||||
exit 1
|
||||
})
|
||||
langCodes=$(echo $(echo "$repoPage" | grep -ohP "(?<=/)[^/ ]+?(?=\.traineddata)" | sort -u))
|
||||
fi
|
||||
|
||||
for lang in $langCodes; do
|
||||
url=https://github.com/tesseract-ocr/tessdata/raw/$tessdataRev/$lang.traineddata
|
||||
hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url $url 2>/dev/null))
|
||||
echo "$lang = \"$hash\";"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue