Unverified Commit 5611feb0 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #270176 from ppenguin/freecad-wayland

freecad: add freecad-wayland to fix native wayland
parents 44aa5aa4 e2514012
Loading
Loading
Loading
Loading
+65 −55
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
, eigen
, fetchFromGitHub
, fmt
, freecad  # for passthru.tests
, freecad
, gfortran
, gts
, hdf5
@@ -30,11 +30,10 @@
, wrapGAppsHook3
, xercesc
, zlib
, withWayland ? false
}:

let
  opencascade-occt = opencascade-occt_7_6;
  boost = python311Packages.boost;
  inherit (libsForQt5)
    qtbase
    qttools
@@ -42,8 +41,11 @@ let
    qtx11extras
    qtxmlpatterns
    soqt
    wrapQtAppsHook;
    wrapQtAppsHook
    ;
  inherit (libsForQt5.qt5) qtwayland;
  inherit (python311Packages)
    boost
    gitpython
    matplotlib
    pivy
@@ -54,7 +56,8 @@ let
    python
    pyyaml
    scipy
    shiboken2;
    shiboken2
    ;
in
stdenv.mkDerivation (finalAttrs: {
  pname = "freecad";
@@ -77,7 +80,8 @@ stdenv.mkDerivation (finalAttrs: {
    wrapGAppsHook3
  ];

  buildInputs = [
  buildInputs =
    [
      gitpython # for addon manager
      boost
      coin3d
@@ -103,6 +107,7 @@ stdenv.mkDerivation (finalAttrs: {
      pyyaml # (at least for) PyrateWorkbench
      qtbase
      qttools
      qtwayland
      qtwebengine
      qtxmlpatterns
      scipy
@@ -112,7 +117,8 @@ stdenv.mkDerivation (finalAttrs: {
      vtk
      xercesc
      zlib
  ] ++ lib.optionals spaceNavSupport [
    ]
    ++ lib.optionals spaceNavSupport [
      libspnav
      qtx11extras
    ];
@@ -127,7 +133,8 @@ stdenv.mkDerivation (finalAttrs: {
    "-DBUILD_QT5=ON"
    "-DSHIBOKEN_INCLUDE_DIR=${shiboken2}/include"
    "-DSHIBOKEN_LIBRARY=Shiboken2::libshiboken"
    ("-DPYSIDE_INCLUDE_DIR=${pyside2}/include"
    (
      "-DPYSIDE_INCLUDE_DIR=${pyside2}/include"
      + ";${pyside2}/include/PySide2/QtCore"
      + ";${pyside2}/include/PySide2/QtWidgets"
      + ";${pyside2}/include/PySide2/QtGui"
@@ -144,11 +151,12 @@ stdenv.mkDerivation (finalAttrs: {
    qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
  '';

  qtWrapperArgs = [
  qtWrapperArgs =
    [
      "--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1"
      "--prefix PATH : ${libredwg}/bin"
    "--set QT_QPA_PLATFORM xcb"
  ];
    ]
    ++ lib.optionals (!withWayland) [ "--set QT_QPA_PLATFORM xcb" ];

  postFixup = ''
    mv $out/share/doc $out
@@ -164,7 +172,9 @@ stdenv.mkDerivation (finalAttrs: {
    # parse argv. This should catch if that ever regresses and also ensures
    # that PYTHONPATH is still respected enough for the FreeCAD console to
    # successfully run and check that it was included in `sys.path`.
    python-path = runCommand "freecad-test-console" {
    python-path =
      runCommand "freecad-test-console"
        {
          nativeBuildInputs = [ freecad ];
        } ''
        HOME="$(mktemp -d)" PYTHONPATH="$(pwd)/test" FreeCADCmd --log-file $out -c "if not '$(pwd)/test' in sys.path: sys.exit(1)" </dev/null
+2 −0
Original line number Diff line number Diff line
@@ -35765,6 +35765,8 @@ with pkgs;
  forge-mtg = callPackage ../games/forge-mtg { };
  freecad-wayland = freecad.override { withWayland = true; };
  freeciv = callPackage ../games/freeciv {
    sdl2Client = false;
    gtkClient = true;