mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 19:29:15 +00:00
Building scripts for apt/homebrew platforms. (#993)
This commit is contained in:
23
scripts/apt/install_runtime_dependencies.sh
Executable file
23
scripts/apt/install_runtime_dependencies.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
BUILD_DEPENDS=(gnupg2 gpg)
|
||||
|
||||
apt-get update
|
||||
apt-get install -y ${BUILD_DEPENDS[@]} curl libdlib19.1 ffmpeg exiftool libheif1
|
||||
|
||||
# Install Darktable if building for a supported architecture
|
||||
if [ "${TARGETPLATFORM}" = "linux/amd64" ] || [ "${TARGETPLATFORM}" = "linux/arm64" ]; then
|
||||
echo 'deb https://download.opensuse.org/repositories/graphics:/darktable/Debian_12/ /' \
|
||||
| tee /etc/apt/sources.list.d/graphics:darktable.list
|
||||
curl -fsSL https://download.opensuse.org/repositories/graphics:/darktable/Debian_12/Release.key \
|
||||
| gpg --dearmor | tee /etc/apt/trusted.gpg.d/graphics_darktable.gpg > /dev/null
|
||||
|
||||
apt-get update
|
||||
apt-get install -y darktable
|
||||
fi
|
||||
|
||||
# Remove build dependencies and cleanup
|
||||
apt-get purge -y ${BUILD_DEPENDS[@]}
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
@@ -7,34 +7,19 @@
|
||||
: ${TARGETOS=}
|
||||
: ${TARGETARCH=}
|
||||
: ${TARGETVARIANT=}
|
||||
: ${CGO_ENABLED=}
|
||||
: ${GOARCH=}
|
||||
: ${GOOS=}
|
||||
: ${GOARM=}
|
||||
: ${GOBIN=}
|
||||
|
||||
CGO_ENABLED="$(go env CGO_ENABLED)"
|
||||
GOARCH="$(go env GOARCH)"
|
||||
GOOS="$(go env GOOS)"
|
||||
GOARM="$(go env GOARM)"
|
||||
GOBIN="$(go env GOBIN)"
|
||||
|
||||
set -eu
|
||||
|
||||
if [ ! -z "$TARGETPLATFORM" ]; then
|
||||
os="$(echo $TARGETPLATFORM | cut -d"/" -f1)"
|
||||
arch="$(echo $TARGETPLATFORM | cut -d"/" -f2)"
|
||||
if [ ! -z "$os" ] && [ ! -z "$arch" ]; then
|
||||
export GOOS="$os"
|
||||
export GOARCH="$arch"
|
||||
if [ "$arch" = "arm" ]; then
|
||||
case "$(echo $TARGETPLATFORM | cut -d"/" -f3)" in
|
||||
"v5")
|
||||
export GOARM="5"
|
||||
;;
|
||||
"v6")
|
||||
export GOARM="6"
|
||||
;;
|
||||
*)
|
||||
export GOARM="7"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
TARGETOS="$(echo $TARGETPLATFORM | cut -d"/" -f1)"
|
||||
TARGETARCH="$(echo $TARGETPLATFORM | cut -d"/" -f2)"
|
||||
TARGETVARIANT="$(echo $TARGETPLATFORM | cut -d"/" -f3)"
|
||||
fi
|
||||
|
||||
if [ ! -z "$TARGETOS" ]; then
|
||||
4
scripts/homebrew/install_build_dependencies.sh
Executable file
4
scripts/homebrew/install_build_dependencies.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
brew update
|
||||
brew install libheif dlib jpeg
|
||||
4
scripts/homebrew/install_runtime_dependencies.sh
Executable file
4
scripts/homebrew/install_runtime_dependencies.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
brew update
|
||||
brew install exiftool ffmpeg darktable
|
||||
5
scripts/homebrew/set_compiler_env.sh
Executable file
5
scripts/homebrew/set_compiler_env.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
export CPLUS_INCLUDE_PATH="$(brew --prefix)/opt/jpeg/include:$(brew --prefix)/opt/dlib/include"
|
||||
export LD_LIBRARY_PATH="$(brew --prefix)/opt/jpeg/lib:$(brew --prefix)/opt/dlib/lib"
|
||||
export LIBRARY_PATH="$(brew --prefix)/opt/jpeg/lib:$(brew --prefix)/opt/dlib/lib"
|
||||
Reference in New Issue
Block a user