On Wed, Jul 21, 2021 at 04:54:17PM +0200, Marc Espie wrote:
> I've recently become MASSIVELY dissatisfied with some port rules.
> 
> Specifically, the ordering of Makefile.template.
> 
> I feel that, when you create a port from scratch, it doesn't match
> AT ALL the order in which you fill fields.
> 
> 
> I don't think it fits my workflow at all.
> 
> This isn't really surprising, for a lot of reasons.
> 
> - Makefile.template grew in haphazard ways
> - each commit tried to add something in a location that was easy to explain.
> 
> My current opinion is, if we want to (more or less) enforce the ordering of
> Makefile.template, we ought to make it match a reasonable workflow.
> 
> I don't think it does! right now.
> 
> Yeah, I'm a special case. I write ports from scratch (after all, I wrote
> MOST of the infrastructure behind it), and currently the Makefile.template
> order is more of a hindrance than help.
> 
> Thus, I welcome actual workflow inputs.
> 
> Stuff I'd like is ACTUAL Makefiles for new ports, where you added
> new stuff IN THE ORDER you thought of it... Assuming you use the 
> documentation as a template.
> 
> If you're used to copying Makefile.template, THEN uncomment parts, I *urge*
> you to write a Makefile from scratch, have Makefile.template somewhere
> around, and add lines as you figure out that you need them.
> 
> I think that *eventually* we should have a (more or less) standard ordering
> for new ports, but it doesn't have to match the current order of 
> Makefile.template.
> 
> This file is shit, because it serves two purposes:
> - it's expanded documentation more or less taking over from bsd.port.mk(5)
> - it's supposed to tell you where to put stuff.
> 
> As far as I'm concerned, it no longer serves its second purpose AT ALL.
> 
> I do agree that having more or less standard locations for lines in
> Makefiles is a GOOD thing, but the current order of Makefile.template makes
> no sense to me.

I completely agree with that last sentence.

I always wondered why SHARED_LIBS and WANTLIB is so high in the order.
Those are things I figure out at the end of building a port. My workflow
is usually:

1. What am I porting?
2. Where do I need to download it from?
3. How do I need to make the port?
4. What are my dependencies?
5. Are my configuration arguments right?
6. Are my pre/do/post selections correct?
7. Do I have shared libs after a successful build?
8. What does port-lib-depends-check tell me about my WANTLIBS
9. Go back and tweak things, did something complain about me missing the
   COMPILER
10. Reorder everything according to my own cleaed up Makefile.template

That's just off the top of my head. 99% of the time I start with a blank
slate on my ports, as well, and then look to other Makefiles for
suggestions and things I might have missed.

-- 

Tracey Emery

Reply via email to