22 gepetto-viewer = stdenv.mkDerivation (finalAttrs: {
23 pname = "gepetto-viewer";
26 src = fetchFromGitHub {
28 repo = "gepetto-viewer";
29 rev = "v${finalAttrs.version}";
30 hash = "sha256-A2J3HidG+OHJO8LpLiOEvORxDtViTdeVD85AmKkkOg8=";
34 # fix use of CMAKE_INSTALL_BINDIR for $bin output
36 url = "https://github.com/Gepetto/gepetto-viewer/pull/230/commits/9b1b3a61da016934c3e766e6b491c1d6f3fc80d6.patch";
37 hash = "sha256-dpviEkOyCZpTYntZ4sCG1AvobljJphPQxg7gA6JxfWs=";
39 # fix use of CMAKE_INSTALL_FULL_INCLUDEDIR for $dev output
41 url = "https://github.com/Gepetto/gepetto-viewer/pull/230/commits/4e1c2bbe063db20b605e51495e9f9eca40138cca.patch";
42 hash = "sha256-HrecvW1ulCSt9+DUaQVBOoDkilGRqU2+GUx7NUw7hqc=";
47 (lib.cmakeBool "BUILD_PY_QCUSTOM_PLOT" (!stdenv.hostPlatform.isDarwin))
48 (lib.cmakeBool "BUILD_PY_QGV" (!stdenv.hostPlatform.isDarwin))
60 python3Packages.python-qt
68 libsForQt5.wrapQtAppsHook
70 python3Packages.python
72 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
73 darwin.autoSignDarwinBinariesHook
76 propagatedBuildInputs = [
85 # wrapQtAppsHook uses isMachO, which fails to detect binaries without this
86 # ref. https://github.com/NixOS/nixpkgs/pull/138334
87 preFixup = lib.optionalString stdenv.hostPlatform.isDarwin "export LC_ALL=C";
90 # CMake is not aware exports are in $dev
91 substituteInPlace $dev/lib/cmake/gepetto-viewer/gepetto-viewerConfig.cmake --replace-fail \
95 # wrapQtAppsHook does only wrap stuff in $out, we want $bin
96 echo wrapping $bin/bin/gepetto-gui
97 wrapQtApp $bin/bin/gepetto-gui
100 # Fontconfig error: Cannot load default config file: No such file: (null)
101 env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";
103 # Fontconfig error: No writable cache directories
104 preBuild = "export XDG_CACHE_HOME=$(mktemp -d)";
106 passthru.withPlugins =
108 runCommand "gepetto-gui"
111 # can't just "inherit (gepetto-viewer) meta;" because:
112 # error: derivation '/nix/store/…-gepetto-gui.drv' does not have wanted outputs 'bin'
113 inherit (gepetto-viewer.meta)
122 nativeBuildInputs = [ makeWrapper ];
123 propagatedBuildInputs = plugins;
126 makeWrapper ${lib.getExe gepetto-viewer} $out/bin/gepetto-gui \
127 --set GEPETTO_GUI_PLUGIN_DIRS ${lib.makeLibraryPath plugins}
131 description = "Graphical Interface for Pinocchio and HPP.";
132 homepage = "https://github.com/gepetto/gepetto-viewer";
133 license = lib.licenses.lgpl3Only;
134 maintainers = [ lib.maintainers.nim65s ];
135 mainProgram = "gepetto-gui";
136 platforms = lib.platforms.unix;