Package Details: nlohmann-json-bin 3.7.3-1

Git Clone URL: (read-only, click to copy)
Package Base: nlohmann-json-bin
Description: Header-only JSON library for Modern C++ (quick installation without testing)
Upstream URL:
Keywords: c++ json nlohmann
Licenses: MIT
Conflicts: nlohmann-json, nlohmann-json-git
Provides: nlohmann-json
Submitter: bus
Maintainer: bus
Last Packager: bus
Votes: 5
Popularity: 0.137052
First Submitted: 2018-02-08 17:02
Last Updated: 2019-11-17 11:51

Dependencies (0)

Required by (12)

Sources (5)

Latest Comments

1 2 Next › Last »

dsonck92 commented on 2019-10-15 21:59

Yeah, after finally reading through everything. I suggest dropping in config and targets as extra sources to complete the cmake config. I would not consider it compiled sources, and still fit under patching it to work. With lack of upstream fixing it this option would be the best to make it compatible.

dsonck92 commented on 2019-10-14 17:08

Well, turns out, I was making it somewhat too simplified so it actually failed my own builds. But upon closer inspection of the config file generated by cmake in the regular version, it seems like it's still very simple and mostly hand written even:

The only thing cmake "configures" at the file is how he names the library, and some basic version stuff. All pretty "fixed" once installed. So if you could instead use this, that would be effectively the same as the non -bin version.

bus commented on 2019-10-12 06:39

@dsonck92 Thanks. I put the necessary CMake files in the tree. I tested the changes by building mtxclient and xeus packages and they succeeded, so hopefully everything works now.

dsonck92 commented on 2019-10-11 21:41

Actually, just realized that only a full-fledged nlohmann_json-config.cmake is allowed to be installed to cmake system libraries, or at least that's the convention. Find...cmake is supposed to be supplied by the depending package itself inside their own sources (as only kodi-addon-pvr-vuplus-git does).

It is still possible to provide said package as they are not terribly difficult to write:

bus commented on 2019-10-11 18:44

@dsonck92 Well, if you could help out with this CMake business that'd be great. I'm no good at it.

dsonck92 commented on 2019-10-11 18:02

at time of writing:

  • xeus
  • nheko
  • mtxclient (at least as far as I can tell from the CMakeLists.txt they wrote) the kodi-addon-pvr-vuplus-git actually provides a FindNlohmannJson.

Another approach is to add that file as source and install it to the cmake module directory.

However, it would be advisable to create a modern version of this file (one that does add_library(nlohmann_json external) and adds an appropriate alias for it.) I can create such a file as I also benefit from using this bin package compared to the other one. Currently my CI server "builds" the other one to an archlinux docker, which means that each roll of archlinux would actually mean a complete rebuild of all tests (due to how docker is not entirely compatible with just doing an archlinux update)

bus commented on 2019-10-11 02:08

@dsonck92 I found out about this a few months after putting up the package. The first thing I did was test some packages that depend on nlohmann-json to see if they would break when built with this package. Unfortunately, I remember finding at least one that broke (but most did not).

I tried looking into ways of somehow providing the required CMake files, but since they aren't found in the repo or in any release archives I'd have to compile the library myself and include the files in the package tree. At the time I looked this was against the rules of AUR, but I'm not sure if that's correct. So I gave up and hoped no one would notice.

dsonck92 commented on 2019-10-10 19:26

I do want to point out (for anyone wondering whether this is a drop-in replacement of the other nlohmann-json) that this does not include the required CMake configuration files. It is essentially the zip (intended to be included inside projects instead of global) installed to /usr/include.

Practically, it does mean that you can just blindly rely on #include <nlohmann/json.hpp> to do the right thing, but any project using find_package(nlohmann_json REQUIRED) will fail (like my own projects). I rather not force those kinds of projects to not use find_package. Normally it would work, and also allow for completely different install locations.

It might be worthwhile to not let this "provide" nlohmann-json, as it's not a complete package (compared to the nlohmann-json and nlohmann-json-git PKGBUILDs). While I'm not aware of all conventions within Archlinux (like what are appropriate provides conventions), I would rather say this provides nlohmann-json-includes (instead of provides nlohmann-json). The others can then also have nlohmann-json-includes as provides, and have appropriate conflicts with this.

A totally different approach is to include the missing CMake files, but that might be more hack-y than this, as they get generated during the CMake configuration step.

Krasauskas commented on 2019-03-21 14:22

@bus Holy balls, batman, that was quick! Thanks a million!

bus commented on 2019-03-21 14:08

@Krasauskas Sorry, should be fixed now. If the error persists, you should clear the build directory of this package (location of which depends on which AUR helper you use).