Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re2c should install unicode_categories.re somewhere #253

Closed
terpstra opened this issue Aug 5, 2019 · 6 comments

Comments

@terpstra
Copy link

commented Aug 5, 2019

Firstly, re2c v1.2 is great!

I am now using more than half of the new feature included in that release:

  • the new EOF rule made it easy to be 8-bit clean (before I terminated on nulls)
  • using include files let me shared unicode definitions between files
  • i ditched all my \uxxxx escapes and now use input-encoding utf8
  • the new difference operator on utf8 charsets saved me several very large classes
  • i eliminated my 're2c; mv' work-arounds for 're2c -o'

My only complaint: because re2c does not install 'unicode_categories.re', I had to copy that file into my own source repository. I would have preferred to just include re2c's installed copy in my build flow.

@skvadrik

This comment has been minimized.

Copy link
Owner

commented Aug 5, 2019

@terpstra , you should really thank yourself for asking for all those features. :D

I'm a bit uncertain whether re2c should install unicode_categories.re in the usual include path like /usr/include. If yes, then it is only a matter of adding the file to include_HEADERS Automake variable, as described here.

@terpstra

This comment has been minimized.

Copy link
Author

commented Aug 5, 2019

If you're asking my opinion, then I think you should put it into /usr/share/re2c/stdlib.

From the manual of automake:

pkgdatadir

The directory for installing idiosyncratic read-only architecture-independent data files for this program. This is usually the same place as ‘datarootdir’, but we use the two separate variables so that you can move these program-specific files without altering the location for Info files, man pages, etc.

The default is $(datarootdir).

The definition of ‘datadir’ is the same for all packages, so you should install your data in a subdirectory thereof. Most packages install their data under $(datadir)/package-name/.

@terpstra

This comment has been minimized.

Copy link
Author

commented Aug 5, 2019

To do this, you need:

 pkgstdlibdir = $(pkgdatadir)/re2c/stdlib
 dist_pkgstdlib_DATA = $(srcdir)/include/*.re
@terpstra

This comment has been minimized.

Copy link
Author

commented Aug 6, 2019

As a bonus feature, you could/should automatically search this 'stdlib' directory when processing re2c include directives. Otherwise, you would need a mechanism (like pkg-config) to inform the user about where re2c was installed (/usr, /usr/local, /opt/local, ...) in order to set the correct '-I' when invoking re2c.

skvadrik added a commit that referenced this issue Aug 7, 2019

Install standard library files in $(datadir)/re2c/stdlib and search f…
…or include files in this location.

This fixes bug #253 "re2c should install unicode_categories.re somewhere"
(reported by Wesley W. Terpstra).
@skvadrik

This comment has been minimized.

Copy link
Owner

commented Aug 7, 2019

@terpstra I did as you suggested (c3880fc), except that I used $(datadir)/re2c/stdlib instead of $(pkgdatadir)/re2c/stdlib --- the latter implicitly adds /re2c. Special thanks for reminding me to use this location when looking for include files.

@skvadrik

This comment has been minimized.

Copy link
Owner

commented Aug 11, 2019

Released re2c-1.2.1 with the fix. Closing the bug for now.

@skvadrik skvadrik closed this Aug 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.