git.iko.soy/typeable/nixpkgs
on master help sign in
srt-live-server: init at 1.4.8 (#119606)

* srt-live-server: init at 1.4.8 * Update pkgs/applications/video/srt-live-server/default.nix * Update pkgs/applications/video/srt-live-server/default.nix Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

commit6a707e80e658d0db5c0a173281d7fb2c8e7ebe64 authorSCOTT-HAMILTON <sgn.hamilton+github@protonmail.com> dateTue 20 Apr 2021, 20:45 (6 years ago) parent41714bb
3 files changed+100
pkgs/applications/video/srt-live-server/default.nix+37 pkgs/applications/video/srt-live-server/fix-insecure-printfs.patch+61 pkgs/top-level/all-packages.nix+2
pkgs/applications/video/srt-live-server/default.nixnew file+37
@@ -0,0 +1,37 @@
1+{ lib
2+, fetchFromGitHub
3+, stdenv
4+, srt
5+, zlib
6+}:
7+
8+stdenv.mkDerivation rec {
9+ pname = "srt-live-server";
10+ version = "1.4.8";
11+
12+ src = fetchFromGitHub {
13+ owner = "Edward-Wu";
14+ repo = "srt-live-server";
15+ rev = "V${version}";
16+ sha256 = "0x48sxpgxznb1ymx8shw437pcgk76ka5rx0zhn9b3cyi9jlq1yld";
17+ };
18+
19+ patches = [
20+ # https://github.com/Edward-Wu/srt-live-server/pull/94
21+ ./fix-insecure-printfs.patch
22+ ];
23+
24+ buildInputs = [ srt zlib ];
25+
26+ makeFlags = [
27+ "PREFIX=$(out)"
28+ ];
29+
30+ meta = with lib; {
31+ description = "srt live server for low latency";
32+ license = licenses.mit;
33+ homepage = "https://github.com/Edward-Wu/srt-live-server";
34+ maintainers = with maintainers; [ shamilton ];
35+ platforms = platforms.linux;
36+ };
37+}
pkgs/applications/video/srt-live-server/fix-insecure-printfs.patchnew file+61
@@ -0,0 +1,61 @@
1+diff --color -ur a/Makefile b/Makefile
2+--- a/Makefile 2021-04-16 13:02:41.416453040 +0200
3++++ b/Makefile 2021-04-16 13:21:23.020089623 +0200
4+@@ -1,3 +1,4 @@
5++PREFIX = /usr/local
6+ SHELL = /bin/sh
7+ MAIN_NAME=sls
8+ CLIENT_NAME=slc
9+@@ -64,3 +65,16 @@
10+ rm -f $(OUTPUT_PATH)/*.o
11+ rm -rf $(BIN_PATH)/*
12+
13++install: all
14++ @echo installing executable files to ${DESTDIR}${PREFIX}/bin
15++ @mkdir -p "${DESTDIR}${PREFIX}/bin"
16++ @cp -f ${BIN_PATH}/${MAIN_NAME} "${DESTDIR}${PREFIX}/bin"
17++ @chmod 755 "${DESTDIR}${PREFIX}/bin/${MAIN_NAME}"
18++ @cp -f ${BIN_PATH}/${CLIENT_NAME} "${DESTDIR}${PREFIX}/bin"
19++ @chmod 755 "${DESTDIR}${PREFIX}/bin/${CLIENT_NAME}"
20++
21++uninstall:
22++ @echo removing executable files from ${DESTDIR}${PREFIX}/bin
23++ @rm -f "${DESTDIR}${PREFIX}/bin/${MAIN_NAME}"
24++ @rm -f "${DESTDIR}${PREFIX}/bin/${CLIENT_NAME}"
25++
26+diff --color -ur a/slscore/HttpClient.cpp b/slscore/HttpClient.cpp
27+--- a/slscore/HttpClient.cpp 2021-04-16 13:02:41.416453040 +0200
28++++ b/slscore/HttpClient.cpp 2021-04-16 13:11:40.343866698 +0200
29+@@ -90,7 +90,7 @@
30+ goto FUNC_END;
31+ }
32+ if (NULL != method && strlen(method) > 0) {
33+- sprintf(m_http_method, method);
34++ strcpy(m_http_method, method);
35+ }
36+
37+ m_interval = interval;
38+diff --color -ur a/slscore/SLSLog.cpp b/slscore/SLSLog.cpp
39+--- a/slscore/SLSLog.cpp 2021-04-16 13:02:41.416453040 +0200
40++++ b/slscore/SLSLog.cpp 2021-04-16 13:08:16.836119519 +0200
41+@@ -85,7 +85,7 @@
42+ vsnprintf (buf , 4095 , fmt , vl);
43+ //sprintf(buf_info, "%s %s: %s\n" , cur_time, LOG_LEVEL_NAME[level], buf);
44+ sprintf(buf_info, "%s:%03d %s %s: %s\n" , cur_time, cur_time_msec, APP_NAME, LOG_LEVEL_NAME[level], buf);
45+- printf(buf_info);
46++ puts(buf_info);
47+
48+ if (m_log_file) {
49+ fwrite(buf_info, strlen(buf_info), 1, m_log_file);
50+diff --color -ur a/slscore/SLSSrt.cpp b/slscore/SLSSrt.cpp
51+--- a/slscore/SLSSrt.cpp 2021-04-16 13:02:41.417452995 +0200
52++++ b/slscore/SLSSrt.cpp 2021-04-16 13:10:11.004957820 +0200
53+@@ -124,7 +124,7 @@
54+ std::map<int, std::string>::iterator it;
55+ for(it=map_error.begin(); it!=map_error.end(); ++it) {
56+ sprintf(szBuf, "%d: %s\n", it->first, it->second.c_str());
57+- printf(szBuf);
58++ puts(szBuf);
59+ }
60+ printf("----------end------------\n");
61+ map_error.clear();
pkgs/top-level/all-packages.nix+2
@@ -8457,6 +8457,8 @@ in
84578457
84588458 srcml = callPackage ../applications/version-management/srcml { };
84598459
8460+ srt-live-server = callPackage ../applications/video/srt-live-server { };
8461+
84608462 srt-to-vtt-cl = callPackage ../tools/cd-dvd/srt-to-vtt-cl { };
84618463
84628464 sourcehut = callPackage ../applications/version-management/sourcehut { };