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

include.zip should contain meson.build #1672

Closed
eli-schwartz opened this issue Jul 16, 2019 · 7 comments · Fixed by #1694
Closed

include.zip should contain meson.build #1672

eli-schwartz opened this issue Jul 16, 2019 · 7 comments · Fixed by #1694
Labels
kind: enhancement/improvement state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated state: waiting for PR

Comments

@eli-schwartz
Copy link
Contributor

In order to make it easier to use nlohmann_json everywhere, it would be helpful to provide a unified meson interface to the project. Currently, the choices are:

  • acquire the entire repository, which is very large, and use the meson.build as a subproject
  • use the meson wrapdb to acquire just the header includes. The meson wrapdb is out of date and the wrap itself sucks -- it uses its own meson.build which doesn't include the fix from Disable installation when used as meson subproject #1463
    It's probably fair to say that relying on some thirdparty provider will not be a great way to stay up to date.
  • download include.zip, vendor it into the other project's repository, and manually add the directory to the include paths.

It would be nice to see include.zip more closely resemble the expected use of this repository, except without the large files that aren't needed when simply using it in another project. The simple solution would be to change these lines:

json/Makefile

Lines 594 to 599 in cf8251e

release:
rm -fr release_files
mkdir release_files
zip -9 --recurse-paths --no-extra include.zip $(SRCS)
gpg --armor --detach-sig include.zip
mv include.zip include.zip.asc release_files

And add $(AMALGAMATED_FILE) meson.build to the zipped files.

This should not have any practical effect other than to enable first-class meson wrap support. No one currently using include.zip should notice the very small extra meson.build file, and the additional single_include/ file should be negligible. (784K vs. 1.5M vs. 435M)
Sadly, meson does not have a way to check if a directory exists before declaring an include_directories on it...

@eli-schwartz
Copy link
Contributor Author

@nlohmann,

Would you be interested in such a change? I could submit a PR to implement it if you'd like, but I would first like to know if it is something that you'd be willing to accept.

@nlohmann
Copy link
Owner

Yes, PR welcome!

@eli-schwartz
Copy link
Contributor Author

Done!

@stale
Copy link

stale bot commented Aug 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Aug 30, 2019
@eli-schwartz
Copy link
Contributor Author

eli-schwartz commented Aug 30, 2019

@nlohmann I made a PR but it has been languishing. Could you evaluate it and perhaps merge it?

EDIT: hrm, looks like there has not been a lot of activity since around that time, so I assume this was actually because you didn't happen to have time to do much review in the last month (and it's not just me :p). I shall await further word, then.

@stale stale bot removed the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Aug 30, 2019
@eli-schwartz
Copy link
Contributor Author

On the topic of versions available in Meson WrapDB, currently they only have nlohmann_json v3.3.0 and v3.4.0 available.

There is a PR for v3.5.0 but it's been open since March 1 and isn't going anywhere. So even if I wanted my json-using project to install an extra copy of /usr/include/nlohmann/json.hpp, I wouldn't be able to get a recent one.

@stale
Copy link

stale bot commented Oct 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Oct 2, 2019
@stale stale bot closed this as completed Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement/improvement state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated state: waiting for PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants