Merge pull request #64298 from michaelpj/imp/mathematical-epub3
asciidoctor: include the asciidoctor-epub3 gem
This commit is contained in:
commit
a0f534865e
7 changed files with 133 additions and 52 deletions
|
@ -24,6 +24,7 @@
|
||||||
, msgpack, qt59, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, buildRubyGem
|
, msgpack, qt59, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, buildRubyGem
|
||||||
, cairo, re2, rake, gobject-introspection, gdk_pixbuf, zeromq, czmq, graphicsmagick, libcxx
|
, cairo, re2, rake, gobject-introspection, gdk_pixbuf, zeromq, czmq, graphicsmagick, libcxx
|
||||||
, file, libvirt, glib, vips, taglib, libopus, linux-pam, libidn, protobuf, fribidi, harfbuzz
|
, file, libvirt, glib, vips, taglib, libopus, linux-pam, libidn, protobuf, fribidi, harfbuzz
|
||||||
|
, bison, flex, pango, python3, patchelf
|
||||||
, libselinux ? null, libsepol ? null
|
, libselinux ? null, libsepol ? null
|
||||||
}@args:
|
}@args:
|
||||||
|
|
||||||
|
@ -245,6 +246,32 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mathematical = attrs: {
|
||||||
|
buildInputs = [
|
||||||
|
cmake
|
||||||
|
bison
|
||||||
|
flex
|
||||||
|
glib
|
||||||
|
pkgconfig
|
||||||
|
cairo
|
||||||
|
pango
|
||||||
|
gdk_pixbuf
|
||||||
|
libxml2
|
||||||
|
python3
|
||||||
|
];
|
||||||
|
|
||||||
|
# The ruby build script takes care of this
|
||||||
|
dontUseCmakeConfigure = true;
|
||||||
|
|
||||||
|
# For some reason 'mathematical.so' is missing cairo and glib in its RPATH, add them explicitly here
|
||||||
|
postFixup = lib.optionalString stdenv.isLinux ''
|
||||||
|
soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so"
|
||||||
|
${patchelf}/bin/patchelf \
|
||||||
|
--set-rpath "${lib.makeLibraryPath [ glib cairo ]}:$(${patchelf}/bin/patchelf --print-rpath "$soPath")" \
|
||||||
|
"$soPath"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
magic = attrs: {
|
magic = attrs: {
|
||||||
buildInputs = [ file ];
|
buildInputs = [ file ];
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
|
|
@ -2,6 +2,7 @@ source 'https://rubygems.org'
|
||||||
gem 'asciidoctor'
|
gem 'asciidoctor'
|
||||||
gem 'asciidoctor-diagram'
|
gem 'asciidoctor-diagram'
|
||||||
gem 'asciidoctor-pdf'
|
gem 'asciidoctor-pdf'
|
||||||
|
gem 'asciidoctor-epub3'
|
||||||
gem 'asciidoctor-mathematical'
|
gem 'asciidoctor-mathematical'
|
||||||
gem 'coderay'
|
gem 'coderay'
|
||||||
gem 'pygments.rb'
|
gem 'pygments.rb'
|
||||||
|
|
|
@ -8,6 +8,11 @@ GEM
|
||||||
asciidoctor (2.0.10)
|
asciidoctor (2.0.10)
|
||||||
asciidoctor-diagram (1.5.18)
|
asciidoctor-diagram (1.5.18)
|
||||||
asciidoctor (>= 1.5.0, < 3.x)
|
asciidoctor (>= 1.5.0, < 3.x)
|
||||||
|
asciidoctor-epub3 (1.5.0.alpha.9)
|
||||||
|
asciidoctor (>= 1.5.0, < 3.0.0)
|
||||||
|
concurrent-ruby (~> 1.1.5)
|
||||||
|
gepub (~> 1.0.2)
|
||||||
|
thread_safe (~> 0.3.6)
|
||||||
asciidoctor-mathematical (0.3.0)
|
asciidoctor-mathematical (0.3.0)
|
||||||
asciidoctor (~> 2.0, >= 2.0.0)
|
asciidoctor (~> 2.0, >= 2.0.0)
|
||||||
mathematical (~> 1.5, >= 1.5.8)
|
mathematical (~> 1.5, >= 1.5.8)
|
||||||
|
@ -27,12 +32,18 @@ GEM
|
||||||
concurrent-ruby (1.1.5)
|
concurrent-ruby (1.1.5)
|
||||||
css_parser (1.7.0)
|
css_parser (1.7.0)
|
||||||
addressable
|
addressable
|
||||||
|
gepub (1.0.4)
|
||||||
|
nokogiri (>= 1.8.2, < 1.11)
|
||||||
|
rubyzip (>= 1.1.1)
|
||||||
hashery (2.1.2)
|
hashery (2.1.2)
|
||||||
i18n (1.6.0)
|
i18n (1.6.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
mathematical (1.6.12)
|
mathematical (1.6.12)
|
||||||
ruby-enum (~> 0.4)
|
ruby-enum (~> 0.4)
|
||||||
|
mini_portile2 (2.4.0)
|
||||||
multi_json (1.13.1)
|
multi_json (1.13.1)
|
||||||
|
nokogiri (1.10.3)
|
||||||
|
mini_portile2 (~> 2.4.0)
|
||||||
pdf-core (0.7.0)
|
pdf-core (0.7.0)
|
||||||
pdf-reader (2.2.0)
|
pdf-reader (2.2.0)
|
||||||
Ascii85 (~> 1.0.0)
|
Ascii85 (~> 1.0.0)
|
||||||
|
@ -61,6 +72,7 @@ GEM
|
||||||
ruby-enum (0.7.2)
|
ruby-enum (0.7.2)
|
||||||
i18n
|
i18n
|
||||||
ruby-rc4 (0.1.5)
|
ruby-rc4 (0.1.5)
|
||||||
|
rubyzip (1.2.3)
|
||||||
safe_yaml (1.0.5)
|
safe_yaml (1.0.5)
|
||||||
thread_safe (0.3.6)
|
thread_safe (0.3.6)
|
||||||
treetop (1.5.3)
|
treetop (1.5.3)
|
||||||
|
@ -73,6 +85,7 @@ PLATFORMS
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
asciidoctor
|
asciidoctor
|
||||||
asciidoctor-diagram
|
asciidoctor-diagram
|
||||||
|
asciidoctor-epub3
|
||||||
asciidoctor-mathematical
|
asciidoctor-mathematical
|
||||||
asciidoctor-pdf
|
asciidoctor-pdf
|
||||||
coderay
|
coderay
|
||||||
|
|
|
@ -1,59 +1,46 @@
|
||||||
{ stdenv, lib, bundlerApp, ruby, bundix, mkShell
|
{ lib, bundlerApp, makeWrapper,
|
||||||
# Dependencies of the 'mathematical' package
|
# Optional dependencies, can be null
|
||||||
, cmake, bison, flex, glib, pkgconfig, cairo
|
epubcheck, kindlegen,
|
||||||
, pango, gdk_pixbuf, libxml2, python3, patchelf
|
# For the update shell
|
||||||
|
mkShell, bundix
|
||||||
}:
|
}:
|
||||||
|
|
||||||
bundlerApp rec {
|
let
|
||||||
inherit ruby;
|
app = bundlerApp {
|
||||||
pname = "asciidoctor";
|
pname = "asciidoctor";
|
||||||
gemdir = ./.;
|
gemdir = ./.;
|
||||||
|
|
||||||
exes = [
|
exes = [
|
||||||
"asciidoctor"
|
"asciidoctor"
|
||||||
"asciidoctor-pdf"
|
"asciidoctor-pdf"
|
||||||
"asciidoctor-safe"
|
"asciidoctor-safe"
|
||||||
];
|
"asciidoctor-epub3"
|
||||||
|
];
|
||||||
|
|
||||||
gemConfig = {
|
buildInputs = [ makeWrapper ];
|
||||||
mathematical = attrs: {
|
|
||||||
buildInputs = [
|
|
||||||
cmake
|
|
||||||
bison
|
|
||||||
flex
|
|
||||||
glib
|
|
||||||
pkgconfig
|
|
||||||
cairo
|
|
||||||
pango
|
|
||||||
gdk_pixbuf
|
|
||||||
libxml2
|
|
||||||
python3
|
|
||||||
];
|
|
||||||
|
|
||||||
# The ruby build script takes care of this
|
postBuild = ''
|
||||||
dontUseCmakeConfigure = true;
|
wrapProgram "$out/bin/asciidoctor-epub3" \
|
||||||
|
${lib.optionalString (epubcheck != null) "--set EPUBCHECK ${epubcheck}/bin/epubcheck"} \
|
||||||
# For some reason 'mathematical.so' is missing cairo and glib in its RPATH, add them explicitly here
|
${lib.optionalString (kindlegen != null) "--set KINDLEGEN ${kindlegen}/bin/kindlegen"}
|
||||||
postFixup = lib.optionalString stdenv.isLinux ''
|
|
||||||
soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so"
|
|
||||||
${patchelf}/bin/patchelf \
|
|
||||||
--set-rpath "${lib.makeLibraryPath [ glib cairo ]}:$(${patchelf}/bin/patchelf --print-rpath "$soPath")" \
|
|
||||||
"$soPath"
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
inherit updateShell;
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A faster Asciidoc processor written in Ruby";
|
||||||
|
homepage = https://asciidoctor.org/;
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ gpyh ];
|
||||||
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
passthru.updateShell = mkShell {
|
updateShell = mkShell {
|
||||||
buildInputs = (gemConfig.mathematical {}).buildInputs ++ [
|
inputsFrom = lib.attrValues app.gems;
|
||||||
bundix
|
buildInputs = [ bundix ];
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
in
|
||||||
meta = with lib; {
|
app
|
||||||
description = "A faster Asciidoc processor written in Ruby";
|
|
||||||
homepage = https://asciidoctor.org/;
|
|
||||||
license = licenses.mit;
|
|
||||||
maintainers = with maintainers; [ gpyh ];
|
|
||||||
platforms = platforms.unix;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
|
@ -51,6 +51,17 @@
|
||||||
};
|
};
|
||||||
version = "1.5.18";
|
version = "1.5.18";
|
||||||
};
|
};
|
||||||
|
asciidoctor-epub3 = {
|
||||||
|
dependencies = ["asciidoctor" "concurrent-ruby" "gepub" "thread_safe"];
|
||||||
|
groups = ["default"];
|
||||||
|
platforms = [];
|
||||||
|
source = {
|
||||||
|
remotes = ["https://rubygems.org"];
|
||||||
|
sha256 = "056yp0z64b1fhhkzz2kaiqsd11gpbgx2d1yjgq7cqma9c70bbxa5";
|
||||||
|
type = "gem";
|
||||||
|
};
|
||||||
|
version = "1.5.0.alpha.9";
|
||||||
|
};
|
||||||
asciidoctor-mathematical = {
|
asciidoctor-mathematical = {
|
||||||
dependencies = ["asciidoctor" "mathematical" "ruby-enum"];
|
dependencies = ["asciidoctor" "mathematical" "ruby-enum"];
|
||||||
groups = ["default"];
|
groups = ["default"];
|
||||||
|
@ -104,6 +115,17 @@
|
||||||
};
|
};
|
||||||
version = "1.7.0";
|
version = "1.7.0";
|
||||||
};
|
};
|
||||||
|
gepub = {
|
||||||
|
dependencies = ["nokogiri" "rubyzip"];
|
||||||
|
groups = ["default"];
|
||||||
|
platforms = [];
|
||||||
|
source = {
|
||||||
|
remotes = ["https://rubygems.org"];
|
||||||
|
sha256 = "1kg2h0mscb2hq6l3wjzq5fp5vw4552nglq8n9pawm7bzacf1gzyf";
|
||||||
|
type = "gem";
|
||||||
|
};
|
||||||
|
version = "1.0.4";
|
||||||
|
};
|
||||||
hashery = {
|
hashery = {
|
||||||
groups = ["default"];
|
groups = ["default"];
|
||||||
platforms = [];
|
platforms = [];
|
||||||
|
@ -136,6 +158,16 @@
|
||||||
};
|
};
|
||||||
version = "1.6.12";
|
version = "1.6.12";
|
||||||
};
|
};
|
||||||
|
mini_portile2 = {
|
||||||
|
groups = ["default"];
|
||||||
|
platforms = [];
|
||||||
|
source = {
|
||||||
|
remotes = ["https://rubygems.org"];
|
||||||
|
sha256 = "15zplpfw3knqifj9bpf604rb3wc1vhq6363pd6lvhayng8wql5vy";
|
||||||
|
type = "gem";
|
||||||
|
};
|
||||||
|
version = "2.4.0";
|
||||||
|
};
|
||||||
multi_json = {
|
multi_json = {
|
||||||
groups = ["default"];
|
groups = ["default"];
|
||||||
platforms = [];
|
platforms = [];
|
||||||
|
@ -146,6 +178,17 @@
|
||||||
};
|
};
|
||||||
version = "1.13.1";
|
version = "1.13.1";
|
||||||
};
|
};
|
||||||
|
nokogiri = {
|
||||||
|
dependencies = ["mini_portile2"];
|
||||||
|
groups = ["default"];
|
||||||
|
platforms = [];
|
||||||
|
source = {
|
||||||
|
remotes = ["https://rubygems.org"];
|
||||||
|
sha256 = "02bjydih0j515szfv9mls195cvpyidh6ixm7dwbl3s2sbaxxk5s4";
|
||||||
|
type = "gem";
|
||||||
|
};
|
||||||
|
version = "1.10.3";
|
||||||
|
};
|
||||||
pdf-core = {
|
pdf-core = {
|
||||||
groups = ["default"];
|
groups = ["default"];
|
||||||
platforms = [];
|
platforms = [];
|
||||||
|
@ -284,6 +327,16 @@
|
||||||
};
|
};
|
||||||
version = "0.1.5";
|
version = "0.1.5";
|
||||||
};
|
};
|
||||||
|
rubyzip = {
|
||||||
|
groups = ["default"];
|
||||||
|
platforms = [];
|
||||||
|
source = {
|
||||||
|
remotes = ["https://rubygems.org"];
|
||||||
|
sha256 = "1w9gw28ly3zyqydnm8phxchf4ymyjl2r7zf7c12z8kla10cpmhlc";
|
||||||
|
type = "gem";
|
||||||
|
};
|
||||||
|
version = "1.2.3";
|
||||||
|
};
|
||||||
safe_yaml = {
|
safe_yaml = {
|
||||||
groups = ["default"];
|
groups = ["default"];
|
||||||
platforms = [];
|
platforms = [];
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
rm gemset.nix Gemfile.lock
|
|
||||||
nix-shell ../../../.. -A asciidoctor.updateShell --run '
|
nix-shell ../../../.. -A asciidoctor.updateShell --run '
|
||||||
|
rm gemset.nix Gemfile.lock
|
||||||
bundix -m --bundle-pack-path $TMPDIR/asciidoctor-ruby-bundle
|
bundix -m --bundle-pack-path $TMPDIR/asciidoctor-ruby-bundle
|
||||||
|
rm -r .bundle
|
||||||
'
|
'
|
||||||
rm -r .bundle
|
|
||||||
|
|
|
@ -1928,7 +1928,7 @@ in
|
||||||
enableExtraPlugins = true;
|
enableExtraPlugins = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
asciidoctor = callPackage ../tools/typesetting/asciidoctor { };
|
asciidoctor = callPackage ../tools/typesetting/asciidoctor { kindlegen = null; };
|
||||||
|
|
||||||
asunder = callPackage ../applications/audio/asunder { };
|
asunder = callPackage ../applications/audio/asunder { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue