mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 21:09:05 +00:00
Update API with Debian trixie (#1286)
Fix #1273.
- Cleanup `libatlas-base-dev`
`ATLAS` is an optimized BLAS implementation. Today, the project looks dead. The last stable release (3.10.3)
happened in 2016. The last development release (3.11.41, not packaged) was in 2018. The git repository has seen no commit since 2019. Debian decided to [remove all `libatlas` packages](https://lists.debian.org/debian-science/2023/07/msg00010.html), including `libatlas-base-dev` from `trixie`.
`libatlas-base-dev` provides a unique `cblas` package with `pkg-config`. Debian provides [`blas`](https://lists.debian.org/debian-science/2023/07/msg00012.html) to cover all the feature in `cblas`. `go-face` already depends on [`blas`](0c14797b4d/face.go (L4)), and it's safe to remove `cblas`.
Maybe we should fork `go-face` and put those changes in the foked repo.
- Renaming `exiftool`
In `trixie`, `exiftool` package is renamed as `libimage-exiftool-perl`.
This commit is contained in:
@@ -39,7 +39,7 @@ RUN export BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%S+00:00(UTC)'); \
|
|||||||
npm run build -- --base="${UI_PUBLIC_URL}"
|
npm run build -- --base="${UI_PUBLIC_URL}"
|
||||||
|
|
||||||
### Build API ###
|
### Build API ###
|
||||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.25-bookworm AS api
|
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.25-trixie AS api
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
|
|
||||||
# See for details: https://github.com/hadolint/hadolint/wiki/DL4006
|
# See for details: https://github.com/hadolint/hadolint/wiki/DL4006
|
||||||
@@ -61,7 +61,7 @@ RUN chmod +x /app/scripts/*.sh \
|
|||||||
&& /app/scripts/install_runtime_dependencies.sh
|
&& /app/scripts/install_runtime_dependencies.sh
|
||||||
|
|
||||||
# hadolint ignore=DL3022
|
# hadolint ignore=DL3022
|
||||||
COPY --from=photoview/dependencies:latest /artifacts.tar.gz /dependencies/
|
COPY --from=photoview/dependencies:trixie /artifacts.tar.gz /dependencies/
|
||||||
WORKDIR /dependencies
|
WORKDIR /dependencies
|
||||||
RUN set -a && source /env && set +a \
|
RUN set -a && source /env && set +a \
|
||||||
&& git config --global --add safe.directory /app \
|
&& git config --global --add safe.directory /app \
|
||||||
@@ -81,6 +81,7 @@ RUN set -a && source /env && set +a \
|
|||||||
&& go mod download \
|
&& go mod download \
|
||||||
# Patch go-face
|
# Patch go-face
|
||||||
&& sed -i 's/-march=native//g' ${GOPATH}/pkg/mod/github.com/!kagami/go-face*/face.go \
|
&& sed -i 's/-march=native//g' ${GOPATH}/pkg/mod/github.com/!kagami/go-face*/face.go \
|
||||||
|
&& sed -i 's/-lcblas//g' ${GOPATH}/pkg/mod/github.com/!kagami/go-face*/face.go \
|
||||||
# Build dependencies that use CGO
|
# Build dependencies that use CGO
|
||||||
&& go install \
|
&& go install \
|
||||||
github.com/mattn/go-sqlite3 \
|
github.com/mattn/go-sqlite3 \
|
||||||
@@ -92,7 +93,7 @@ RUN set -a && source /env && set +a \
|
|||||||
&& go build -v -o photoview .
|
&& go build -v -o photoview .
|
||||||
|
|
||||||
### Build release image ###
|
### Build release image ###
|
||||||
FROM debian:bookworm-slim AS release
|
FROM debian:trixie-slim AS release
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
|
|
||||||
# See for details: https://github.com/hadolint/hadolint/wiki/DL4006
|
# See for details: https://github.com/hadolint/hadolint/wiki/DL4006
|
||||||
|
|||||||
17
README.md
17
README.md
@@ -270,14 +270,14 @@ We can't keep verifying below commands on each environment. People may need to s
|
|||||||
- Required packages:
|
- Required packages:
|
||||||
- `golang` >= 1.22
|
- `golang` >= 1.22
|
||||||
- `g++`
|
- `g++`
|
||||||
- `libc-dev`
|
|
||||||
- `libheif` >= 1.15.1
|
- `libheif` >= 1.15.1
|
||||||
- [go-face Requirements](https://github.com/Kagami/go-face#requirements)
|
- [go-face Requirements](https://github.com/Kagami/go-face#requirements)
|
||||||
- `dlib`
|
- `dlib`
|
||||||
- `libjpeg`
|
- `libjpeg`
|
||||||
- `libblas`
|
- `libblas`
|
||||||
- `libcblas`, recommended using `libatlas-base` in Debian.
|
|
||||||
- `liblapack`
|
- `liblapack`
|
||||||
|
- `libmagic`
|
||||||
|
- `libmagickwand`
|
||||||
- Optional tools during developing:
|
- Optional tools during developing:
|
||||||
- [`reflex`](https://github.com/cespare/reflex): a source code monitoring tool, which automatically rebuilds and restarts the server, running from the code in development.
|
- [`reflex`](https://github.com/cespare/reflex): a source code monitoring tool, which automatically rebuilds and restarts the server, running from the code in development.
|
||||||
- `sqlite`: the SQLite DBMS, useful to interact with Photoview's SQLite DB directly if you use it in your development environment.
|
- `sqlite`: the SQLite DBMS, useful to interact with Photoview's SQLite DB directly if you use it in your development environment.
|
||||||
@@ -289,7 +289,7 @@ In Debian/Ubuntu, install dependencies:
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ sudo apt update # Update the package list
|
$ sudo apt update # Update the package list
|
||||||
$ sudo apt install golang g++ libc-dev libheif-dev libdlib-dev libjpeg-dev libblas-dev libatlas-base-dev liblapack-dev # For API requirement
|
$ sudo apt install golang g++ libheif-dev libdlib-dev libjpeg-dev libblas-dev liblapack-dev libmagic-dev libmagickwand-dev # For API requirement
|
||||||
$ sudo apt install reflex sqlite3 # For API optional tools
|
$ sudo apt install reflex sqlite3 # For API optional tools
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -331,14 +331,23 @@ Then run the following commands:
|
|||||||
```bash
|
```bash
|
||||||
# Optional: Set the compiler environment in Debian/Ubuntu
|
# Optional: Set the compiler environment in Debian/Ubuntu
|
||||||
$ source ./scripts/set_compiler_env.sh
|
$ source ./scripts/set_compiler_env.sh
|
||||||
|
|
||||||
# Set the compiler environment with `homebrew`
|
# Set the compiler environment with `homebrew`
|
||||||
$ export CPLUS_INCLUDE_PATH="$(brew --prefix)/opt/jpeg/include:$(brew --prefix)/opt/dlib/include:${CPLUS_INCLUDE_PATH:-}"
|
$ export CPLUS_INCLUDE_PATH="$(brew --prefix)/opt/jpeg/include:$(brew --prefix)/opt/dlib/include:${CPLUS_INCLUDE_PATH:-}"
|
||||||
$ export C_INCLUDE_PATH="$(brew --prefix)/opt/libmagic/include:$(brew --prefix)/opt/libheif/include:${C_INCLUDE_PATH:-}"
|
$ export C_INCLUDE_PATH="$(brew --prefix)/opt/libmagic/include:$(brew --prefix)/opt/libheif/include:${C_INCLUDE_PATH:-}"
|
||||||
$ export DYLD_LIBRARY_PATH="$(brew --prefix)/opt/jpeg/lib:$(brew --prefix)/opt/dlib/lib:$(brew --prefix)/opt/libmagic/lib:$(brew --prefix)/opt/libheif/lib:${DYLD_LIBRARY_PATH:-}"
|
$ export DYLD_LIBRARY_PATH="$(brew --prefix)/opt/jpeg/lib:$(brew --prefix)/opt/dlib/lib:$(brew --prefix)/opt/libmagic/lib:$(brew --prefix)/opt/libheif/lib:${DYLD_LIBRARY_PATH:-}"
|
||||||
$ export LIBRARY_PATH="$(brew --prefix)/opt/jpeg/lib:$(brew --prefix)/opt/dlib/lib:$(brew --prefix)/opt/libmagic/lib:$(brew --prefix)/opt/libheif/lib:${LIBRARY_PATH:-}"
|
$ export LIBRARY_PATH="$(brew --prefix)/opt/jpeg/lib:$(brew --prefix)/opt/dlib/lib:$(brew --prefix)/opt/libmagic/lib:$(brew --prefix)/opt/libheif/lib:${LIBRARY_PATH:-}"
|
||||||
$ export CGO_CFLAGS_ALLOW=-Xpreprocessor
|
$ export CGO_CFLAGS_ALLOW=-Xpreprocessor
|
||||||
# Start API server
|
|
||||||
$ cd ./api
|
$ cd ./api
|
||||||
|
$ go mod download
|
||||||
|
|
||||||
|
# Update go-face dependencies
|
||||||
|
$ sed -i 's/-lcblas//g' $(go env GOMODCACHE)/github.com/\!kagami/go-face*/face.go # Linux
|
||||||
|
# Or
|
||||||
|
$ sed -i '' 's/-lcblas//g' $(go env GOMODCACHE)/github.com/\!kagami/go-face*/face.go # macOS
|
||||||
|
|
||||||
|
# Start API server
|
||||||
$ go run .
|
$ go run .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ apt-get install -y --no-install-recommends libjpeg62-turbo-dev:${DEB_HOST_ARCH}
|
|||||||
apt-get install -y --no-install-recommends libjxl-dev:${DEB_HOST_ARCH} liblcms2-dev:${DEB_HOST_ARCH} liblqr-1-0-dev:${DEB_HOST_ARCH} libdjvulibre-dev:${DEB_HOST_ARCH} libjpeg62-turbo-dev:${DEB_HOST_ARCH} libopenjp2-7-dev:${DEB_HOST_ARCH} libopenexr-dev:${DEB_HOST_ARCH} libpng-dev:${DEB_HOST_ARCH} libtiff-dev:${DEB_HOST_ARCH} libwebp-dev:${DEB_HOST_ARCH} libxml2-dev:${DEB_HOST_ARCH} libfftw3-dev:${DEB_HOST_ARCH} zlib1g-dev:${DEB_HOST_ARCH} liblzma-dev:${DEB_HOST_ARCH} libbz2-dev:${DEB_HOST_ARCH}
|
apt-get install -y --no-install-recommends libjxl-dev:${DEB_HOST_ARCH} liblcms2-dev:${DEB_HOST_ARCH} liblqr-1-0-dev:${DEB_HOST_ARCH} libdjvulibre-dev:${DEB_HOST_ARCH} libjpeg62-turbo-dev:${DEB_HOST_ARCH} libopenjp2-7-dev:${DEB_HOST_ARCH} libopenexr-dev:${DEB_HOST_ARCH} libpng-dev:${DEB_HOST_ARCH} libtiff-dev:${DEB_HOST_ARCH} libwebp-dev:${DEB_HOST_ARCH} libxml2-dev:${DEB_HOST_ARCH} libfftw3-dev:${DEB_HOST_ARCH} zlib1g-dev:${DEB_HOST_ARCH} liblzma-dev:${DEB_HOST_ARCH} libbz2-dev:${DEB_HOST_ARCH}
|
||||||
|
|
||||||
# Install go-face dependencies
|
# Install go-face dependencies
|
||||||
apt-get install -y --no-install-recommends libdlib-dev:${DEB_HOST_ARCH} libblas-dev:${DEB_HOST_ARCH} libatlas-base-dev:${DEB_HOST_ARCH} liblapack-dev:${DEB_HOST_ARCH} libjpeg62-turbo-dev:${DEB_HOST_ARCH}
|
apt-get install -y --no-install-recommends libdlib-dev:${DEB_HOST_ARCH} libblas-dev:${DEB_HOST_ARCH} liblapack-dev:${DEB_HOST_ARCH} libjpeg62-turbo-dev:${DEB_HOST_ARCH}
|
||||||
|
|
||||||
# Install gomagic dependencies
|
# Install gomagic dependencies
|
||||||
apt-get install -y --no-install-recommends libmagic-dev:${DEB_HOST_ARCH}
|
apt-get install -y --no-install-recommends libmagic-dev:${DEB_HOST_ARCH}
|
||||||
|
|||||||
@@ -2,19 +2,19 @@
|
|||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y --no-install-recommends curl exiftool
|
apt-get install -y --no-install-recommends curl libimage-exiftool-perl
|
||||||
|
|
||||||
# libheif dependencies
|
# libheif dependencies
|
||||||
apt-get install -y --no-install-recommends libdav1d6 librav1e0 libde265-0 libx265-199 libjpeg62-turbo libopenh264-7 libpng16-16 libnuma1 zlib1g
|
apt-get install -y --no-install-recommends libdav1d7 librav1e0.7 libde265-0 libx265-215 libjpeg62-turbo libopenh264-8 libpng16-16t64 libnuma1 zlib1g
|
||||||
|
|
||||||
# libraw dependencies
|
# libraw dependencies
|
||||||
apt-get install -y --no-install-recommends libjpeg62-turbo liblcms2-2 zlib1g libgomp1
|
apt-get install -y --no-install-recommends libjpeg62-turbo liblcms2-2 zlib1g libgomp1
|
||||||
|
|
||||||
# ImageMagick dependencies
|
# ImageMagick dependencies
|
||||||
apt-get install -y --no-install-recommends libjxl0.7 liblcms2-2 liblqr-1-0 libdjvulibre21 libjpeg62-turbo libopenjp2-7 libopenexr-3-1-30 libpng16-16 libtiff6 libwebpmux3 libwebpdemux2 libwebp7 libxml2 zlib1g liblzma5 libbz2-1.0 libgomp1
|
apt-get install -y --no-install-recommends libjxl0.11 liblcms2-2 liblqr-1-0 libdjvulibre21 libjpeg62-turbo libopenjp2-7 libopenexr-3-1-30 libpng16-16t64 libtiff6 libwebpmux3 libwebpdemux2 libwebp7 libxml2 zlib1g liblzma5 libbz2-1.0 libgomp1
|
||||||
|
|
||||||
# go-face dependencies
|
# go-face dependencies
|
||||||
apt-get install -y --no-install-recommends libdlib19.1 libblas3 liblapack3 libjpeg62-turbo
|
apt-get install -y --no-install-recommends libdlib19.2 libblas3 liblapack3 libjpeg62-turbo
|
||||||
|
|
||||||
# gomagic dependencies
|
# gomagic dependencies
|
||||||
apt-get install -y --no-install-recommends libmagic1
|
apt-get install -y --no-install-recommends libmagic1t64
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ fi
|
|||||||
|
|
||||||
dpkg --add-architecture $DEBIAN_ARCH
|
dpkg --add-architecture $DEBIAN_ARCH
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y git curl crossbuild-essential-${DEBIAN_ARCH} libc-dev:${DEBIAN_ARCH} autoconf automake libtool m4 pkg-config cmake
|
apt-get install -y git curl crossbuild-essential-${DEBIAN_ARCH} libc-dev:${DEBIAN_ARCH} autoconf automake libtool m4 pkg-config cmake dpkg-dev
|
||||||
|
|
||||||
dpkg-architecture -a $DEBIAN_ARCH >/env
|
dpkg-architecture -a $DEBIAN_ARCH >/env
|
||||||
export $(cat /env)
|
export $(cat /env)
|
||||||
|
|||||||
Reference in New Issue
Block a user