From ccc13c2e53b58018f9f39fb8a060286f1aa2508c Mon Sep 17 00:00:00 2001 From: Eric Dallo Date: Thu, 7 Nov 2019 19:21:47 -0300 Subject: [PATCH] srt-vtt: init at 2019-01-03 (#70885) * srt-vtt: init at 2019-01-03 * Append 'unstable' to pname Co-Authored-By: Marek Mahut * Fix version * Remove which validation * Add support to linux only Co-Authored-By: Evils-Devils <30512529+Evils-Devils@users.noreply.github.com> --- pkgs/tools/cd-dvd/srt-to-vtt-cl/default.nix | 32 +++++++++++++++++++ .../cd-dvd/srt-to-vtt-cl/fix-validation.patch | 13 ++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 47 insertions(+) create mode 100644 pkgs/tools/cd-dvd/srt-to-vtt-cl/default.nix create mode 100644 pkgs/tools/cd-dvd/srt-to-vtt-cl/fix-validation.patch diff --git a/pkgs/tools/cd-dvd/srt-to-vtt-cl/default.nix b/pkgs/tools/cd-dvd/srt-to-vtt-cl/default.nix new file mode 100644 index 000000000000..94cd09674dac --- /dev/null +++ b/pkgs/tools/cd-dvd/srt-to-vtt-cl/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub, substituteAll }: + +stdenv.mkDerivation rec { + pname = "srt-to-vtt-cl"; + version = "unstable-2019-01-03"; + + src = fetchFromGitHub { + owner = "nwoltman"; + repo = pname; + rev = "ce3d0776906eb847c129d99a85077b5082f74724"; + sha256 = "0qxysj08gjr6npyvg148llmwmjl2n9cyqjllfnf3gxb841dy370n"; + }; + + patches = [ + (substituteAll { + src = ./fix-validation.patch; + }) + ]; + + installPhase = '' + mkdir -p $out/bin + cp bin/$(uname -s)/$(uname -m)/srt-vtt $out/bin + ''; + + meta = with stdenv.lib; { + description = "Convert SRT files to VTT"; + license = licenses.mit; + maintainers = with maintainers; [ ericdallo ]; + homepage = https://github.com/nwoltman/srt-to-vtt-cl; + platforms = platforms.linux; + }; +} diff --git a/pkgs/tools/cd-dvd/srt-to-vtt-cl/fix-validation.patch b/pkgs/tools/cd-dvd/srt-to-vtt-cl/fix-validation.patch new file mode 100644 index 000000000000..abddae6d0719 --- /dev/null +++ b/pkgs/tools/cd-dvd/srt-to-vtt-cl/fix-validation.patch @@ -0,0 +1,13 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,9 +1,4 @@ +-ERR = $(shell which clang++ >/dev/null; echo $$?) +-ifeq "$(ERR)" "0" +- CXX ?= clang++ +-else +- CXX ?= g++ +-endif ++CXX ?= g++ + CXXFLAGS = -std=c++11 -O2 -MMD -I ./deps + OBJECTS := src/text_encoding_detect.o src/Utils.o src/Converter.o src/main.o + DEPENDS := $(OBJECTS:.o=.d) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9a3ee7c4c28f..09e3cce07b5f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6384,6 +6384,8 @@ in srcml = callPackage ../applications/version-management/srcml { }; + srt-to-vtt-cl = callPackage ../tools/cd-dvd/srt-to-vtt-cl { }; + sourcehut = callPackage ../applications/version-management/sourcehut { }; sshfs-fuse = callPackage ../tools/filesystems/sshfs-fuse { };