Patch a port Makefile at build with poudriere

Dear FreeBSD users,
I can't install print/muttprint and graphics/zbar simultaneously because the first require graphics/ImageMagick6 and the second graphics/ImageMagick7.
I am building my packages with ports-mgmt/poudriere and I would like to patch the Makefile of print/muttprint to build it against graphics/ImageMagick7.
I am already applying some patches with my own poudriere makefile /usr/local/etc/poudriere.d/wks-make.conf but I don't know how to patch the print/muttprint Makefile.

Suggestion welcome.
 
Had a look at both ports, graphics/zbar is doing the correct thing (not specifying a version at all).

So, if you just add DEFAULT_VERSIONS+= imagemagick=6 to your make.conf, your immediate problem will be solved.

But I still think the port maintainer of print/muttprint should have a look. It has a questionable X11 option and I'm not sure whether it really strictly needs version 6 ...

For context, see also my recent mail to the ports mailing list:

 
On the topic of local patches, I recommend to leverage git for that:
  • Create a local branch: git checkout -b local
  • Do your changes there and commit them
  • On updates, rebase your branch, e.g. git fetch origin main:main && git rebase main
 
Had a look at both ports, graphics/zbar is doing the correct thing (not specifying a version at all).

So, if you just add DEFAULT_VERSIONS+= imagemagick=6 to your make.conf, your immediate problem will be solved.
Thanks, I will try that. I modified the Makefile of print/muttprint just to see and it works with graphics/ImageMagick7.
I will try your other suggestions about the ports tree but I need to enhance my skill with git ;)
 
Please do that and let me know. If it does work, I'd like to fix that port and create a review for the maintainer to (hopefully) approve.
I already done that by manually changing the Makefile with:
Code:
.if ${PORT_OPTIONS:MX11}
USES+=          magick:7,run
.else
USES+=          magick:7,run,nox11
.endif
The resulting packages seems to work correctly for my needs. I didn't test more further.
 
How is this better than keeping a local diff in a ports git tree?
I'm not sure what you mean by "better", I simply think portshaker is an excellent tool to insert modified ports into a ports tree, especially if that ports tree was created and updated with portsnap --- I don't think git is an option with that. I'm all about automation and my poudriere-builder script inserts my modified ports into my latest ports trees directly after the tree is updated and before the poudriere bulk build starts for various versions of FreeBSD just fine.
 
Back
Top