Skip to content

Commit

Permalink
checkversions: add libtiff, libwebp & libjpegturbo
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwutz committed Jan 27, 2025
1 parent 2c0cf29 commit e1cd89b
Showing 1 changed file with 37 additions and 11 deletions.
48 changes: 37 additions & 11 deletions checkversions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ set -u
[[ -d "${TMPDIR}" ]] || mkdir -p "${TMPDIR}"

tmp="${TMPDIR}/cv.$$.tmp"
#tmp=/tmp/cv.tmp

function rm_tmp() {
:
# rm -f "${tmp}"
rm -f "${tmp}"
}

trap rm_tmp EXIT
Expand Down Expand Up @@ -41,12 +42,14 @@ function parselast() {

# git_describe_remote
function gdrem() {

G=$1
P=$2
C=${3:-'(?<=<title>Release ).*?(?=<)'}
D=${4:-''}
L=$(git ls-remote --refs --sort=-v:refname "https://github.com/${G}" "${P}" | head -1)


_IFS=$IFS
${IFS+':'} unset _IFS
IFS=[$'\t'/]
Expand All @@ -68,6 +71,16 @@ function parse() {
echo "${U}"
}

function bparse() {
U=$1
P=$2

if [[ $(curl -s -L "${U}") =~ ${P} ]]; then
echo "${BASH_REMATCH[1]}${BASH_REMATCH[2]:+-}${BASH_REMATCH[2]:-}"
fi
echo "${U}"
}

function mtype() {
local _a=$1
local _p=$(type -p $_a)
Expand Down Expand Up @@ -115,15 +128,15 @@ if [[ -e "$PROJECT"/profile ]]; then
mtype tesseract
}
function exec_BUILD_zbar () {
pkg-config --modversion zbar
echo 'no-exec'
zbarimg --version
mtype zbarimg
}
function exec_BUILD_leptonica() {
pkg-config --modversion lept
echo "no-exec"
}
function exec_BUILD_jbig2enc () {
jbig2 -V 2>&1|cut -d' ' -f2
jbig2 -V 2>&1|head -1|cut -d' ' -f2
mtype jbig2
}
function exec_BUILD_jbig2dec () {
Expand All @@ -135,13 +148,19 @@ if [[ -e "$PROJECT"/profile ]]; then
mtype pngquant
}
function exec_BUILD_libwebp () {
webpinfo -version
webpinfo -version|cut -d' ' -f4
mtype webpinfo
}
function exec_BUILD_libjpegturbo () {
cjpeg -version
re='version (\S+)\s\(build\s(\S+)\)'
[[ $(cjpeg -version 2>&1) =~ $re ]] && echo "${BASH_REMATCH[1]}-${BASH_REMATCH[2]}"
mtype cjpeg
}
function exec_BUILD_libtiff () {
re='Version\s+(\S+)'
[[ $(tiffinfo 2>&1) =~ $re ]] && echo "${BASH_REMATCH[1]}"
mtype tiffinfo
}

fi

Expand Down Expand Up @@ -173,7 +192,6 @@ version_BUILD_tessdata() {
gdrem tesseract-ocr/tessdata_best 'refs/tags/[0-9]*' '(?<=Release ).*?(?=\s)'|cut -d' ' -f2
}
version_BUILD_jbig2dec() {
# gdrem ArtifexSoftware/jbig2dec 'refs/tags/[0-9]*'|cut -d' ' -f2
gdrem ArtifexSoftware/jbig2dec 'refs/tags/[0-9]*'|cut -d' ' -f2
}
version_BUILD_jbig2enc() {
Expand All @@ -197,14 +215,22 @@ version_BUILD_unpaper() {
version_BUILD_libfontttf() {
gdrem liberationfonts/liberation-fonts 'refs/tags/[0-9]*'|cut -d' ' -f1
}
version_BUILD_libwebp() {
bparse 'https://chromium.googlesource.com/webm/libwebp/' 'v([1-9]+\.[0-9]+\.[0-9]+)'
}
version_BUILD_libjpegturbo() {
gdrem libjpeg-turbo/libjpeg-turbo 'refs/tags/[0-9]*'|cut -d' ' -f1
}
version_BUILD_libtiff() {
bparse 'https://download.osgeo.org/libtiff/?C=M&O=D' 'tiff-(\S+?).tar.gz'
}

function version() {
Bi=$1
B=$(eval eval echo \\$\${Bi})
shift
# printf "%-s\n" "$Bi"
printf "#### %26s\n" "$B"

if [[ $(type -t exec_${Bi}) = 'function' ]]; then
# printf " exe %32s %s\n" "$(exec_${Bi}|tr '\n' ' ')"
v=$(exec_${Bi}|tr '\n' ' ')
Expand All @@ -214,7 +240,6 @@ function version() {
fi

if [[ $(type -t version_${Bi}) = 'function' ]]; then
# v=$(version_${Bi}|tr '\n' ' ')
v=$(version_${Bi})
printf " ver %26s %s\n" $v
else
Expand All @@ -234,6 +259,7 @@ BUILD_tesseract
BUILD_tessdata
BUILD_libwebp
BUILD_libjpegturbo
BUILD_libtiff
BUILD_jbig2dec
BUILD_jbig2enc
BUILD_leptonica
Expand All @@ -245,8 +271,8 @@ BUILD_unpaper
BUILD_libfontttf
)

_aparts=(
BUILD_python
_xparts=(
BUILD_leptonica
)

# list of versions
Expand Down

0 comments on commit e1cd89b

Please sign in to comment.