On 2021/07/12 17:21, Stefan Hagen wrote:
> Stuart Henderson wrote:
> > On 2021/07/12 00:43, Stefan Hagen wrote:
> >> Stuart Henderson wrote:
> >>> I think what's wanted here is probably to get rid of that patch and set
> >>> MAKE_FLAGS= ETCDIR=${SYSCONFDIR}/notion (used during build to tell the
> >>> program where to look for files at runtime ) and then FAKE_FLAGS=
> >>> ETCDIR=$(PREFIX)/share/examples/notion so fake-install copies the
> >>> sample files there. Then use @sample in the PLIST to have pkg_add
> >>> copy the files at install time. This is so that the user can modify the
> >>> files if needed without causing conflicts.
> >>
> >> I took another attempt to actually get your proposal to work. And after
> >> an hour of fighting with PREFIX and DESTDIR it finally started working.
> >>
> >> It looks like this now:
> >>
> >> MAKE_FLAGS=     ETCDIR=$(SYSCONFDIR)/notion
> >> FAKE_FLAGS=     ETCDIR=$(DESTDIR)$(PREFIX)/share/examples/notion
> >
> > That looks pretty standard; please s/DESTDIR/WRKINST/ for the variable
> > which is normally used in ports
> 
> Thanks, done.
> 
> >> PLIST has @sample /etc/notion/* entries.
> 
> > This isn't doing what you want, @sample refers to the previous installed
> > file, i.e.
> >
> > share/notion/welcome.txt
> > @sample file1
> 
> Ahhh right. I figured it out before checking mails today. I assumed the 
> source files must exist in the fake installation, that's why I added the
> post-install step.
> 
> This is not necessary then. It works as expected now.
> 
> I snug in another little change, which is removing the escape characters
> from welcome.txt. On the first start, notion displays it with xmessage,
> which doesn't like escape characters.
> 
> I finally feel good about this port and learned quite a bit about the 
> port system.
> 
> Port attached, again.
> 
> Best Regards,
> Stefan

Here it is again with some tweaks;

- use mandoc instead of nroff
- set NOTION_RELEASE to avoid a sed GNUism
- switch mandir patch to MAKE_FLAGS
- remove pre-patch DESTDIR seds that weren't helping
- set NOTION_DIR and subst in PLIST (it just makes the origin and
@sample lines the same length so it's easier to visually scan for
problems)
- the replacement FILTERCRAP using sed didn't work quite right,
the lua one seems to work fine (col -b would be the "right" thing
to use here, but if the original command works then I'd prefer to
avoid patching)
- patch default config to avoid keybindings with capslock to avoid
a startup error if you have remapped capslock to ctrl. I think users
are likely enough to hit this that we need to do something about it,
though I would also be open to mentioning it in a pkg-readme if
you think it would be better to keep the config at defaults.


I've added a comment here too; there's a proper mechanism for setting
the lua version in their make scaffolding, but it doesn't work with the
filenames used in our lua ports. I'd like to fix that sometime and use
the same names everyone else uses but that needs testing with all
lua-using ports so just marking it for now.

+# XXX should set LUA_VERSION in MAKE_FLAGS instead, but that doesn't work
+# with our non-standard lua binary/pkg-config naming scheme
+pre-configure:
        sed -e 's/5\.3\ 5\.2 5\.1/$(MODLUA_DEP_VERSION)/g' -i \
                $(WRKSRC)/build/lua-detect.mk


This version is OK sthen@ to import.

Attachment: notion.tgz
Description: application/tar-gz

Reply via email to