From ec331755d349494b543fcedca01951ac60994bbf Mon Sep 17 00:00:00 2001 From: adisbladis Date: Tue, 3 Oct 2017 10:13:30 +0800 Subject: [PATCH] go-ethereum: Fix libusb segmentation faults on Darwin --- pkgs/applications/altcoins/default.nix | 7 +++++-- pkgs/applications/altcoins/go-ethereum.nix | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/altcoins/default.nix b/pkgs/applications/altcoins/default.nix index c604a9370a84..395a440690b1 100644 --- a/pkgs/applications/altcoins/default.nix +++ b/pkgs/applications/altcoins/default.nix @@ -1,4 +1,4 @@ -{ callPackage, boost155, boost162, boost163, openssl_1_1_0, haskellPackages }: +{ callPackage, boost155, boost162, boost163, openssl_1_1_0, haskellPackages, darwin }: rec { @@ -26,7 +26,10 @@ rec { dogecoind = callPackage ./dogecoin.nix { withGui = false; }; freicoin = callPackage ./freicoin.nix { boost = boost155; }; - go-ethereum = callPackage ./go-ethereum.nix { }; + go-ethereum = callPackage ./go-ethereum.nix { + inherit (darwin) libobjc; + inherit (darwin.apple_sdk.frameworks) IOKit; + }; go-ethereum-classic = callPackage ./go-ethereum-classic { }; hivemind = callPackage ./hivemind.nix { withGui = true; }; diff --git a/pkgs/applications/altcoins/go-ethereum.nix b/pkgs/applications/altcoins/go-ethereum.nix index 4cf68fb76fd6..45c990d88a5f 100644 --- a/pkgs/applications/altcoins/go-ethereum.nix +++ b/pkgs/applications/altcoins/go-ethereum.nix @@ -1,10 +1,14 @@ -{ stdenv, lib, buildGoPackage, fetchFromGitHub }: +{ stdenv, lib, buildGoPackage, fetchFromGitHub, libobjc, IOKit }: buildGoPackage rec { name = "go-ethereum-${version}"; version = "1.7.0"; goPackagePath = "github.com/ethereum/go-ethereum"; + # Fix for usb-related segmentation faults on darwin + propagatedBuildInputs = + stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ]; + # Fixes Cgo related build failures (see https://github.com/NixOS/nixpkgs/issues/25959 ) hardeningDisable = [ "fortify" ];