about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix b/nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix
index 0c84cb7e0b18..96b8e3c02937 100644
--- a/nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix
@@ -13,11 +13,15 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-HlT/78LUiTkRUB2jHmYrnQY+bBiv4stcZlMyUnelSpc=";
   };
 
-  patchPhase = lib.optionalString stdenv.isDarwin ''
-    substituteInPlace Makefile --replace "gcc" "cc"
-    substituteInPlace Makefile --replace "-arch i386" ""
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile \
+      --replace "-arch x86_64" "-arch ${stdenv.hostPlatform.darwinArch}"
   '';
 
+  makeFlags = [
+    "CC=${stdenv.cc.targetPrefix}cc"
+  ];
+
   installPhase = ''
     mkdir -p $out/{bin,lib,include/hdhomerun}
     install -Dm444 libhdhomerun${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib