Page MenuHomeFreeBSD

graphics/freeimage: Add pkgconf support
ClosedPublic

Authored by eduardo on Mar 17 2021, 7:58 AM.

Details

Summary
graphics/freeimage: Add pkgconf support

While here:
  - Take MAINTAINER'ship
  - reorder Makefile (portclippy)
PR:		254340
Submitted by:	Freddy DISSAUX <dsx@bsdsx.fr>
Approved by:	dbaio, garga (mentors)
Differential Revision:	https://reviews.freebsd.org/D29311
Test Plan
$ portlint -C
looks fine

$ pkgconf --modversion freeimage
3.18.0
$ pkgconf --libs freeimage
-L/usr/local/lib -lfreeimage
$ pkgconf --cflags freeimage
-I/usr/local/include

poudriere bulk -f freeimage-consumers.list

114amd64 11.4-RELEASE-p8 amd64
114i386 11.4-RELEASE-p8 i386
122amd64 12.2-RELEASE-p4 amd64
122i386 12.2-RELEASE-p4 i386
140amd64 14.0-CURRENT amd64
140i386 14.0-CURRENT i386

poudriere testport logs

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

eduardo edited the summary of this revision. (Show Details)
eduardo edited the summary of this revision. (Show Details)

This issue first appeared when updating graphics/imv to 4.2.0 that changed to meson/pkgconf and it failed building with freeimage (option):
"library 'freeimage' not found.

https://github.com/eXeC64/imv/issues/323

garga requested changes to this revision.Mar 17 2021, 1:43 PM

PR line on commit log must contain only PR number instead of full URL. While touching it please add missed newline chars

This revision now requires changes to proceed.Mar 17 2021, 1:43 PM

PR line on commit log must contain only PR number instead of full URL. While touching it please add missed newline chars

Looks like some kind of review interface bug, I was forced to remove "-" from first list of port changes.

PR line on commit log must contain only PR number instead of full URL. While touching it please add missed newline chars

Looks like some kind of review interface bug, I was forced to remove "-" from first list of port changes.

If you start all these lines with 2 spaces, as I did, it will show all block with fixed font and will respect text

If you start all these lines with 2 spaces, as I did, it will show all block with fixed font and will respect text

Nice, from now on I will use it this way

dbaio requested changes to this revision.Mar 21 2021, 2:17 PM

This update seems simple, but as there are many ports that depends on it, a good practice is doing tests for consumers as well.

https://www.freshports.org/graphics/freeimage

You can do a poudriere bulk -f /tmp/freeimage-consumers-list.txt for instance.
or check manually a few of them... well, more tests the better.

Let us know about your tests.

