Page MenuHomeFreeBSD

D56348.diff
No OneTemporary

D56348.diff

diff --git a/graphics/gowall/Makefile b/graphics/gowall/Makefile
--- a/graphics/gowall/Makefile
+++ b/graphics/gowall/Makefile
@@ -1,7 +1,6 @@
PORTNAME= gowall
DISTVERSIONPREFIX= v
-DISTVERSION= 0.2.3
-PORTREVISION= 9
+DISTVERSION= 0.2.4
CATEGORIES= graphics
MAINTAINER= nxjoseph@FreeBSD.org
@@ -25,24 +24,27 @@
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|%%LOCALBASE%%|${LOCALBASE}|g' \
+ ${WRKSRC}/internal/backends/onnx/setup.go \
${WRKSRC}/internal/image/upscale.go
.include <bsd.port.options.mk>
diff --git a/graphics/gowall/distinfo b/graphics/gowall/distinfo
--- a/graphics/gowall/distinfo
+++ b/graphics/gowall/distinfo
@@ -1,5 +1,5 @@
-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 = 1775844109
+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
diff --git a/graphics/gowall/files/patch-internal_backends_onnx_setup.go b/graphics/gowall/files/patch-internal_backends_onnx_setup.go
new file mode 100644
--- /dev/null
+++ b/graphics/gowall/files/patch-internal_backends_onnx_setup.go
@@ -0,0 +1,20 @@
+--- internal/backends/onnx/setup.go.orig 1979-11-30 00:00:00 UTC
++++ internal/backends/onnx/setup.go
+@@ -20,6 +20,8 @@ func SharedLibraryName() string {
+ switch runtime.GOOS {
+ case "linux":
+ return fmt.Sprintf("libonnxruntime.so.%s", onnxRuntimeVersion)
++ case "freebsd":
++ return fmt.Sprintf("libonnxruntime.so")
+ case "darwin":
+ return fmt.Sprintf("libonnxruntime.%s.dylib", onnxRuntimeVersion)
+ case "windows":
+@@ -155,7 +157,7 @@ func CheckOnnxRuntimeInstalled() (string, error) {
+
+ // CheckOnnxRuntimeInstalled checks if the ONNX runtime shared library is available
+ func CheckOnnxRuntimeInstalled() (string, error) {
+- destFolder := config.GowallConfig.OnnxRuntimeFolderPath
++ destFolder := "%%LOCALBASE%%/lib"
+ libName := SharedLibraryName()
+
+ if libName == "" {
diff --git a/graphics/gowall/files/patch-internal_image_upscale.go b/graphics/gowall/files/patch-internal_image_upscale.go
--- a/graphics/gowall/files/patch-internal_image_upscale.go
+++ b/graphics/gowall/files/patch-internal_image_upscale.go
@@ -1,19 +1,28 @@
---- internal/image/upscale.go.orig 1979-11-30 00:00:00 UTC
+--- internal/image/upscale.go.orig 2026-04-10 19:11:58 UTC
+++ internal/image/upscale.go
@@ -7,7 +7,7 @@ import (
- "os/exec"
- "path/filepath"
-
+ "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"
+ imageio "github.com/Achno/gowall/internal/image_io"
+ types "github.com/Achno/gowall/internal/types"
+ "github.com/Achno/gowall/internal/upscaler"
+@@ -20,7 +20,7 @@ func (p *UpscaleProcessor) Process(img image.Image, th
+ }
+
+ func (p *UpscaleProcessor) Process(img image.Image, theme string, format string) (image.Image, types.ImageMetadata, error) {
+- destFolder := filepath.Join(config.GowallConfig.OutputFolder, "upscaler")
++ destFolder := filepath.Join("%%LOCALBASE%%/bin")
+ // setup upscaler if it has not been already
+ if _, err := os.Stat(destFolder); os.IsNotExist(err) {
+
@@ -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",
+ "windows": "realesrgan-ncnn-vulkan.exe",
+ "darwin": "realesrgan-ncnn-vulkan",
+ "linux": "realesrgan-ncnn-vulkan",
+ "freebsd": "realesrgan-ncnn-vulkan",
- }
-
- binary, err := utils.FindBinary(binaryNames, destFolder)
+ }
+
+ binary, err := utils.FindBinary(binaryNames, destFolder)

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 17, 12:09 AM (11 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31629665
Default Alt Text
D56348.diff (5 KB)

Event Timeline