diff --git a/graphics/gowall/Makefile b/graphics/gowall/Makefile index 83ec2d6adede..3fdb08346a1c 100644 --- a/graphics/gowall/Makefile +++ b/graphics/gowall/Makefile @@ -1,54 +1,61 @@ PORTNAME= gowall DISTVERSIONPREFIX= v -DISTVERSION= 0.2.3 -PORTREVISION= 10 +DISTVERSION= 0.2.4 CATEGORIES= graphics +# Pull the patches that aren't upstreamed yet from my own fork +# Ongoing PR: https://github.com/Achno/gowall/pull/87 +PATCH_SITES= https://github.com/hpesojxn/gowall +PATCHFILES= fdf8f677cbc3b5931df3527e1dbd218625f49e7e.patch:-p1 + MAINTAINER= nxjoseph@FreeBSD.org COMMENT= Versatile tool to process images WWW= https://github.com/Achno/gowall LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libffi.so:devel/libffi \ libmupdf.so:graphics/mupdf RUN_DEPENDS= xdg-open:devel/xdg-utils USES= go:modules GO_MODULE= github.com/Achno/${PORTNAME} CGO_LDFLAGS+= -lmupdf -lffi # utils/error.go:15:18: non-constant format string in call to ... TESTING_UNSAFE= yes PLIST_FILES= bin/${PORTNAME} -OPTIONS_DEFAULT= PNGQUANT PREVIEW UPSCALE +OPTIONS_DEFAULT= ONNX PNGQUANT PREVIEW UPSCALE OPTIONS_GROUP= COMPRESSION FEATURES OCR OPTIONS_GROUP_COMPRESSION= PNGQUANT -OPTIONS_GROUP_FEATURES= PREVIEW UPSCALE +OPTIONS_GROUP_FEATURES= ONNX PREVIEW UPSCALE OPTIONS_GROUP_OCR= TESSERACT +ONNX_DESC= Install onnxruntime for background removal with AI models PNGQUANT_DESC= Install pngquant PNG image compression method PREVIEW_DESC= Install chafa for image previewing support in terminal TESSERACT_DESC= Install Tesseract OCR Engine for extracting text from an image or pdf UPSCALE_DESC= Install upscaler for upscaling and enhancing images +ONNX_RUN_DEPENDS= onnxruntime>=0:misc/onnxruntime PNGQUANT_RUN_DEPENDS= pngquant:graphics/pngquant PREVIEW_RUN_DEPENDS= chafa:graphics/chafa TESSERACT_RUN_DEPENDS= tesseract:graphics/tesseract UPSCALE_RUN_DEPENDS= upscaler:graphics/upscaler post-patch: - @${REINPLACE_CMD} -e '23s,([^()]*),("${LOCALBASE}/bin"),g' \ + @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ + ${WRKSRC}/internal/backends/onnx/setup.go \ ${WRKSRC}/internal/image/upscale.go .include .if ${ARCH} == "i386" EXTRA_PATCHES= ${PATCHDIR}/i386/extra-patch-vendor_github.com_gen2brain_go-fitz_fitz__cgo.go .endif .include diff --git a/graphics/gowall/distinfo b/graphics/gowall/distinfo index 6f9636659c15..37ae081181a4 100644 --- a/graphics/gowall/distinfo +++ b/graphics/gowall/distinfo @@ -1,5 +1,7 @@ -TIMESTAMP = 1760285357 -SHA256 (go/graphics_gowall/gowall-v0.2.3/v0.2.3.mod) = 7a4f2e628182dc4e3bec87f4f1fef9f399fa8d744220297b7b17dfe6835f338c -SIZE (go/graphics_gowall/gowall-v0.2.3/v0.2.3.mod) = 2289 -SHA256 (go/graphics_gowall/gowall-v0.2.3/v0.2.3.zip) = 3bdff68aad21129c387d7720fc5f7474fd89b8e20d514e10141dae20e6873342 -SIZE (go/graphics_gowall/gowall-v0.2.3/v0.2.3.zip) = 3410684 +TIMESTAMP = 1779731147 +SHA256 (go/graphics_gowall/gowall-v0.2.4/v0.2.4.mod) = fc3a1535416ceb02476217e9781db9350ac612bf1ae8f0efa0375c348fa943d9 +SIZE (go/graphics_gowall/gowall-v0.2.4/v0.2.4.mod) = 2634 +SHA256 (go/graphics_gowall/gowall-v0.2.4/v0.2.4.zip) = 55be33e8fd3c26ff73d57b59b6aed2212e10ae633a63e441849c6040afefd221 +SIZE (go/graphics_gowall/gowall-v0.2.4/v0.2.4.zip) = 3449397 +SHA256 (go/graphics_gowall/gowall-v0.2.4/fdf8f677cbc3b5931df3527e1dbd218625f49e7e.patch) = 3b79fa283bfe19a470328f1d6708c74f5ec84544cd02218aa0e0109e347309f0 +SIZE (go/graphics_gowall/gowall-v0.2.4/fdf8f677cbc3b5931df3527e1dbd218625f49e7e.patch) = 2982 diff --git a/graphics/gowall/files/patch-internal_backends_compression_png_setup.go b/graphics/gowall/files/patch-internal_backends_compression_png_setup.go deleted file mode 100644 index ff6a552b412c..000000000000 --- a/graphics/gowall/files/patch-internal_backends_compression_png_setup.go +++ /dev/null @@ -1,10 +0,0 @@ ---- internal/backends/compression/png/setup.go.orig 2025-10-12 17:20:54 UTC -+++ internal/backends/compression/png/setup.go -@@ -76,6 +76,7 @@ func CheckPngquantInstalled() (string, error) { - "linux": config.PngquantBinaryName, - "windows": config.PngquantBinaryName + ".exe", - "darwin": config.PngquantBinaryName, -+ "freebsd": config.PngquantBinaryName, - } - - destFolder := filepath.Join(config.GowallConfig.OutputFolder, "compression", "pngquant") diff --git a/graphics/gowall/files/patch-internal_image_upscale.go b/graphics/gowall/files/patch-internal_image_upscale.go deleted file mode 100644 index ab402d78c440..000000000000 --- a/graphics/gowall/files/patch-internal_image_upscale.go +++ /dev/null @@ -1,19 +0,0 @@ ---- internal/image/upscale.go.orig 1979-11-30 00:00:00 UTC -+++ internal/image/upscale.go -@@ -7,7 +7,7 @@ import ( - "os/exec" - "path/filepath" - -- "github.com/Achno/gowall/config" -+ // "github.com/Achno/gowall/config" - imageio "github.com/Achno/gowall/internal/image_io" - types "github.com/Achno/gowall/internal/types" - "github.com/Achno/gowall/internal/upscaler" -@@ -35,6 +35,7 @@ func (p *UpscaleProcessor) Process(img image.Image, th - "windows": "realesrgan-ncnn-vulkan.exe", - "darwin": "realesrgan-ncnn-vulkan", - "linux": "realesrgan-ncnn-vulkan", -+ "freebsd": "realesrgan-ncnn-vulkan", - } - - binary, err := utils.FindBinary(binaryNames, destFolder)