Makefile
39 ↗(On Diff #85879)

PREFIX is added by the default here, you don't need this.

Check with
$ make -V SUB_LIST

57 ↗(On Diff #85879)

What about a blank line separating this?

files/freeimage.pc.in
1 ↗(On Diff #85879)

Use %%PREFIX%% here

dbaio retitled this revision from graphics/freeimage: adopt/add pkgconf support to graphics/freeimage: Add pkgconf support.Mar 21 2021, 2:20 PM
dbaio edited the summary of this revision. (Show Details)
  • separate PLIST_FILES block from PKGCONFIGDIR with a blank line
  • use prefix=%%PREFIX%% in files/freeimage.pc.in
eduardo marked 2 inline comments as done.EditedMar 22 2021, 7:48 AM

This update seems simple, but as there are many ports that depends on it, a good practice is doing tests for consumers as well.

https://www.freshports.org/graphics/freeimage

You can do a poudriere bulk -f /tmp/freeimage-consumers-list.txt for instance.
or check manually a few of them... well, more tests the better.

Let us know about your tests.

I've started poudriere bulk -f /tmp/logs/freeimage-consumers-list.txt for:
140amd64, 140i386, 122amd64, 122i386, 114amd64 and 114i386.
I will post results when it's done.

Makefile
39 ↗(On Diff #85879)

with prefix="${PREFIX}" line, make -V SUB_LIST gives:

prefix="/usr/local"  name="freeimage"  description="Simple C/C++ bitmap graphics library"  version="3.18.0" PREFIX=/usr/local LOCALBASE=/usr/local  DATADIR=/usr/local/share/freeimage DOCSDIR=/usr/local/share/doc/freeimage EXAMPLESDIR=/usr/local/share/examples/freeimage  WWWDIR=/usr/local/www/freeimage ETCDIR=/usr/local/etc/freeimage

without prefix="${PREFIX}" line,  make -V SUB_LIST gives:

PREFIX=/usr/local LOCALBASE=/usr/local DATADIR=/usr/local/share/freeimage DOCSDIR=/usr/local/share/doc/freeimage EXAMPLESDIR=/usr/local/share/examples/freeimage WWWDIR=/usr/local/www/freeimage ETCDIR=/usr/local/etc/freeimage

Are you sure that I can delete this line?
Makefile
39 ↗(On Diff #85879)

I was referring just the prefix variable.

eduardo edited the test plan for this revision. (Show Details)
dbaio requested changes to this revision.Mar 27 2021, 6:10 PM

@eduardo I've seen you have posted all build logs, I imagine this was a good exercise, thanks!

In future you don't need to show all logs (from the consumers) for us, just say if it is ok, test a few of them, that's it.

To proceed here, remove the variable prefix="${PREFIX}" and exec another poudriere testport in graphics/freeimage, update your patch and let us know.

This revision now requires changes to proceed.Mar 27 2021, 6:10 PM

@eduardo I've seen you have posted all build logs, I imagine this was a good exercise, thanks!

In future you don't need to show all logs (from the consumers) for us, just say if it is ok, test a few of them, that's it.

To proceed here, remove the variable prefix="${PREFIX}" and exec another poudriere testport in graphics/freeimage, update your patch and let us know.

I've tested removing prefix="${PREFIX}" variable but pkgconf doesn't find freeimage:

% pkgconf --modversion freeimage
%%version%%
% pkgconf --modversion freeimage
%%version%%
% pkgconf --cflags freeimage
-I/usr/local/include
Makefile
39 ↗(On Diff #85879)

Ok, let me think:
prefix="${PREFIX}"
And I should remove PREFIX?
prefix=
Is this correct syntax?

I'm not saying for you to remove the prefix variable from the files/freeimage.pc.in.

What I said is to remove the prefix="${PREFIX}" from the Makefile.

From:

SUB_LIST= prefix="${PREFIX}" \
    name="${PORTNAME}" \
    description="${COMMENT}" \
    version="${PORTVERSION}"

To:

SUB_LIST= name="${PORTNAME}" \
    description="${COMMENT}" \
    version="${PORTVERSION}"

In the files/freeimage.pc.in you are already using prefix=%%PREFIX%% as I pointed to you in my first comment here.

PREFIX is a variable that exists in SUB_LIST by default.

Do you understand what is happening in the files/freeimage.pc.in?

Just in case, take a look on Porters Handbook: using-sub-files.

remove prefix="${PREFIX}" from SUB_LIST

Could you please apply this patch and test the following commands?

$ pkgconf --modversion freeimage
$ pkgconf --libs freeimage
$ pkgconf --cflags freeimage

before I do poudriere testport?

remove prefix="${PREFIX}" from SUB_LIST

Could you please apply this patch and test the following commands?

$ pkgconf --modversion freeimage
$ pkgconf --libs freeimage
$ pkgconf --cflags freeimage

before I do poudriere testport?

$ pkgconf --modversion freeimage
3.18.0

$ pkgconf --libs freeimage
-L/usr/local/lib -lfreeimage

$ pkgconf --cflags freeimage
-I/usr/local/include
eduardo marked an inline comment as done.EditedMar 29 2021, 12:58 PM

remove prefix="${PREFIX}" from SUB_LIST

Could you please apply this patch and test the following commands?

$ pkgconf --modversion freeimage
$ pkgconf --libs freeimage
$ pkgconf --cflags freeimage

before I do poudriere testport?

$ pkgconf --modversion freeimage
3.18.0

$ pkgconf --libs freeimage
-L/usr/local/lib -lfreeimage

$ pkgconf --cflags freeimage
-I/usr/local/include

Maybe a local problem for me then:

% pkgconf --modversion freeimage
%%version%%
% pkgconf --modversion freeimage
%%version%%
% pkgconf --cflags freeimage
-I/usr/local/include

I've added poudriere tesport logs in Test Plan seccion.
And I've tested graphics/imv 4.2.0 with succsess, meson finds freeimage jiust fine.

remove prefix="${PREFIX}" from SUB_LIST

Could you please apply this patch and test the following commands?

$ pkgconf --modversion freeimage
$ pkgconf --libs freeimage
$ pkgconf --cflags freeimage

before I do poudriere testport?

$ pkgconf --modversion freeimage
3.18.0

$ pkgconf --libs freeimage
-L/usr/local/lib -lfreeimage

$ pkgconf --cflags freeimage
-I/usr/local/include

Maybe a local problem for me then:

% pkgconf --modversion freeimage
%%version%%
% pkgconf --modversion freeimage
%%version%%
% pkgconf --cflags freeimage
-I/usr/local/include

Yeah, that's not right, but check inside a jail with the Interactive mode:

$ sudo poudriere testport -j 14-amd64 -p head -o graphics/freeimage -I
$ sudo jexec 14-amd64-head-n env -i TERM=$TERM /usr/bin/login -fp root
...
root@14-amd64-head:~ # cat /usr/local/libdata/pkgconfig/freeimage.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: freeimage
Description: Simple C/C++ bitmap graphics library
Version: 3.18.0
Libs: -L${libdir} -lfreeimage
Cflags: -I${includedir}

root@14-amd64-head:~ # exit
$sudo poudriere jail -k -j 14-amd64 -p head

I did more tests here and it seems fine as it is.

Maybe a local problem for me then:

% pkgconf --modversion freeimage
%%version%%
% pkgconf --modversion freeimage
%%version%%
% pkgconf --cflags freeimage
-I/usr/local/include

Yeah, that's not right, but check inside a jail with the Interactive mode:

$ sudo poudriere testport -j 14-amd64 -p head -o graphics/freeimage -I
$ sudo jexec 14-amd64-head-n env -i TERM=$TERM /usr/bin/login -fp root
...
root@14-amd64-head:~ # cat /usr/local/libdata/pkgconfig/freeimage.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: freeimage
Description: Simple C/C++ bitmap graphics library
Version: 3.18.0
Libs: -L${libdir} -lfreeimage
Cflags: -I${includedir}

root@14-amd64-head:~ # exit
$sudo poudriere jail -k -j 14-amd64 -p head

I've tested inside jail and it is fine!
Next time I have a similar problem I will test it this way, thanks.

This revision was not accepted when it landed; it landed in state Needs Review.Mar 30 2021, 6:27 AM
This revision was automatically updated to reflect the committed changes.

I received a message saying:
"This revision was not accepted when it landed; it landed in state "Needs Review".",
Did I do something wrong?

This message comes when no reviewer or in your case not all reviewers have accepted a revision but gets committed anyway.