Skip to content

Commit 8e2b14a

Browse files
authored
Merge pull request #93634 from sikmir/hyx
2 parents 7b0fd21 + f585a26 commit 8e2b14a

File tree

3 files changed

+48
-17
lines changed

3 files changed

+48
-17
lines changed

pkgs/tools/text/hyx/default.nix

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
{ lib, stdenv, fetchurl }:
2-
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
39
stdenv.mkDerivation rec {
4-
name = "hyx-0.1.5";
10+
pname = "hyx";
11+
version = "2020-06-09";
512

613
src = fetchurl {
7-
url = "https://yx7.cc/code/hyx/${name}.tar.xz";
8-
sha256 = "0gd8fbdyw12jwffa5dgcql4ry22xbdhqdds1qwzk1rkcrkgnc1mg";
14+
url = "https://yx7.cc/code/hyx/hyx-${lib.replaceStrings [ "-" ] [ "." ] version}.tar.xz";
15+
sha256 = "1x8dmll93hrnj24kn5knpwj36y6r1v2ygwynpjwrg2hwd4c1a8hi";
916
};
1017

11-
patches = [ ./no-wall-by-default.patch ];
18+
postUnpack = lib.optionalString stdenv.isDarwin ''
19+
tar --strip=1 -C $sourceRoot -xf ${memstream} --wildcards "memstream-0.1/memstream.[hc]"
20+
'';
21+
22+
patches = lib.optional stdenv.isDarwin ./memstream.patch;
1223

1324
installPhase = ''
1425
install -vD hyx $out/bin/hyx
@@ -19,6 +30,6 @@ stdenv.mkDerivation rec {
1930
homepage = "https://yx7.cc/code/";
2031
license = licenses.mit;
2132
maintainers = with maintainers; [ fpletz ];
22-
platforms = platforms.linux;
33+
platforms = with platforms; linux ++ darwin;
2334
};
2435
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
diff -Naur hyx-2020.06.09.org/Makefile hyx-2020.06.09/Makefile
2+
--- hyx-2020.06.09.org/Makefile 2020-06-09 15:19:50.000000000 +0300
3+
+++ hyx-2020.06.09/Makefile 2020-07-22 11:46:40.000000000 +0300
4+
@@ -1,6 +1,6 @@
5+
6+
all: CFLAGS ?= -O2 -Wl,-s \
7+
- -Wl,-z,relro,-z,now -fpic -pie -D_FORTIFY_SOURCE=2 -fstack-protector-all
8+
+ -D_FORTIFY_SOURCE=2 -fstack-protector-all
9+
all: CFLAGS += -std=c99 -pedantic -Wall -Wextra -DNDEBUG
10+
all: hyx
11+
12+
@@ -13,7 +13,7 @@
13+
hyx: *.h *.c
14+
$(CC) \
15+
$(CFLAGS) \
16+
- hyx.c common.c blob.c history.c view.c input.c \
17+
+ hyx.c common.c blob.c history.c view.c input.c memstream.c \
18+
-o hyx
19+
20+
clean:
21+
diff -Naur hyx-2020.06.09.org/view.c hyx-2020.06.09/view.c
22+
--- hyx-2020.06.09.org/view.c 2020-06-09 15:19:50.000000000 +0300
23+
+++ hyx-2020.06.09/view.c 2020-07-22 11:49:09.000000000 +0300
24+
@@ -4,6 +4,7 @@
25+
#include "view.h"
26+
#include "input.h"
27+
#include "ansi.h"
28+
+#include "memstream.h"
29+
30+
#include <stdlib.h>
31+
#include <stdio.h>

pkgs/tools/text/hyx/no-wall-by-default.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)