diff mbox

gnu: asciidoc: Use local docbook-xsl package.

Message ID 20160803210752.16650-1-sleep_walker@gnu.org
State New
Headers show

Commit Message

Tomáš Čech Aug. 3, 2016, 9:07 p.m. UTC
* gnu/packages/documentation.scm(asciidoc): New input docbook-xsl,
  replace use of online source and prefer docbook-xsl package.
---
 gnu/packages/documentation.scm | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

Comments

Leo Famulari Aug. 10, 2016, 6:48 p.m. UTC | #1
On Wed, Aug 03, 2016 at 11:07:52PM +0200, Tomáš Čech wrote:
> * gnu/packages/documentation.scm(asciidoc): New input docbook-xsl,
>   replace use of online source and prefer docbook-xsl package.

Not having any practical experience with docbook-xsl, I think this
change looks fine, in general.

I think the commit message should be like this:

* gnu/packages/documentation.scm (asciidoc)[inputs]: Add docbook-xsl.
[arguments]: Add 'make-local-docbook-xsl' phase.

That is closer to the GNU Changelog format that we prefer to use.

> +         (add-before
> +             'install 'make-local-docbook-xsl

I think these two lines can collapsed into a single line.

> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (substitute* (find-files "docbook-xsl" ".*\\.xsl$")
> +               (("xsl:import href=\"http://docbook.sourceforge.net/release/xsl/current")
> +                (string-append
> +                 "xsl:import href=\""
> +                 (string-append (assoc-ref inputs "docbook-xsl")
> +                                "/xml/xsl/docbook-xsl-"
> +                                ,(package-version docbook-xsl))))))))))

My limited sense of Scheme style tells me to shift the previous 4 lines
to the right by 1 character.

The function should return #t, since (substitute*) has no defined return
value.
Tomáš Čech Aug. 14, 2016, 5:17 p.m. UTC | #2
On Wed, Aug 10, 2016 at 02:48:46PM -0400, Leo Famulari wrote:
>On Wed, Aug 03, 2016 at 11:07:52PM +0200, Tomáš Čech wrote:
>> * gnu/packages/documentation.scm(asciidoc): New input docbook-xsl,
>>   replace use of online source and prefer docbook-xsl package.
>
>Not having any practical experience with docbook-xsl, I think this
>change looks fine, in general.
>
>I think the commit message should be like this:
>
>* gnu/packages/documentation.scm (asciidoc)[inputs]: Add docbook-xsl.
>[arguments]: Add 'make-local-docbook-xsl' phase.
>
>That is closer to the GNU Changelog format that we prefer to use.

I see your point and thanks for the pointer, I'll try to read more
about that.

>
>> +         (add-before
>> +             'install 'make-local-docbook-xsl
>
>I think these two lines can collapsed into a single line.
>
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             (substitute* (find-files "docbook-xsl" ".*\\.xsl$")
>> +               (("xsl:import href=\"http://docbook.sourceforge.net/release/xsl/current")

I'd agree but my emacs autoindentation then does crazy things:

         (add-before 'install 'make-local-docbook-xsl
                     (lambda* (#:key inputs #:allow-other-keys)
                       (substitute* (find-files "docbook-xsl" ".*\\.xsl$")
                         (("xsl:import href=\"http://docbook.sourceforge.net/release/xsl/current")
                          (string-append
                           "xsl:import href=\""
                           (string-append (assoc-ref inputs "docbook-xsl")
                                          "/xml/xsl/docbook-xsl-"
                                          ,(package-version docbook-xsl))))))))))

So, can I adjust indentation settings or is it expected?

>> +                (string-append
>> +                 "xsl:import href=\""
>> +                 (string-append (assoc-ref inputs "docbook-xsl")
>> +                                "/xml/xsl/docbook-xsl-"
>> +                                ,(package-version docbook-xsl))))))))))
>
>My limited sense of Scheme style tells me to shift the previous 4 lines
>to the right by 1 character.

Are you sure about that? It's 2nd and 3rd parameter to `string-append'...

>The function should return #t, since (substitute*) has no defined return
>value.

I see. Fixed.

Thanks for review!

S_W
Ludovic Courtès Aug. 29, 2016, 3:41 p.m. UTC | #3
Hello,

Tomáš Čech <sleep_walker@gnu.org> skribis:

> * gnu/packages/documentation.scm(asciidoc): New input docbook-xsl,
>   replace use of online source and prefer docbook-xsl package.

Rather:

* gnu/packages/documentation (asciidoc)[inputs]: Add PYTHON-2 and
DOCBOOK-XSL.
(arguments): Add 'make-local-docbook-xsl' phase.

> diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
> index 72af708..98d30e7 100644
> --- a/gnu/packages/documentation.scm
> +++ b/gnu/packages/documentation.scm
> @@ -49,8 +49,22 @@
>                 (base32
>                  "1w71nk527lq504njmaf0vzr93pgahkgzzxzglrq6bay8cw2rvnvq"))))
>      (build-system gnu-build-system)
> -    (arguments '(#:tests? #f))                    ; no 'check' target
> -    (inputs `(("python" ,python-2)))
> +    (arguments
> +     `(#:tests? #f                     ; no 'check' target
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-before
> +             'install 'make-local-docbook-xsl
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (substitute* (find-files "docbook-xsl" ".*\\.xsl$")
> +               (("xsl:import href=\"http://docbook.sourceforge.net/release/xsl/current")
> +                (string-append
> +                 "xsl:import href=\""
> +                 (string-append (assoc-ref inputs "docbook-xsl")
> +                                "/xml/xsl/docbook-xsl-"
> +                                ,(package-version docbook-xsl))))))))))
> +    (inputs `(("python" ,python-2)
> +              ("docbook-xsl" ,docbook-xsl)))

Otherwise LGTM, please push!

Ludo’.
Tomáš Čech Aug. 30, 2016, 4:51 p.m. UTC | #4
On Mon, Aug 29, 2016 at 05:41:59PM +0200, Ludovic Courtès wrote:
>Hello,
>
>Tomáš Čech <sleep_walker@gnu.org> skribis:
>
>> * gnu/packages/documentation.scm(asciidoc): New input docbook-xsl,
>>   replace use of online source and prefer docbook-xsl package.
>
>Rather:
>
>* gnu/packages/documentation (asciidoc)[inputs]: Add PYTHON-2 and
>DOCBOOK-XSL.
>(arguments): Add 'make-local-docbook-xsl' phase.

Shouldn't that be rather
[arguments]:
as it is in "the same level" as [inputs]?
(and python-2 was already among inputs already)

Thanks for your patience!

>> diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
>> index 72af708..98d30e7 100644
>> --- a/gnu/packages/documentation.scm
>> +++ b/gnu/packages/documentation.scm
>> @@ -49,8 +49,22 @@
>>                 (base32
>>                  "1w71nk527lq504njmaf0vzr93pgahkgzzxzglrq6bay8cw2rvnvq"))))
>>      (build-system gnu-build-system)
>> -    (arguments '(#:tests? #f))                    ; no 'check' target
>> -    (inputs `(("python" ,python-2)))
>> +    (arguments
>> +     `(#:tests? #f                     ; no 'check' target
>> +       #:phases
>> +       (modify-phases %standard-phases
>> +         (add-before
>> +             'install 'make-local-docbook-xsl
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             (substitute* (find-files "docbook-xsl" ".*\\.xsl$")
>> +               (("xsl:import href=\"http://docbook.sourceforge.net/release/xsl/current")
>> +                (string-append
>> +                 "xsl:import href=\""
>> +                 (string-append (assoc-ref inputs "docbook-xsl")
>> +                                "/xml/xsl/docbook-xsl-"
>> +                                ,(package-version docbook-xsl))))))))))
>> +    (inputs `(("python" ,python-2)
>> +              ("docbook-xsl" ,docbook-xsl)))
>
>Otherwise LGTM, please push!

I'm afraid that Leo already pushed that.

Thanks
diff mbox

Patch

diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index 72af708..98d30e7 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -49,8 +49,22 @@ 
                (base32
                 "1w71nk527lq504njmaf0vzr93pgahkgzzxzglrq6bay8cw2rvnvq"))))
     (build-system gnu-build-system)
-    (arguments '(#:tests? #f))                    ; no 'check' target
-    (inputs `(("python" ,python-2)))
+    (arguments
+     `(#:tests? #f                     ; no 'check' target
+       #:phases
+       (modify-phases %standard-phases
+         (add-before
+             'install 'make-local-docbook-xsl
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* (find-files "docbook-xsl" ".*\\.xsl$")
+               (("xsl:import href=\"http://docbook.sourceforge.net/release/xsl/current")
+                (string-append
+                 "xsl:import href=\""
+                 (string-append (assoc-ref inputs "docbook-xsl")
+                                "/xml/xsl/docbook-xsl-"
+                                ,(package-version docbook-xsl))))))))))
+    (inputs `(("python" ,python-2)
+              ("docbook-xsl" ,docbook-xsl)))
     (home-page "http://www.methods.co.nz/asciidoc/")
     (synopsis "Text-based document generation system")
     (description