tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
opusfile: fix windows compilation
Taeer Bar-Yam
4 years ago
e1b933cc
61a31ad3
+45
-6
3 changed files
expand all
collapse all
unified
split
pkgs
applications
audio
opusfile
default.nix
disable-cert-store.patch
development
libraries
libopus
default.nix
+9
-5
pkgs/applications/audio/opusfile/default.nix
···
1
1
{ lib, stdenv, fetchurl, pkg-config, openssl, libogg, libopus }:
2
2
3
3
stdenv.mkDerivation rec {
4
4
-
name = "opusfile-0.12";
4
4
+
pname = "opusfile";
5
5
+
version = "0.12";
5
6
src = fetchurl {
6
6
-
url = "http://downloads.xiph.org/releases/opus/${name}.tar.gz";
7
7
+
url = "http://downloads.xiph.org/releases/opus/opusfile-${version}.tar.gz";
7
8
sha256 = "02smwc5ah8nb3a67mnkjzqmrzk43j356hgj2a97s9midq40qd38i";
8
9
};
9
10
10
11
nativeBuildInputs = [ pkg-config ];
11
12
buildInputs = [ openssl libogg ];
12
13
propagatedBuildInputs = [ libopus ];
13
13
-
patches = [ ./include-multistream.patch ];
14
14
+
patches = [ ./include-multistream.patch ]
15
15
+
# fixes problem with openssl 1.1 dependency
16
16
+
# see https://github.com/xiph/opusfile/issues/13
17
17
+
++ lib.optionals stdenv.hostPlatform.isWindows [ ./disable-cert-store.patch ];
14
18
configureFlags = [ "--disable-examples" ];
15
19
16
20
meta = with lib; {
17
21
description = "High-level API for decoding and seeking in .opus files";
18
22
homepage = "https://www.opus-codec.org/";
19
23
license = licenses.bsd3;
20
20
-
platforms = platforms.linux ++ platforms.darwin;
21
21
-
maintainers = with maintainers; [ ];
24
24
+
platforms = platforms.all;
25
25
+
maintainers = with maintainers; [ taeer ];
22
26
};
23
27
}
+35
pkgs/applications/audio/opusfile/disable-cert-store.patch
···
1
1
+
diff --git a/src/http.c b/src/http.c
2
2
+
index bd08562..3a3592c 100644
3
3
+
--- a/src/http.c
4
4
+
+++ b/src/http.c
5
5
+
@@ -327,10 +327,12 @@ static int op_poll_win32(struct pollfd *_fds,nfds_t _nfds,int _timeout){
6
6
+
typedef ptrdiff_t ssize_t;
7
7
+
# endif
8
8
+
9
9
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
10
10
+
/*Load certificates from the built-in certificate store.*/
11
11
+
int SSL_CTX_set_default_verify_paths_win32(SSL_CTX *_ssl_ctx);
12
12
+
# define SSL_CTX_set_default_verify_paths \
13
13
+
SSL_CTX_set_default_verify_paths_win32
14
14
+
+#endif
15
15
+
16
16
+
# else
17
17
+
/*Normal Berkeley sockets.*/
18
18
+
diff --git a/src/wincerts.c b/src/wincerts.c
19
19
+
index 409a4e0..c355952 100644
20
20
+
--- a/src/wincerts.c
21
21
+
+++ b/src/wincerts.c
22
22
+
@@ -33,6 +33,8 @@
23
23
+
# include <openssl/err.h>
24
24
+
# include <openssl/x509.h>
25
25
+
26
26
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
27
27
+
+
28
28
+
static int op_capi_new(X509_LOOKUP *_lu){
29
29
+
HCERTSTORE h_store;
30
30
+
h_store=CertOpenStore(CERT_STORE_PROV_SYSTEM_A,0,0,
31
31
+
@@ -171,3 +173,4 @@ int SSL_CTX_set_default_verify_paths_win32(SSL_CTX *_ssl_ctx){
32
32
+
}
33
33
+
34
34
+
#endif
35
35
+
+#endif
+1
-1
pkgs/development/libraries/libopus/default.nix
···
24
24
description = "Open, royalty-free, highly versatile audio codec";
25
25
license = lib.licenses.bsd3;
26
26
homepage = "https://www.opus-codec.org/";
27
27
-
platforms = platforms.unix;
27
27
+
platforms = platforms.all;
28
28
};
29
29
}