chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / ge / gepetto-viewer / package.nix
blob8e87bb3b18915f8b41134b098bc27007365d940b
2   boost,
3   cmake,
4   darwin,
5   doxygen,
6   fetchFromGitHub,
7   fetchpatch,
8   fontconfig,
9   lib,
10   jrl-cmakemodules,
11   libsForQt5,
12   makeWrapper,
13   openscenegraph,
14   osgqt,
15   pkg-config,
16   python3Packages,
17   qgv,
18   stdenv,
19   runCommand,
21 let
22   gepetto-viewer = stdenv.mkDerivation (finalAttrs: {
23     pname = "gepetto-viewer";
24     version = "5.1.0";
26     src = fetchFromGitHub {
27       owner = "gepetto";
28       repo = "gepetto-viewer";
29       rev = "v${finalAttrs.version}";
30       hash = "sha256-A2J3HidG+OHJO8LpLiOEvORxDtViTdeVD85AmKkkOg8=";
31     };
33     patches = [
34       # fix use of CMAKE_INSTALL_BINDIR for $bin output
35       (fetchpatch {
36         url = "https://github.com/Gepetto/gepetto-viewer/pull/230/commits/9b1b3a61da016934c3e766e6b491c1d6f3fc80d6.patch";
37         hash = "sha256-dpviEkOyCZpTYntZ4sCG1AvobljJphPQxg7gA6JxfWs=";
38       })
39       # fix use of CMAKE_INSTALL_FULL_INCLUDEDIR for $dev output
40       (fetchpatch {
41         url = "https://github.com/Gepetto/gepetto-viewer/pull/230/commits/4e1c2bbe063db20b605e51495e9f9eca40138cca.patch";
42         hash = "sha256-HrecvW1ulCSt9+DUaQVBOoDkilGRqU2+GUx7NUw7hqc=";
43       })
44     ];
46     cmakeFlags = [
47       (lib.cmakeBool "BUILD_PY_QCUSTOM_PLOT" (!stdenv.hostPlatform.isDarwin))
48       (lib.cmakeBool "BUILD_PY_QGV" (!stdenv.hostPlatform.isDarwin))
49     ];
51     outputs = [
52       "out"
53       "dev"
54       "bin"
55       "doc"
56     ];
58     buildInputs = [
59       python3Packages.boost
60       python3Packages.python-qt
61       libsForQt5.qtbase
62     ];
64     nativeBuildInputs =
65       [
66         cmake
67         doxygen
68         libsForQt5.wrapQtAppsHook
69         pkg-config
70         python3Packages.python
71       ]
72       ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
73         darwin.autoSignDarwinBinariesHook
74       ];
76     propagatedBuildInputs = [
77       jrl-cmakemodules
78       openscenegraph
79       osgqt
80       qgv
81     ];
83     doCheck = true;
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";
89     postFixup = ''
90       # CMake is not aware exports are in $dev
91       substituteInPlace $dev/lib/cmake/gepetto-viewer/gepetto-viewerConfig.cmake --replace-fail \
92         "$out/lib/cmake" \
93         "$dev/lib/cmake"
95       # wrapQtAppsHook does only wrap stuff in $out, we want $bin
96       echo wrapping $bin/bin/gepetto-gui
97       wrapQtApp $bin/bin/gepetto-gui
98     '';
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 =
107       plugins:
108       runCommand "gepetto-gui"
109         {
110           meta = {
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)
114               description
115               homepage
116               license
117               maintainers
118               mainProgram
119               platforms
120               ;
121           };
122           nativeBuildInputs = [ makeWrapper ];
123           propagatedBuildInputs = plugins;
124         }
125         ''
126           makeWrapper ${lib.getExe gepetto-viewer} $out/bin/gepetto-gui \
127             --set GEPETTO_GUI_PLUGIN_DIRS ${lib.makeLibraryPath plugins}
128         '';
130     meta = {
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;
137     };
138   });
140 gepetto-viewer