mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 22:19:07 +00:00
Fix #1204 * Add bad medias to scanner_test. * Fix the script. * Add GenerateThumbnail function. * Add identify dimension * Use new API. Cover json condition. * Use magick to generate thumbnails. * Update go mod. * Remove dependency of executable_worker -> test_utils * Reduce dependency of magick. * Use magick to get dimension. * Remove almost all code around `image` package. * Fix thumbnailing with multi-frame gif. * Remove the struct in wrapper. * Fix typo. * Build images. * Update logs * Add jpeg decoder. * Remove code dependency. * Add log to confirm scan in parallel. * Update log * Add reformat image perf tests. * Rollback the build workflow.
55 lines
1.2 KiB
Bash
Executable File
55 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
# Configure environment for cross-compiling.
|
|
|
|
: ${TARGETPLATFORM=linux/`dpkg --print-architecture`}
|
|
|
|
TARGETOS="$(echo $TARGETPLATFORM | cut -d"/" -f1)"
|
|
TARGETARCH="$(echo $TARGETPLATFORM | cut -d"/" -f2)"
|
|
TARGETVARIANT="$(echo $TARGETPLATFORM | cut -d"/" -f3)"
|
|
|
|
DEBIAN_ARCH=$TARGETARCH
|
|
if [ "$TARGETARCH" = "arm" ]
|
|
then
|
|
DEBIAN_ARCH=armel
|
|
if [ "$TARGETVARIANT" = "v7" ]
|
|
then
|
|
DEBIAN_ARCH=armhf
|
|
fi
|
|
fi
|
|
|
|
dpkg --add-architecture $DEBIAN_ARCH
|
|
apt-get update
|
|
apt-get install -y git curl crossbuild-essential-${DEBIAN_ARCH} libc-dev:${DEBIAN_ARCH} autoconf automake libtool m4 pkg-config cmake
|
|
|
|
dpkg-architecture -a $DEBIAN_ARCH >/env
|
|
export $(cat /env)
|
|
|
|
CGO_ENABLED="1"
|
|
GOOS="$TARGETOS"
|
|
GOARCH="$TARGETARCH"
|
|
|
|
GOARM="7"
|
|
if [ "$TARGETARCH" = "arm" ] && [ ! -z "$TARGETVARIANT" ]; then
|
|
case "$TARGETVARIANT" in
|
|
"v5")
|
|
export GOARM="5"
|
|
;;
|
|
"v6")
|
|
export GOARM="6"
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
echo CGO_ENABLED="${CGO_ENABLED}" >>/env
|
|
echo GOOS="${GOOS}" >>/env
|
|
echo GOARCH="${GOARCH}" >>/env
|
|
echo GOARM="${GOARM}" >>/env
|
|
echo AR="${DEB_HOST_MULTIARCH}-ar" >>/env
|
|
echo CC="${DEB_HOST_MULTIARCH}-gcc" >>/env
|
|
echo CXX="${DEB_HOST_MULTIARCH}-g++" >>/env
|
|
echo PKG_CONFIG_PATH="/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/" >>/env
|
|
|
|
cat /env
|