anchor.diff:      fi
     '';
   
  +  nativeBuildInputs = [
  +    installShellFiles
  +    pkg-config
  +    qmake
  +    qttools
  +  ];
  +
  +  buildInputs = [
  +    boost
  +    libGLU
  +    muparser
  +    qtbase
  +    qtscript
  +    qtsvg
  +    qtxmlpatterns
  +  ] ++ lib.optionals stdenv.isDarwin [
  +    qtmacextras
  +  ];
  +
     qmakeFlags = [
       "MUPARSER_DIR=${muparser}"
       "INSTALLROOT=$(out)"
       "BOOST_DIR=${boost.dev}"
     ];
   
  +  qtWrapperArgs =
  +    lib.optionals stdenv.isLinux [ "--prefix LD_LIBRARY_PATH : ${placeholder "out"}/lib" ]
  +    ++
  +    lib.optionals stdenv.isDarwin [ "--prefix DYLD_LIBRARY_PATH : ${placeholder "out"}/lib" ];
  +
     installPhase = ''
       runHook preInstall
   
  -    install -Dm555 -t $out/bin release/qcad-bin
  -    install -Dm555 -t $out/lib release/libspatialindexnavel.so
  -    install -Dm555 -t $out/lib release/libqcadcore.so
  -    install -Dm555 -t $out/lib release/libqcadentity.so
  -    install -Dm555 -t $out/lib release/libqcadgrid.so
  -    install -Dm555 -t $out/lib release/libqcadsnap.so
  -    install -Dm555 -t $out/lib release/libqcadoperations.so
  -    install -Dm555 -t $out/lib release/libqcadstemmer.so
  -    install -Dm555 -t $out/lib release/libqcadspatialindex.so
  -    install -Dm555 -t $out/lib release/libqcadgui.so
  -    install -Dm555 -t $out/lib release/libqcadecmaapi.so
  +  '' + lib.optionalString stdenv.isLinux ''
  +    install -Dm555 release/qcad-bin $out/bin/qcad
  +  '' + lib.optionalString stdenv.isDarwin ''
  +    install -Dm555 release/QCAD.app/Contents/MacOS/QCAD $out/bin/qcad
  +    mkdir -p $out/lib
  +  '' +
  +  ''
  +    install -Dm555 -t $out/lib release/libspatialindexnavel${stdenv.hostPlatform.extensions.sharedLibrary}
  +    install -Dm555 -t $out/lib release/libqcadcore${stdenv.hostPlatform.extensions.sharedLibrary}
  +    install -Dm555 -t $out/lib release/libqcadentity${stdenv.hostPlatform.extensions.sharedLibrary}
  +    install -Dm555 -t $out/lib release/libqcadgrid${stdenv.hostPlatform.extensions.sharedLibrary}
  +    install -Dm555 -t $out/lib release/libqcadsnap${stdenv.hostPlatform.extensions.sharedLibrary}
  +    install -Dm555 -t $out/lib release/libqcadoperations${stdenv.hostPlatform.extensions.sharedLibrary}
  +    install -Dm555 -t $out/lib release/libqcadstemmer${stdenv.hostPlatform.extensions.sharedLibrary}
  +    install -Dm555 -t $out/lib release/libqcadspatialindex${stdenv.hostPlatform.extensions.sharedLibrary}
  +    install -Dm555 -t $out/lib release/libqcadgui${stdenv.hostPlatform.extensions.sharedLibrary}
  +    install -Dm555 -t $out/lib release/libqcadecmaapi${stdenv.hostPlatform.extensions.sharedLibrary}
   
       install -Dm444 -t $out/share/applications qcad.desktop
       install -Dm644 -t $out/share/pixmaps      scripts/qcad_icon.png
  
positive.code: { boost
  , fetchFromGitHub
  , libGLU
  , mkDerivation
  , muparser
  , pkg-config
  , qtbase
  , qmake
  , qtscript
  , qtsvg
  , qtxmlpatterns
  , qttools
  , lib
  , installShellFiles
  }:
  
  mkDerivation rec {
    pname = "qcad";
    version = "3.26.4.10";
  
    src = fetchFromGitHub {
      owner = "qcad";
      repo = "qcad";
      rev = "v${version}";
      sha256 = "sha256-dWpItV18lYjdwUsn2wwA//AUHU5ICGfmih2cJWihvn0=";
    };
  
    patches = [
  
negative.code:     runHook postInstall
    '';
  
    meta = with lib; {
      description = "2D CAD package based on Qt";
      homepage = "https://qcad.org";
  