From 1c6dc994a85365509cd5b7b11894613c65c44ca7 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Thu, 11 Nov 2021 17:55:53 -0500 Subject: [PATCH] yoda-with-root: fix sandboxed build --- pkgs/development/libraries/physics/yoda/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/physics/yoda/default.nix b/pkgs/development/libraries/physics/yoda/default.nix index 6fb9b9560aae..a804766b85dc 100644 --- a/pkgs/development/libraries/physics/yoda/default.nix +++ b/pkgs/development/libraries/physics/yoda/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, python, root, makeWrapper, zlib, withRootSupport ? false }: +{ lib, stdenv, fetchurl, fetchpatch, python, root, makeWrapper, zlib, withRootSupport ? false }: stdenv.mkDerivation rec { pname = "yoda"; @@ -9,6 +9,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-xhagWmVlvlsayL0oWTihoxhq0ejejEACCsdQqFN1HUw="; }; + patches = [ + # Prevent ROOT from initializing X11 or Cocoa (helps with sandboxing) + (fetchpatch { + url = "https://gitlab.com/hepcedar/yoda/-/commit/36c035f4f0385dec58702f09564ca66a14ca2c3e.diff"; + sha256 = "sha256-afB+y33TVNJtxY5As18EcutJEGDE4g0UzMxzA+YgICk="; + excludes = [ "ChangeLog" ]; + }) + ]; + nativeBuildInputs = with python.pkgs; [ cython makeWrapper ]; buildInputs = [ python ] ++ (with python.pkgs; [ numpy matplotlib ])