tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
ntp: Don't depend on openssl, don't install docs
Eelco Dolstra
11 years ago
78244031
0dcdb3c7
+171
-4
2 changed files
expand all
collapse all
unified
split
pkgs
tools
networking
ntp
default.nix
no-openssl.patch
+10
-4
pkgs/tools/networking/ntp/default.nix
···
1
1
-
{ stdenv, fetchurl, pkgconfig, libcap, openssl }:
1
1
+
{ stdenv, fetchurl, libcap, autoreconfHook }:
2
2
3
3
assert stdenv.isLinux -> libcap != null;
4
4
···
10
10
sha256 = "1vnqa1542d01xmlkw8f3rq57y360b2j7yxkkg9b11955nvw0v4if";
11
11
};
12
12
13
13
-
nativeBuildInputs = [ pkgconfig ];
13
13
+
patches = [ ./no-openssl.patch ];
14
14
15
15
-
buildInputs = [ openssl ]
16
16
-
++ stdenv.lib.optional stdenv.isLinux libcap;
15
15
+
configureFlags = ''
16
16
+
--without-crypto
17
17
+
${if stdenv.isLinux then "--enable-linuxcaps" else ""}
18
18
+
'';
19
19
+
20
20
+
buildInputs = [ autoreconfHook ] ++ stdenv.lib.optional stdenv.isLinux libcap;
21
21
+
22
22
+
postInstall = "rm -rf $out/share/doc";
17
23
18
24
meta = {
19
25
homepage = http://www.ntp.org/;
+161
pkgs/tools/networking/ntp/no-openssl.patch
···
1
1
+
Fix ntp-keygen build without OpenSSL
2
2
+
3
3
+
http://bk1.ntp.org/ntp-stable/?PAGE=patch&REV=5497b345z5MNTuNvJWuqPSje25NQTg
4
4
+
5
5
+
Index: ntp-4.2.8/Makefile.am
6
6
+
===================================================================
7
7
+
--- ntp-4.2.8.orig/Makefile.am
8
8
+
+++ ntp-4.2.8/Makefile.am
9
9
+
@@ -2,7 +2,10 @@ ACLOCAL_AMFLAGS = -I sntp/m4 -I sntp/lib
10
10
+
11
11
+
NULL =
12
12
+
13
13
+
+# moved sntp first to get libtool and libevent built.
14
14
+
+
15
15
+
SUBDIRS = \
16
16
+
+ sntp \
17
17
+
scripts \
18
18
+
include \
19
19
+
libntp \
20
20
+
@@ -17,7 +20,6 @@ SUBDIRS = \
21
21
+
clockstuff \
22
22
+
kernel \
23
23
+
util \
24
24
+
- sntp \
25
25
+
tests \
26
26
+
$(NULL)
27
27
+
28
28
+
@@ -64,7 +66,6 @@ BUILT_SOURCES = \
29
29
+
.gcc-warning \
30
30
+
libtool \
31
31
+
html/.datecheck \
32
32
+
- sntp/built-sources-only \
33
33
+
$(srcdir)/COPYRIGHT \
34
34
+
$(srcdir)/.checkChangeLog \
35
35
+
$(NULL)
36
36
+
Index: ntp-4.2.8/configure.ac
37
37
+
===================================================================
38
38
+
--- ntp-4.2.8.orig/configure.ac
39
39
+
+++ ntp-4.2.8/configure.ac
40
40
+
@@ -102,7 +102,7 @@ esac
41
41
+
enable_nls=no
42
42
+
LIBOPTS_CHECK_NOBUILD([sntp/libopts])
43
43
+
44
44
+
-NTP_ENABLE_LOCAL_LIBEVENT
45
45
+
+NTP_LIBEVENT_CHECK_NOBUILD([2], [sntp/libevent])
46
46
+
47
47
+
NTP_LIBNTP
48
48
+
49
49
+
@@ -771,6 +771,10 @@ esac
50
50
+
51
51
+
####
52
52
+
53
53
+
+AC_CHECK_FUNCS([arc4random_buf])
54
54
+
+
55
55
+
+####
56
56
+
+
57
57
+
saved_LIBS="$LIBS"
58
58
+
LIBS="$LIBS $LDADD_LIBNTP"
59
59
+
AC_CHECK_FUNCS([daemon])
60
60
+
Index: ntp-4.2.8/libntp/ntp_crypto_rnd.c
61
61
+
===================================================================
62
62
+
--- ntp-4.2.8.orig/libntp/ntp_crypto_rnd.c
63
63
+
+++ ntp-4.2.8/libntp/ntp_crypto_rnd.c
64
64
+
@@ -24,6 +24,21 @@
65
65
+
int crypto_rand_init = 0;
66
66
+
#endif
67
67
+
68
68
+
+#ifndef HAVE_ARC4RANDOM_BUF
69
69
+
+static void
70
70
+
+arc4random_buf(void *buf, size_t nbytes);
71
71
+
+
72
72
+
+void
73
73
+
+evutil_secure_rng_get_bytes(void *buf, size_t nbytes);
74
74
+
+
75
75
+
+static void
76
76
+
+arc4random_buf(void *buf, size_t nbytes)
77
77
+
+{
78
78
+
+ evutil_secure_rng_get_bytes(buf, nbytes);
79
79
+
+ return;
80
80
+
+}
81
81
+
+#endif
82
82
+
+
83
83
+
/*
84
84
+
* As of late 2014, here's how we plan to provide cryptographic-quality
85
85
+
* random numbers:
86
86
+
Index: ntp-4.2.8/sntp/configure.ac
87
87
+
===================================================================
88
88
+
--- ntp-4.2.8.orig/sntp/configure.ac
89
89
+
+++ ntp-4.2.8/sntp/configure.ac
90
90
+
@@ -97,11 +97,14 @@ esac
91
91
+
enable_nls=no
92
92
+
LIBOPTS_CHECK
93
93
+
94
94
+
-AM_COND_IF(
95
95
+
- [BUILD_SNTP],
96
96
+
- [NTP_LIBEVENT_CHECK],
97
97
+
- [NTP_LIBEVENT_CHECK_NOBUILD]
98
98
+
-)
99
99
+
+# From when we only used libevent for sntp:
100
100
+
+#AM_COND_IF(
101
101
+
+# [BUILD_SNTP],
102
102
+
+# [NTP_LIBEVENT_CHECK],
103
103
+
+# [NTP_LIBEVENT_CHECK_NOBUILD]
104
104
+
+#)
105
105
+
+
106
106
+
+NTP_LIBEVENT_CHECK([2])
107
107
+
108
108
+
# Checks for libraries.
109
109
+
110
110
+
Index: ntp-4.2.8/sntp/m4/ntp_libevent.m4
111
111
+
===================================================================
112
112
+
--- ntp-4.2.8.orig/sntp/m4/ntp_libevent.m4
113
113
+
+++ ntp-4.2.8/sntp/m4/ntp_libevent.m4
114
114
+
@@ -1,4 +1,25 @@
115
115
+
-dnl NTP_ENABLE_LOCAL_LIBEVENT -*- Autoconf -*-
116
116
+
+# SYNOPSIS -*- Autoconf -*-
117
117
+
+#
118
118
+
+# NTP_ENABLE_LOCAL_LIBEVENT
119
119
+
+# NTP_LIBEVENT_CHECK([MINVERSION [, DIR]])
120
120
+
+# NTP_LIBEVENT_CHECK_NOBUILD([MINVERSION [, DIR]])
121
121
+
+#
122
122
+
+# DESCRIPTION
123
123
+
+#
124
124
+
+# AUTHOR
125
125
+
+#
126
126
+
+# Harlan Stenn
127
127
+
+#
128
128
+
+# LICENSE
129
129
+
+#
130
130
+
+# This file is Copyright (c) 2014 Network Time Foundation
131
131
+
+#
132
132
+
+# Copying and distribution of this file, with or without modification, are
133
133
+
+# permitted in any medium without royalty provided the copyright notice,
134
134
+
+# author attribution and this notice are preserved. This file is offered
135
135
+
+# as-is, without any warranty.
136
136
+
+
137
137
+
+dnl NTP_ENABLE_LOCAL_LIBEVENT
138
138
+
dnl
139
139
+
dnl Provide only the --enable-local-libevent command-line option.
140
140
+
dnl
141
141
+
@@ -29,7 +50,7 @@ dnl If NOBUILD is provided as the 3rd ar
142
142
+
dnl but DO NOT invoke DIR/configure if we are going to use our bundled
143
143
+
dnl version. This may be the case for nested packages.
144
144
+
dnl
145
145
+
-dnl provide --enable-local-libevent .
146
146
+
+dnl provides --enable-local-libevent .
147
147
+
dnl
148
148
+
dnl Examples:
149
149
+
dnl
150
150
+
Index: ntp-4.2.8/util/Makefile.am
151
151
+
===================================================================
152
152
+
--- ntp-4.2.8.orig/util/Makefile.am
153
153
+
+++ ntp-4.2.8/util/Makefile.am
154
154
+
@@ -19,6 +19,7 @@ AM_LDFLAGS = $(LDFLAGS_NTP)
155
155
+
LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
156
156
+
tg2_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
157
157
+
ntp_keygen_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a
158
158
+
+ntp_keygen_LDADD += $(LDADD_LIBEVENT)
159
159
+
ntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM)
160
160
+
ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h
161
161
+