@@ -1,11 +1,5 @@
1−{ lib, stdenv, fetchurl }:
2−let
3− # memstream — POSIX memory streams for BSD
4− memstream = fetchurl {
5− url = "https://piumarta.com/software/memstream/memstream-0.1.tar.gz";
6− sha256 = "0kvdb897g7nyviaz72arbqijk2g2wa61cmi3l5yh48rzr49r3a3a";
7− };
8−in
1+{ lib, stdenv, fetchurl, memstreamHook }:
2+
93stdenv.mkDerivation rec {
104 pname = "hyx";
115 version = "2020-06-09";
@@ -15,11 +9,12 @@ stdenv.mkDerivation rec {
159 sha256 = "1x8dmll93hrnj24kn5knpwj36y6r1v2ygwynpjwrg2hwd4c1a8hi";
1610 };
1711
18− postUnpack = lib.optionalString stdenv.isDarwin ''
19− tar --strip=1 -C $sourceRoot -xf ${memstream} --wildcards "memstream-0.1/memstream.[hc]"
12+ postPatch = lib.optionalString stdenv.isDarwin ''
13+ substituteInPlace Makefile \
14+ --replace "-Wl,-z,relro,-z,now -fpic -pie" ""
2015 '';
2116
22− patches = lib.optional stdenv.isDarwin ./memstream.patch;
17+ buildInputs = lib.optional (stdenv.system == "x86_64-darwin") memstreamHook;
2318
2419 installPhase = ''
2520 install -vD hyx $out/bin/hyx