2020-04-24 23:36:52 +00:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2020-08-20 17:08:02 +00:00
|
|
|
let
|
|
|
|
# memstream — POSIX memory streams for BSD
|
|
|
|
memstream = fetchurl {
|
|
|
|
url = "https://piumarta.com/software/memstream/memstream-0.1.tar.gz";
|
|
|
|
sha256 = "0kvdb897g7nyviaz72arbqijk2g2wa61cmi3l5yh48rzr49r3a3a";
|
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-08-20 17:08:02 +00:00
|
|
|
pname = "hyx";
|
|
|
|
version = "2020-06-09";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-08-20 17:08:02 +00:00
|
|
|
url = "https://yx7.cc/code/hyx/hyx-${lib.replaceStrings [ "-" ] [ "." ] version}.tar.xz";
|
|
|
|
sha256 = "1x8dmll93hrnj24kn5knpwj36y6r1v2ygwynpjwrg2hwd4c1a8hi";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
postUnpack = lib.optionalString stdenv.isDarwin ''
|
|
|
|
tar --strip=1 -C $sourceRoot -xf ${memstream} --wildcards "memstream-0.1/memstream.[hc]"
|
|
|
|
'';
|
|
|
|
|
|
|
|
patches = lib.optional stdenv.isDarwin ./memstream.patch;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -vD hyx $out/bin/hyx
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "minimalistic but powerful Linux console hex editor";
|
|
|
|
homepage = "https://yx7.cc/code/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fpletz ];
|
2020-08-20 17:08:02 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|