# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           golang 1.0

go.setup            github.com/pdfcpu/pdfcpu 0.9.1 v
set git-commit      1d4a5a6
# This line is for displaying commit in CLI only
categories          textproc
maintainers         {i0ntempest @i0ntempest} openmaintainer
license             Apache-2

description         PDF processor written in Go
long_description    ${name} is a PDF processing library written in Go supporting encryption.\
                    It provides both an API and a CLI. Supported are all versions up to PDF 1.7 (ISO-32000).\
                    Support for PDF 2.0 is basic and ongoing work.

checksums           ${distname}${extract.suffix} \
                        rmd160  d96e063195056b9afb1c53072fea1254c59af94c \
                        sha256  e5905d2166b6c7aa76d2eb34810a487156e12ce6d957f8421f0b5ee32191ffbf \
                        size    267641364

go.vendors          gopkg.in/yaml.v2 \
                        lock    v2.4.0 \
                        rmd160  66e9feb7944b3804efa63155ed9b618717b8955c \
                        sha256  72812077e7f20278003de6ab0d85053d89131d64c443f39115a022114fd032b6 \
                        size    73231 \
                    gopkg.in/check.v1 \
                        lock    20d25e280405 \
                        rmd160  412aa0d109919182ff84259e9b5bbc9f24d78117 \
                        sha256  233f8faf427ce6701ac3427f85c28bc6b6ae7cdc97a303a52873c69999223325 \
                        size    30360 \
                    golang.org/x/text \
                        lock    v0.19.0 \
                        rmd160  af0cec09324b1d808d0611d619778231686d31e6 \
                        sha256  d79cf17861409d200e3399f2af049446ee18b20b21fce9433f789582100ddc42 \
                        size    8972460 \
                    golang.org/x/image \
                        lock    v0.21.0 \
                        rmd160  99253422b877b4610d654421a3f4bc1c6b71a177 \
                        sha256  57fe22fa2222bdb1e29338393adb69ae5e5e80bcd61809d43802ef7b303c5bc9 \
                        size    5104167 \
                    github.com/rivo/uniseg \
                        lock    v0.4.7 \
                        rmd160  a9056dc9a2a80aa9c46d0ff9e54f9e2e5a498c41 \
                        sha256  abc6a2f17b64b34b8a0c56eb9d0b53886ebbe0c88d467755c09c7fa696a16677 \
                        size    458166 \
                    github.com/pkg/errors \
                        lock    v0.9.1 \
                        rmd160  dc065c655f8a24c6519b58f9d1202eb266ecda40 \
                        sha256  208d21a7da574026f68a8c9818fa7c6ede1b514ef9e72dc733b496ddcb7792a6 \
                        size    13422 \
                    github.com/mattn/go-runewidth \
                        lock    v0.0.16 \
                        rmd160  297825c4365b5f723ae485e726259ebb620ecd66 \
                        sha256  6c9e81a6b46220612b97ebc35e8d29d1907fd225a9ce3e40b7cebd64cc58d09c \
                        size    18496 \
                    github.com/hhrutter/tiff \
                        lock    v1.0.1 \
                        rmd160  1087ae97b0fa121e3197a2c97de26e65701dad94 \
                        sha256  3bd28fd08e79e2dcfd3f0c18f95e9346fc5b552994ab55f4ec93a0f7c8024b04 \
                        size    2635220 \
                    github.com/hhrutter/lzw \
                        lock    v1.0.0 \
                        rmd160  2916d27037fff1db7bcc18d2804af56bc9043195 \
                        sha256  868d5c4b864c5f47c709d4489e61ddfd1c163849670048adb17e14ee2960dd29 \
                        size    54055

# Notes for updating this port:
# Remember to update git commit hash

set time [clock format [clock seconds] -format "%Y-%m-%dT%H:%M:%S%Z"]
build.args-append   -ldflags=\"-X main.version=${version} -X main.commit=${git-commit} \
                    -X github.com/pdfcpu/pdfcpu/pkg/pdfcpu.VersionStr=${version} -X main.date=${time}\" \
                    -o ./${name} ./cmd/${name}

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
}
