aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authorJ08nY2024-08-15 22:36:45 +0200
committerJ08nY2024-08-15 22:36:45 +0200
commit280630ad39983c5e646938d4711bfb0d277cf3fa (patch)
tree28688a19ff6c23f70b22ce17976844363e9de658 /nix
parentcb8a0e0fe322fb45d7d2fc40ebe2af546ec63261 (diff)
downloadECTester-280630ad39983c5e646938d4711bfb0d277cf3fa.tar.gz
ECTester-280630ad39983c5e646938d4711bfb0d277cf3fa.tar.zst
ECTester-280630ad39983c5e646938d4711bfb0d277cf3fa.zip
Diffstat (limited to 'nix')
-rw-r--r--nix/cryptoppshim.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/nix/cryptoppshim.nix b/nix/cryptoppshim.nix
index f526275..2989066 100644
--- a/nix/cryptoppshim.nix
+++ b/nix/cryptoppshim.nix
@@ -1,5 +1,8 @@
{ pkgs, cryptopp }:
with pkgs;
+let
+ dotVersion = builtins.replaceStrings ["_"] ["."] cryptopp.version;
+in
stdenv.mkDerivation {
name = "Crypto++ Shim";
src = ../standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni;
@@ -14,7 +17,12 @@ stdenv.mkDerivation {
make cryptopp
'';
- CRYPTOPP_CXXFLAGS = "-DECTESTER_CRYPTOPP_${cryptopp.version}=1";
+ CRYPTOPP_CXXFLAGS = ''
+ -DECTESTER_CRYPTOPP_${cryptopp.version}=1 \
+ -DECTESTER_CRYPTOPP_MAJOR=${pkgs.lib.versions.major dotVersion} \
+ -DECTESTER_CRYPTOPP_MINOR=${pkgs.lib.versions.minor dotVersion} \
+ -DECTESTER_CRYPTOPP_PATCH=${pkgs.lib.versions.patch dotVersion} \
+ '';
installPhase = ''
mkdir --parents $out/lib