Commit d8020e1e authored by Evils's avatar Evils
Browse files

kicad: remove withOCC and more cmakeFlags cleanup

OCC is no longer optional
RPATH apparently no longer contains references to /build/
KICAD_SCRIPTING_WXPYTHON is ON by default

sort some of the options a bit

and remove stray lndir
parent 788df545
Loading
Loading
Loading
Loading
+7 −19
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
, pcre
, libpthreadstubs
, libXdmcp
, lndir
, unixODBC

, util-linux
@@ -47,7 +46,6 @@
, baseName
, kicadSrc
, kicadVersion
, withOCC
, withNgspice
, withScripting
, withI18n
@@ -84,39 +82,30 @@ stdenv.mkDerivation rec {
  makeFlags = optionals (debug) [ "CFLAGS+=-Og" "CFLAGS+=-ggdb" ];

  cmakeFlags = [
    # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
    "-DCMAKE_SKIP_BUILD_RPATH=ON"
    "-DKICAD_USE_EGL=ON"
    "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;qa_eeschema'"  # upstream issue 12491
  ]
  ++ optionals (withScripting) [
    "-DKICAD_SCRIPTING_WXPYTHON=ON"
    "-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade"
  ]
  ++ optionals (!withScripting) [
    "-DKICAD_SCRIPTING_WXPYTHON=OFF"
  ]
  ++ optional (!withNgspice) "-DKICAD_SPICE=OFF"
  ++ optional (!withOCC) "-DKICAD_USE_OCC=OFF"
  ++ optionals (withOCC) [
    "-DKICAD_USE_OCC=ON"
    "-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade"
  ++ optionals (withI18n) [
    "-DKICAD_BUILD_I18N=ON"
  ]
  ++ optionals (!doInstallCheck) [
    "-DKICAD_BUILD_QA_TESTS=OFF"
  ]
  ++ optionals (debug) [
    "-DCMAKE_BUILD_TYPE=Debug"
    "-DKICAD_STDLIB_DEBUG=ON"
    "-DKICAD_USE_VALGRIND=ON"
  ]
  ++ optionals (!doInstallCheck) [
    "-DKICAD_BUILD_QA_TESTS=OFF"
  ]
  ++ optionals (sanitizeAddress) [
    "-DKICAD_SANITIZE_ADDRESS=ON"
  ]
  ++ optionals (sanitizeThreads) [
    "-DKICAD_SANITIZE_THREADS=ON"
  ]
  ++ optionals (withI18n) [
    "-DKICAD_BUILD_I18N=ON"
  ];

  nativeBuildInputs = [
@@ -124,7 +113,6 @@ stdenv.mkDerivation rec {
    doxygen
    graphviz
    pkg-config
    lndir
  ]
  # wanted by configuration on linux, doesn't seem to affect performance
  # no effect on closure size
@@ -163,10 +151,10 @@ stdenv.mkDerivation rec {
    python
    unixODBC
    libdeflate
    opencascade-occt
  ]
  ++ optional (withScripting) wxPython
  ++ optional (withNgspice) libngspice
  ++ optional (withOCC) opencascade-occt
  ++ optional (debug) valgrind;

  # debug builds fail all but the python test
+1 −2
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@

, pname ? "kicad"
, stable ? true
, withOCC ? true
, withNgspice ? !stdenv.isDarwin
, libngspice
, withScripting ? true
@@ -117,7 +116,7 @@ stdenv.mkDerivation rec {
    inherit stable baseName;
    inherit kicadSrc kicadVersion;
    inherit wxGTK python wxPython;
    inherit withOCC withNgspice withScripting withI18n;
    inherit withNgspice withScripting withI18n;
    inherit debug sanitizeAddress sanitizeThreads;
  };