summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2016-08-28 22:24:21 -0400
committerGitHub <noreply@github.com>2016-08-28 22:24:21 -0400
commit7a073c1c6ddf98752cfe12f719f82dcd09d22079 (patch)
treed0d5fb712833b7ba89e791afa9f618837db080a5 /pkgs/tools
parente5c3a52afcd601df5bf8abc8c407d0e47ba266f8 (diff)
parentc08b9b039a5470a8e6f7d557e65b44363de28f14 (diff)
downloadnixlib-7a073c1c6ddf98752cfe12f719f82dcd09d22079.tar
nixlib-7a073c1c6ddf98752cfe12f719f82dcd09d22079.tar.gz
nixlib-7a073c1c6ddf98752cfe12f719f82dcd09d22079.tar.bz2
nixlib-7a073c1c6ddf98752cfe12f719f82dcd09d22079.tar.lz
nixlib-7a073c1c6ddf98752cfe12f719f82dcd09d22079.tar.xz
nixlib-7a073c1c6ddf98752cfe12f719f82dcd09d22079.tar.zst
nixlib-7a073c1c6ddf98752cfe12f719f82dcd09d22079.zip
Merge pull request #18057 from peterhoeg/kindlegen
kindlegen: init at 2.9
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/typesetting/kindlegen/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/tools/typesetting/kindlegen/default.nix b/pkgs/tools/typesetting/kindlegen/default.nix
new file mode 100644
index 000000000000..159119a8a710
--- /dev/null
+++ b/pkgs/tools/typesetting/kindlegen/default.nix
@@ -0,0 +1,48 @@
+{ fetchurl, stdenv }:
+
+let
+  version = "2.9";
+  fileVersion = builtins.replaceStrings [ "." ] [ "_" ] version;
+
+  sha256 = {
+    "x86_64-linux"  = "15i20kzhdcmi94w7wfhqbl6j20v47cdakjm2mn3x8w495iddna4q";
+    "i686-linux"    = "15i20kzhdcmi94w7wfhqbl6j20v47cdakjm2mn3x8w495iddna4q";
+    "x86_64-darwin" = "0zniyn0s41fxqrajbgwxbcsj5vzf9m7a6yvdz2b11mphr00kpbbs";
+    "i686-darwin"   = "0zniyn0s41fxqrajbgwxbcsj5vzf9m7a6yvdz2b11mphr00kpbbs";
+    "x86_64-cygwin" = "02slfh1bbpijay4skj85cjiv7z43ha8vm5aa1lwiqjk86qbl1f3h";
+    "i686-cygwin"   = "02slfh1bbpijay4skj85cjiv7z43ha8vm5aa1lwiqjk86qbl1f3h";
+  }."${stdenv.system}" or (throw "system #{stdenv.system.} is not supported");
+
+  url = {
+    "x86_64-linux"  = "http://kindlegen.s3.amazonaws.com/kindlegen_linux_2.6_i386_v${fileVersion}.tar.gz";
+    "i686-linux"    = "http://kindlegen.s3.amazonaws.com/kindlegen_linux_2.6_i386_v${fileVersion}.tar.gz";
+    "x86_64-darwin" = "http://kindlegen.s3.amazonaws.com/KindleGen_Mac_i386_v${fileVersion}.zip";
+    "i686-darwin"   = "http://kindlegen.s3.amazonaws.com/KindleGen_Mac_i386_v${fileVersion}.zip";
+    "x86_64-cygwin" = "http://kindlegen.s3.amazonaws.com/kindlegen_win32_v${fileVersion}.zip";
+    "i686-cygwin"   = "http://kindlegen.s3.amazonaws.com/kindlegen_win32_v${fileVersion}.zip";
+  }."${stdenv.system}" or (throw "system #{stdenv.system.} is not supported");
+
+in stdenv.mkDerivation rec {
+  name = "kindlegen-${version}";
+
+  src = fetchurl {
+    inherit url;
+    inherit sha256;
+  };
+
+  sourceRoot = ".";
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/kindlegen/doc
+    install -m755 kindlegen $out/bin/kindlegen
+    cp -r *.txt *.html docs/* $out/share/kindlegen/doc
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Convert documents to .mobi for use with Amazon Kindle";
+    homepage = https://www.amazon.com/gp/feature.html?docId=1000765211;
+    license = licenses.unfree;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "i686-darwin" "x86_64-cygwin" "i686-cygwin" ];
+  };
+}