tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
hyx: use memstreamHook
Dmitry Kalinkin
4 years ago
8b2abe42
66f3da43
+6
-42
2 changed files
expand all
collapse all
unified
split
pkgs
tools
text
hyx
default.nix
memstream.patch
+6
-11
pkgs/tools/text/hyx/default.nix
···
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
9
stdenv.mkDerivation rec {
10
pname = "hyx";
11
version = "2020-06-09";
···
15
sha256 = "1x8dmll93hrnj24kn5knpwj36y6r1v2ygwynpjwrg2hwd4c1a8hi";
16
};
17
18
-
postUnpack = lib.optionalString stdenv.isDarwin ''
19
-
tar --strip=1 -C $sourceRoot -xf ${memstream} --wildcards "memstream-0.1/memstream.[hc]"
0
20
'';
21
22
-
patches = lib.optional stdenv.isDarwin ./memstream.patch;
23
24
installPhase = ''
25
install -vD hyx $out/bin/hyx
···
1
+
{ lib, stdenv, fetchurl, memstreamHook }:
2
+
0
0
0
0
0
0
3
stdenv.mkDerivation rec {
4
pname = "hyx";
5
version = "2020-06-09";
···
9
sha256 = "1x8dmll93hrnj24kn5knpwj36y6r1v2ygwynpjwrg2hwd4c1a8hi";
10
};
11
12
+
postPatch = lib.optionalString stdenv.isDarwin ''
13
+
substituteInPlace Makefile \
14
+
--replace "-Wl,-z,relro,-z,now -fpic -pie" ""
15
'';
16
17
+
buildInputs = lib.optional (stdenv.system == "x86_64-darwin") memstreamHook;
18
19
installPhase = ''
20
install -vD hyx $out/bin/hyx
-31
pkgs/tools/text/hyx/memstream.patch
···
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>
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0