archrelease: copy trunk to community-any
[ArchLinux/community.git] / imaginary / trunk / PKGBUILD
blobe0a55a4f82480186184ecba90f85d82c55241b24
1 # Maintainer: Justin Kromlinger <hashworks@archlinux.org>
3 pkgname='imaginary'
4 pkgver=1.2.4
5 pkgrel=1
6 pkgdesc="Fast, simple, scalable HTTP microservice for high-level image processing"
7 url='https://github.com/h2non/imaginary'
8 arch=('x86_64')
9 license=('MIT')
10 depends=('glibc' 'libvips' 'lcms2' 'openjpeg2' 'poppler-glib' 'openslide' 'libjxl')
11 makedepends=('go')
12 source=(
13   "${pkgname}-${pkgver}.tar.gz::https://github.com/h2non/imaginary/archive/refs/tags/v${pkgver}.tar.gz"
14   "imaginary.service")
15 sha512sums=('f0848158eb0cb70b111c46c24a9ef324114608fca3f73daf97c296a7e7805890f739e9a65e7bce979204f387e528ccffb139b1deb1417b7187a567bc0cbe4c9f'
16             'a561c34735bed4eca5bcd20e99e8294d7eaef85a0293ce742981eb4152b3caf7c26a1b07d6680028f82585437d2c35bfae52d4e6a161591864d0ccff78d65c39')
18 prepare() {
19   cd ${pkgname}-${pkgver}
20   go mod vendor
23 build() {
24   cd ${pkgname}-${pkgver}
25   export CGO_CPPFLAGS="${CPPFLAGS}"
26   export CGO_CFLAGS="${CFLAGS}"
27   export CGO_CXXFLAGS="${CXXFLAGS}"
28   export CGO_LDFLAGS="${LDFLAGS}"
29   export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
30   go build -v -o ${pkgname} \
31     -ldflags "-linkmode=external -X main.Version=${pkgver}" \
32     .
35 package() {
36   install -Dm644 imaginary.service "${pkgdir}/usr/lib/systemd/system/imaginary.service"
37   cd ${pkgname}-${pkgver}
38   install -Dm644 "README.md" "$pkgdir/usr/share/doc/${pkgname}/README.md"
39   install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
40   install -Dm755 ${pkgname} -t "${pkgdir}"/usr/bin/
43 # vim: ts=2 sw=2 et: