Unverified Commit 493864d6 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

gepetto-viewer: init at 5.1.0 (#324018)

parents 51296fce e4b87b0a
Loading
Loading
Loading
Loading
+69 −0
Original line number Diff line number Diff line
{
  boost,
  cmake,
  doxygen,
  fetchFromGitHub,
  fontconfig,
  gepetto-viewer,
  lib,
  pkg-config,
  python3Packages,
  libsForQt5,
  stdenv,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "gepetto-viewer-corba";
  version = "5.8.0";
  pyproject = false; # CMake

  src = fetchFromGitHub {
    owner = "gepetto";
    repo = "gepetto-viewer-corba";
    rev = "v${finalAttrs.version}";
    hash = "sha256-/bpAs4ca/+QjWEGuHhuDT8Ts2Ggg+DZWETZfjho6E0w=";
  };

  outputs = [
    "out"
    "doc"
  ];

  postPatch = ''
    substituteInPlace src/CMakeLists.txt \
      --replace-fail "ARGUMENTS $" "ARGUMENTS -p${python3Packages.omniorbpy}/${python3Packages.python.sitePackages} $" \
      --replace-fail '$'{CMAKE_SOURCE_DIR}/cmake '$'{JRL_CMAKE_MODULES}
  '';

  buildInputs = [ libsForQt5.qtbase ];

  nativeBuildInputs = [
    cmake
    doxygen
    libsForQt5.wrapQtAppsHook
    pkg-config
    python3Packages.omniorb
  ];

  propagatedBuildInputs = [
    python3Packages.boost
    python3Packages.gepetto-viewer
    python3Packages.omniorbpy
  ];

  doCheck = true;

  # Fontconfig error: Cannot load default config file: No such file: (null)
  env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";

  # Fontconfig error: No writable cache directories
  preBuild = "export XDG_CACHE_HOME=$(mktemp -d)";

  meta = {
    homepage = "https://github.com/gepetto/gepetto-viewer-corba";
    description = "CORBA client/server for gepetto-viewer.";
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.nim65s ];
    platforms = lib.platforms.unix;
  };
})
+136 −0
Original line number Diff line number Diff line
{
  boost,
  cmake,
  darwin,
  doxygen,
  fetchFromGitHub,
  fetchpatch,
  fontconfig,
  lib,
  jrl-cmakemodules,
  libsForQt5,
  makeWrapper,
  openscenegraph,
  osgqt,
  pkg-config,
  python3Packages,
  qgv,
  stdenv,
  runCommand,
}:
let
  gepetto-viewer = stdenv.mkDerivation (finalAttrs: {
    pname = "gepetto-viewer";
    version = "5.1.0";

    src = fetchFromGitHub {
      owner = "gepetto";
      repo = "gepetto-viewer";
      rev = "v${finalAttrs.version}";
      hash = "sha256-A2J3HidG+OHJO8LpLiOEvORxDtViTdeVD85AmKkkOg8=";
    };

    patches = [
      # fix use of CMAKE_INSTALL_BINDIR for $bin output
      (fetchpatch {
        url = "https://github.com/Gepetto/gepetto-viewer/pull/230/commits/9b1b3a61da016934c3e766e6b491c1d6f3fc80d6.patch";
        hash = "sha256-dpviEkOyCZpTYntZ4sCG1AvobljJphPQxg7gA6JxfWs=";
      })
      # fix use of CMAKE_INSTALL_FULL_INCLUDEDIR for $dev output
      (fetchpatch {
        url = "https://github.com/Gepetto/gepetto-viewer/pull/230/commits/4e1c2bbe063db20b605e51495e9f9eca40138cca.patch";
        hash = "sha256-HrecvW1ulCSt9+DUaQVBOoDkilGRqU2+GUx7NUw7hqc=";
      })
    ];

    cmakeFlags = [
      (lib.cmakeBool "BUILD_PY_QCUSTOM_PLOT" (!stdenv.isDarwin))
      (lib.cmakeBool "BUILD_PY_QGV" (!stdenv.isDarwin))
    ];

    outputs = [
      "out"
      "dev"
      "bin"
      "doc"
    ];

    buildInputs = [
      python3Packages.boost
      python3Packages.python-qt
      libsForQt5.qtbase
    ];

    nativeBuildInputs = [
      cmake
      doxygen
      libsForQt5.wrapQtAppsHook
      pkg-config
      python3Packages.python
    ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ darwin.autoSignDarwinBinariesHook ];

    propagatedBuildInputs = [
      jrl-cmakemodules
      openscenegraph
      osgqt
      qgv
    ];

    doCheck = true;

    # wrapQtAppsHook uses isMachO, which fails to detect binaries without this
    # ref. https://github.com/NixOS/nixpkgs/pull/138334
    preFixup = lib.optionalString stdenv.isDarwin "export LC_ALL=C";

    postFixup = ''
      # CMake is not aware exports are in $dev
      substituteInPlace $dev/lib/cmake/gepetto-viewer/gepetto-viewerConfig.cmake --replace-fail \
        "$out/lib/cmake" \
        "$dev/lib/cmake"

      # wrapQtAppsHook does only wrap stuff in $out, we want $bin
      echo wrapping $bin/bin/gepetto-gui
      wrapQtApp $bin/bin/gepetto-gui
    '';

    # Fontconfig error: Cannot load default config file: No such file: (null)
    env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";

    # Fontconfig error: No writable cache directories
    preBuild = "export XDG_CACHE_HOME=$(mktemp -d)";

    passthru.withPlugins =
      plugins:
      runCommand "gepetto-gui"
        {
          meta = {
            # can't just "inherit (gepetto-viewer) meta;" because:
            # error: derivation '/nix/store/…-gepetto-gui.drv' does not have wanted outputs 'bin'
            inherit (gepetto-viewer.meta)
              description
              homepage
              license
              maintainers
              mainProgram
              platforms
              ;
          };
          nativeBuildInputs = [ makeWrapper ];
          propagatedBuildInputs = plugins;
        }
        ''
          makeWrapper ${lib.getExe gepetto-viewer} $out/bin/gepetto-gui \
            --set GEPETTO_GUI_PLUGIN_DIRS ${lib.makeLibraryPath plugins}
        '';

    meta = {
      description = "Graphical Interface for Pinocchio and HPP.";
      homepage = "https://github.com/gepetto/gepetto-viewer";
      license = lib.licenses.lgpl3Only;
      maintainers = [ lib.maintainers.nim65s ];
      mainProgram = "gepetto-gui";
      platforms = lib.platforms.unix;
    };
  });
in
gepetto-viewer
+49 −0
Original line number Diff line number Diff line
{
  cmake,
  fetchFromGitHub,
  lib,
  libsForQt5,
  openscenegraph,
  stdenv,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "osgQt";
  version = "3.5.7";

  src = fetchFromGitHub {
    owner = "openscenegraph";
    repo = "osgQt";
    rev = finalAttrs.version;
    hash = "sha256-iUeIqRDlcAHdKXWAi4WhEaOCxa7ZivQw0K5E7ccEKnM=";
  };

  buildInputs = [ libsForQt5.qtbase ];

  nativeBuildInputs = [
    cmake
    libsForQt5.wrapQtAppsHook
  ];

  propagatedBuildInputs = [ openscenegraph ];

  cmakeFlags = [
    "-DDESIRED_QT_VERSION=5"
    "-DOpenGL_GL_PREFERENCE=GLVND"
  ];

  postPatch = ''
    substituteInPlace CMakeLists.txt --replace-fail \
      "FIND_PACKAGE(Qt5Widgets REQUIRED)" \
      "FIND_PACKAGE(Qt5Widgets REQUIRED)
       FIND_PACKAGE(Qt5OpenGL REQUIRED)"
  '';

  meta = {
    description = "Qt bindings for OpenSceneGraph";
    homepage = "https://github.com/openscenegraph/osgQt";
    license = "OpenSceneGraph Public License - free LGPL-based license";
    maintainers = [ lib.maintainers.nim65s ];
    platforms = lib.platforms.unix;
  };
})
+44 −0
Original line number Diff line number Diff line
{
  cmake,
  fetchFromGitHub,
  graphviz,
  jrl-cmakemodules,
  lib,
  libsForQt5,
  stdenv,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "qgv";
  version = "1.3.5";

  src = fetchFromGitHub {
    owner = "gepetto";
    repo = "qgv";
    rev = "v${finalAttrs.version}";
    hash = "sha256-NUMCVqXw7euwxm4vISU8qYFfvV5HbAJsj/IjyxEjCPw=";
  };

  buildInputs = [
    libsForQt5.qtbase
    libsForQt5.qttools
  ];

  nativeBuildInputs = [
    cmake
    libsForQt5.wrapQtAppsHook
  ];

  propagatedBuildInputs = [
    graphviz
    jrl-cmakemodules
  ];

  meta = {
    description = "Interactive Qt graphViz display";
    homepage = "https://github.com/gepetto/qgv";
    license = lib.licenses.lgpl3Only;
    maintainers = [ lib.maintainers.nim65s ];
    platforms = lib.platforms.unix;
  };
})
+4 −1
Original line number Diff line number Diff line
@@ -48,7 +48,10 @@ stdenv.mkDerivation (finalAttrs: {
    install_name_tool -id \
      $out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.dylib \
      $out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.dylib
    install_name_tool -id \
    install_name_tool -change \
               libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.3.dylib \
      $out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.3.dylib \
      -id \
      $out/lib/libPythonQt_QtAll-Qt5-Python3.${python3.sourceVersion.minor}.dylib \
      $out/lib/libPythonQt_QtAll-Qt5-Python3.${python3.sourceVersion.minor}.dylib
  '';
Loading