# -*- 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.8.1 v
set git-commit      66fee12
# 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  b7a037c8eda007cf301f671e96081d591056c406 \
                        sha256  8764ccf1202be9e6134d4b8a5267c255a38ed49f8779d59d8648b2cfa6e425a9 \
                        size    266525455

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.17.0 \
                        rmd160  d78334f0fbc6685d09d300728e8d76dec95f4a0d \
                        sha256  1485e4341b809faa9541d59999dbfa9016570395a2fcdd252c448e42a8196b81 \
                        size    8972469 \
                    golang.org/x/image \
                        lock    v0.19.0 \
                        rmd160  e8d527797fe92eee70673ece17aa9a11c371108f \
                        sha256  e83fc8ef722c0aec257b26029ee693dc0c3f507c04717f6b0ea0c88b2e23b5cb \
                        size    5104337 \
                    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/
}
