New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asciidoctor: add rouge to dependencies #63689
Conversation
@@ -0,0 +1,3 @@ | |||
Rebuild gemset.nix and Gemfile.lock with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
offtopic: to be pedantic, you should use .adoc here =)
I like that README is added (I've had this chicken-and-egg problem with
to rebuild Also, why should we add |
I've tried pygments a while back with asciidoctor and it just didn't work.. Found this to be an easy workaround for what I needed instead of debugging pygments (or maybe failure to use it?) On a more global scale, adding it here costs little and gives users more choice what to use |
Regarding bundix, I've added nix-shell to be able to regenerate it without having the package installed.. As I stumbled on it a few times - otherwise it fails on missing dependencies. |
I've tried
Ok. I don't know Ruby packaging details, I'm curious how it behaves when I use |
{ pkgs ? import <nixpkgs> {} }: | ||
pkgs.mkShell { | ||
# TODO: how to reuse the list from default.nix? | ||
buildInputs = with pkgs; [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd think with #62971 this would be unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, not quite sure what you mean :) do you mean this file, or this list here? (I'm still rather new to nix language, and inter-module dependency handling)
any chance you could update the PR to the preferred approach? (I think I checked that GH checkbox allowing maintainer updates)
please also see my other comment on the PR where I failed to generate the gemset and Gemfile.lock in any other approach I've tried...
Thanks, I'll try reproducing the dependencies error when regenerating. Will report back here when done. Will update readme too. |
@svalaskevicius have you reproduced the issue? |
Sorry didn't have a chance yet. Will try to do it this evening :) |
ok, reproduced, (@danbst) your command works ok only if Gemfile.lock is present, however, it doesn't add new libs to it, only converts the lock file to gemset.nix. to add rouge to the lock file, one apparently needs to run
Thus, I still don't see any other alternative rather than in this PR. I'll update the readme to adoc though :) |
83cf1df
to
939683f
Compare
done. also when testing now I noticed that rouge and some other dep have upped their version |
@svalaskevicius thanks! Makes sense. I found a way to remove duplication. Here's diff: diff --git a/pkgs/tools/typesetting/asciidoctor/default.nix b/pkgs/tools/typesetting/asciidoctor/default.nix
index 9508f3ff023..e46ebcf18ae 100644
--- a/pkgs/tools/typesetting/asciidoctor/default.nix
+++ b/pkgs/tools/typesetting/asciidoctor/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, lib, bundlerApp, ruby
+{ stdenv, lib, bundlerApp, ruby, bundix, mkShell
# Dependencies of the 'mathematical' package
, cmake, bison, flex, glib, pkgconfig, cairo
, pango, gdk_pixbuf, libxml2, python3, patchelf
}:
-bundlerApp {
+bundlerApp rec {
inherit ruby;
pname = "asciidoctor";
gemdir = ./.;
@@ -43,6 +43,12 @@ bundlerApp {
};
};
+ passthru.updateShell = mkShell {
+ buildInputs = (gemConfig.mathematical {}).buildInputs ++ [
+ bundix
+ ];
+ };
+
meta = with lib; {
description = "A faster Asciidoc processor written in Ruby";
homepage = http://asciidoctor.org/;
diff --git a/pkgs/tools/typesetting/asciidoctor/update.sh b/pkgs/tools/typesetting/asciidoctor/update.sh
new file mode 100755
index 00000000000..10a053a847b
--- /dev/null
+++ b/pkgs/tools/typesetting/asciidoctor/update.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+rm gemset.nix Gemfile.lock
+nix-shell ../../../.. -A asciidoctor.updateShell --run '
+ bundix -m --bundle-pack-path $TMPDIR/asciidoctor-ruby-bundle
+'
+rm -r .bundle
\ No newline at end of file That can also remove the need for README, as If you like it, you may embed it into this PR. Otherwise I can push it separately. |
Thanks! I'll test and add it a bit later :) |
939683f
to
bfeaa8f
Compare
works well! I've set you as the author in the commit @danbst if it's ok with you :) |
@svalaskevicius thanks for doublechecking! |
Motivation for this change
Add syntax highlighting support via rouge.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)