diff options
author | Evils <evils.devils@protonmail.com> | 2021-01-23 10:58:33 +0100 |
---|---|---|
committer | Evils <evils.devils@protonmail.com> | 2021-05-14 09:03:53 +0200 |
commit | e2661b00f7b8cf1fdfa0b637375d901c5717e2a2 (patch) | |
tree | d6cdb4cad3a866554731b7284e7d8d3e9d030fc0 /pkgs/applications/science/electronics/kicad | |
parent | e37d772beb4aeb47dce8bc31e4320e679b65a854 (diff) |
kicad: add sanitizeAddress & sanitizeThreads options
only kicad 5.99 or later are affected
was briefly -DKICAD_SANITIZE=ON
are mutually exclusive according to a compiler error
Diffstat (limited to 'pkgs/applications/science/electronics/kicad')
-rw-r--r-- | pkgs/applications/science/electronics/kicad/base.nix | 12 | ||||
-rw-r--r-- | pkgs/applications/science/electronics/kicad/default.nix | 5 |
2 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/applications/science/electronics/kicad/base.nix b/pkgs/applications/science/electronics/kicad/base.nix index 931202a1f89f..9848eb58399d 100644 --- a/pkgs/applications/science/electronics/kicad/base.nix +++ b/pkgs/applications/science/electronics/kicad/base.nix @@ -50,12 +50,18 @@ , withNgspice , withScripting , debug +, sanitizeAddress +, sanitizeThreads , withI18n }: assert lib.asserts.assertMsg (!(withOCE && stdenv.isAarch64)) "OCE fails a test on Aarch64"; assert lib.asserts.assertMsg (!(withOCC && withOCE)) "Only one of OCC and OCE may be enabled"; +assert lib.assertMsg (!(stable && (sanitizeAddress || sanitizeThreads))) + "Only kicad-unstable(-small) supports address/thread sanitation"; +assert lib.assertMsg (!(sanitizeAddress && sanitizeThreads)) + "'sanitizeAddress' and 'sanitizeThreads' are mutually exclusive, use one."; let inherit (lib) optional optionals; in @@ -98,6 +104,12 @@ stdenv.mkDerivation rec { "-DCMAKE_BUILD_TYPE=Debug" "-DKICAD_STDLIB_DEBUG=ON" "-DKICAD_USE_VALGRIND=ON" + ] + ++ optionals (sanitizeAddress) [ + "-DKICAD_SANITIZE_ADDRESS=ON" + ] + ++ optionals (sanitizeThreads) [ + "-DKICAD_SANITIZE_THREADS=ON" ]; nativeBuildInputs = [ diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix index e8cb749268fd..79a044a800c5 100644 --- a/pkgs/applications/science/electronics/kicad/default.nix +++ b/pkgs/applications/science/electronics/kicad/default.nix @@ -25,6 +25,8 @@ , withScripting ? true , python3 , debug ? false +, sanitizeAddress ? false +, sanitizeThreads ? false , with3d ? true , withI18n ? true , srcs ? { } @@ -162,7 +164,8 @@ stdenv.mkDerivation rec { inherit kicadSrc kicadVersion; inherit (passthru) i18n; inherit wxGTK python wxPython; - inherit debug withI18n withOCC withOCE withNgspice withScripting; + inherit withI18n withOCC withOCE withNgspice withScripting; + inherit debug sanitizeAddress sanitizeThreads; }; inherit pname; |