summary refs log tree commit diff
path: root/pkgs/tools/video/atomicparsley
diff options
context:
space:
mode:
authorPeter Jones <pjones@pmade.com>2015-03-13 16:06:37 -0600
committerPeter Jones <pjones@pmade.com>2015-03-13 16:06:37 -0600
commitcbc648f4627c58412849a30e7de7fcc378f358da (patch)
treed4ea6844575f848bb1dc23fb421f8bcfe58707d8 /pkgs/tools/video/atomicparsley
parentfe8072ee7f8e47ff8a7644bc522f1eec2c65989a (diff)
downloadnixpkgs-cbc648f4627c58412849a30e7de7fcc378f358da.tar
nixpkgs-cbc648f4627c58412849a30e7de7fcc378f358da.tar.gz
nixpkgs-cbc648f4627c58412849a30e7de7fcc378f358da.tar.bz2
nixpkgs-cbc648f4627c58412849a30e7de7fcc378f358da.tar.lz
nixpkgs-cbc648f4627c58412849a30e7de7fcc378f358da.tar.xz
nixpkgs-cbc648f4627c58412849a30e7de7fcc378f358da.tar.zst
nixpkgs-cbc648f4627c58412849a30e7de7fcc378f358da.zip
New package: AtomicParsley
Diffstat (limited to 'pkgs/tools/video/atomicparsley')
-rw-r--r--pkgs/tools/video/atomicparsley/casts.patch38
-rw-r--r--pkgs/tools/video/atomicparsley/default.nix29
2 files changed, 67 insertions, 0 deletions
diff --git a/pkgs/tools/video/atomicparsley/casts.patch b/pkgs/tools/video/atomicparsley/casts.patch
new file mode 100644
index 00000000000..b70a3cbcf85
--- /dev/null
+++ b/pkgs/tools/video/atomicparsley/casts.patch
@@ -0,0 +1,38 @@
+--- AtomicParsley-source-0.9.0/AtomicParsley.cpp.orig	2015-03-13 15:38:16.817904490 -0600
++++ AtomicParsley-source-0.9.0/AtomicParsley.cpp	2015-03-13 15:48:07.595273416 -0600
+@@ -1447,7 +1447,7 @@
+ 	uint32_t atom_offsets = 0;
+ 	char* uuid_outfile = (char*)calloc(1, sizeof(char)*MAXPATHLEN+1); //malloc a new string because it may be a cli arg for a specific output path
+ 	if (output_path == NULL) {
+-		char* orig_suffix = strrchr(originating_file, '.');
++		char* orig_suffix = strrchr((char*)originating_file, (int)'.');
+ 		if (orig_suffix == NULL) {
+ 			fprintf(stdout, "AP warning: a file extension for the input file was not found.\n\tGlobbing onto original filename...\n");
+ 			path_len = strlen(originating_file);
+@@ -4464,7 +4464,7 @@
+ void APar_DeriveNewPath(const char *filePath, char* temp_path, int output_type, const char* file_kind, char* forced_suffix, bool random_filename = true) {
+ 	char* suffix = NULL;
+ 	if (forced_suffix == NULL) {
+-		suffix = strrchr(filePath, '.');
++		suffix = strrchr((char*)filePath, (int)'.');
+ 	} else {
+ 		suffix = forced_suffix;
+ 	}
+@@ -4480,7 +4480,7 @@
+ 		memcpy(temp_path, filePath, base_len);
+ 		memcpy(temp_path + base_len, file_kind, strlen(file_kind));
+ #else
+-		char* file_name = strrchr(filePath, '/');
++		char* file_name = strrchr((char*)filePath, (int)'/');
+ 		size_t file_name_len = strlen(file_name);
+ 		memcpy(temp_path, filePath, filepath_len-file_name_len+1);
+ 		memcpy(temp_path + strlen(temp_path), ".", 1);
+@@ -5006,7 +5006,7 @@
+ 			free_modified_name = true;
+ 			if (forced_suffix_type == FORCE_M4B_TYPE) { //using --stik Audiobook with --overWrite will change the original file's extension
+ 				uint16_t filename_len = strlen(m4aFile);
+-				char* suffix = strrchr(m4aFile, '.');
++				char* suffix = strrchr((char*)m4aFile, (int)'.');
+ 				memcpy(originating_file, m4aFile, filename_len+1 );
+ 				memcpy(originating_file + (filename_len - strlen(suffix) ), ".m4b", 5 );
+ 			}
diff --git a/pkgs/tools/video/atomicparsley/default.nix b/pkgs/tools/video/atomicparsley/default.nix
new file mode 100644
index 00000000000..d4b662c88f1
--- /dev/null
+++ b/pkgs/tools/video/atomicparsley/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, pkgs, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "AtomicParsley";
+  version = "0.9.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/atomicparsley/${name}-source-${version}.zip";
+    sha256 = "de83f219f95e6fe59099b277e3ced86f0430ad9468e845783092821dff15a72e";
+  };
+
+  buildInputs = with pkgs; [ unzip ];
+  patches = [ ./casts.patch ];
+  setSourceRoot = "sourceRoot=${name}-source-${version}";
+  buildPhase = "bash build";
+  installPhase = "install -D AtomicParsley $out/bin/AtomicParsley";
+
+  meta = with stdenv.lib; {
+    description = ''
+      A lightweight command line program for reading, parsing and
+      setting metadata into MPEG-4 files
+    '';
+
+    homepage = http://atomicparsley.sourceforge.net/;
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ pjones ];
+  };
+}