Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions json.spec
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
### RPM external json 3.10.2
### RPM external json 3.11.3
## NOCOMPILER

Source: https://github.com/nlohmann/%{n}/releases/download/v%{realversion}/include.zip
Source: https://github.com/nlohmann/json/archive/refs/tags/v%{realversion}.tar.gz

%prep
%setup -c
%setup -n %{n}-%{realversion}
sed -i -e 's|JSON_BuildTests_INIT ON|JSON_BuildTests_INIT OFF|' CMakeLists.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just add -DJSON_BuildTests=OFF to the cmake line for the same effect (but more robust against future changes)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @sethrj


%build
rm -rf ../build; mkdir ../build; cd ../build
cmake ../%{n}-%{realversion} \
-DCMAKE_INSTALL_PREFIX:PATH="%i" \
-DCMAKE_BUILD_TYPE=%{cmake_build_type} \
-DJSON_MultipleHeaders=OFF

%install
mkdir -p %{i}/include/nlohmann
cp -a include/nlohmann/json_fwd.hpp %{i}/include/nlohmann/
cp -a single_include/nlohmann/json.hpp %{i}/include/nlohmann/
make %makeprocesses VERBOSE=1

%post
%install
cd ../build
make install