Bug 245387

Summary: graphics/libheif: Fails to build EXAMPLES option disabled
Product: Ports & Packages Reporter: Marián Černý <majo-bugs.freebsd.org>
Component: Individual Port(s)Assignee: Mateusz Piotrowski <0mp>
Status: Closed FIXED    
Severity: Affects Some People CC: 0mp, diizzy, feld, fernape, freebsd, pmh, t.m.guymer, tech-lists
Priority: --- Keywords: needs-patch, needs-qa
Version: LatestFlags: 0mp: maintainer-feedback-
koobs: merge-quarterly?
Hardware: Any   
OS: Any   

Description Marián Černý 2020-04-05 21:29:46 UTC
Building libheif with all config options disabled (especially Examples) fails in my system with the following error:

    --- gopath ---
    mkdir -p /src/github.com/strukturag/libheif
    mkdir: /src: Read-only file system

My root filesystem is read only and I don't wont random files to be created.

However even when I create read-write /src, I get an error:
    --- heif-test-go ---
    heif-test.go:39:2: cannot find package "github.com/strukturag/libheif/go/heif" in any of:
            /usr/local/go/src/github.com/strukturag/libheif/go/heif (from $GOROOT)
            /tmp/portbuild/usr/ports/graphics/libheif/work/go/src/github.com/strukturag/libheif/go/heif (from $GOPATH)
    *** [heif-test-go] Error code 1

(I have WRKDIRPREFIX ?= /tmp/portbuild set in /etc/make.conf.)

When I enable Examples (with make config) then the port built without an error.

Also when I change the Makefile and add:

    CONFIGURE_ARGS+=        --disable-go

then the port is build also without an error.
Comment 1 Sebastian Steinmetz 2020-06-02 08:39:42 UTC
Hi Marian,

thanks for the report. I'll have a look together with the upgrade to 1.6.2 in #246921. I agree, it should be possible to do a successful build without examples.

Best,
Sebastain
Comment 2 Thomas Guymer 2020-08-03 19:16:02 UTC
I have just come across this too. I am building with EXAMPLES=off and it fails to build with:

--- heif-test-go ---
heif-test.go:39:2: cannot find package "github.com/strukturag/libheif/go/heif" in any of:
	/usr/local/go/src/github.com/strukturag/libheif/go/heif (from $GOROOT)
	/usr/ports/graphics/libheif/work/go/src/github.com/strukturag/libheif/go/heif (from $GOPATH)
*** [heif-test-go] Error code 1

I can provide the whole build log if you want, but this seems like the most relevant bit to me.
Comment 3 tech-lists 2021-02-16 18:16:15 UTC
I'm getting this as well.

Tried downloading from the source at github and got this:

[...]

ln -sf /../go /src/github.com/strukturag/libheif/
GOPATH= PKG_CONFIG_PATH=/root/test/libheif:/root/test/libheif/libde265/dist/lib/pkgconfig/ CGO_CFLAGS="-I/root/test/libheif" CGO_LDFLAGS="-L/root/test/libheif/libheif/.libs" LD_LIBRARY_PATH=/root/test/libheif/libheif/.libs /usr/local/bin/go build -o heif-test-go heif-test.go
heif-test.go:39:2: cannot find package "github.com/strukturag/libheif/go/heif" in any of:
        /usr/local/go/src/github.com/strukturag/libheif/go/heif (from $GOROOT)
        /root/go/src/github.com/strukturag/libheif/go/heif (from $GOPATH)
*** Error code 1

[...]
Comment 4 tech-lists 2021-02-16 18:27:37 UTC
The problem I'm seeing is that the binaries are never installed. make install doesn't install anything into /usr/local/bin when installing the port. Expect to see heif-convert etc
Comment 5 tech-lists 2021-02-16 18:28:31 UTC
I should say "the problems I'm seeing with the port"
Comment 6 Mark Felder freebsd_committer freebsd_triage 2021-03-23 22:23:43 UTC
*** Bug 253729 has been marked as a duplicate of this bug. ***
Comment 7 Patrick M. Hausen 2022-03-30 20:25:57 UTC
So, when will the option to install the example binaries be integrated into the port?

Thanks,
Patrick
Comment 8 Daniel Engberg freebsd_committer freebsd_triage 2022-03-30 22:56:53 UTC
(In reply to Patrick M. Hausen from comment #7)
It would be great if you could provide a patch
Comment 9 Mateusz Piotrowski freebsd_committer freebsd_triage 2022-07-04 13:32:36 UTC
*** Bug 265029 has been marked as a duplicate of this bug. ***
Comment 10 commit-hook freebsd_committer freebsd_triage 2022-07-04 14:47:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6564fb037602976d7127bf70b0c640d87067dd4b

commit 6564fb037602976d7127bf70b0c640d87067dd4b
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2022-07-04 13:35:09 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2022-07-04 14:46:31 +0000

    graphics/libheif: Install example binaries

    The example binaries are very useful to end users. For example,
    heif-convert is a popular tool to convert HEIF to JPG.

    PR:             245387
    Reported by:    Marián Černý <majo-bugs.freebsd.org@cerny.sk>
    Approved by:    portmgr blanket (maintainer timeout)

 graphics/libheif/Makefile | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)