GNU bug report logs - #60820
[PATCH] Add 'totpages' latex package.

Previous Next

Package: guix-patches;

Reported by: Matthieu Lemerre <racin <at> free.fr>

Date: Sat, 14 Jan 2023 22:37:01 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60820 in the body.
You can then email your comments to 60820 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#60820; Package guix-patches. (Sat, 14 Jan 2023 22:37:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthieu Lemerre <racin <at> free.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 14 Jan 2023 22:37:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Matthieu Lemerre <racin <at> free.fr>
To: guix-patches <at> gnu.org
Subject: [PATCH] Add 'totpages' latex package.
Date: Sat, 14 Jan 2023 23:36:34 +0100
Hi Guix!

This is my first guix package -- I have some texlive, ocaml and emacs packages missing for my installation, so I thought it would be best to share them!

Bests
Matthieu

---
 gnu/packages/tex.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index dafed9d3c3..1e28c36549 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -11935,6 +11935,25 @@ (define-public texlive-latex-hyphenat
 fonts.")
     (license license:lppl1.3c+)))
 
+(define-public texlive-latex-totpages
+  (package
+    (inherit (simple-texlive-package "texlive-latex-totpages"
+                                     (list "doc/latex/totpages/"
+                                           "source/latex/totpages/"
+                                           "tex/latex/totpages/")
+                                     (base32
+                                      "1mmya2fqdskyavw3hvdiygfyp9cll7bl4lpi7pl2jf9s7ds49j5a")
+                                     #:trivial? #t))
+    (build-system texlive-build-system)
+    (version "2.00")
+    (home-page "https://ctan.org/pkg/totpages")
+    (synopsis "Count pages in a document, and report last page number")
+    (description
+     "The package counts the actual pages in the document (as opposed to reporting the
+number of the last page, as does lastpage).  The counter itself may be shipped
+out to the DVI file.  The package uses the everyshi package for its task.")
+    (license license:lppl)))
+
 (define-public texlive-latex-lastpage
   (package
     (inherit (simple-texlive-package
-- 
2.38.1





Information forwarded to guix-patches <at> gnu.org:
bug#60820; Package guix-patches. (Sun, 15 Jan 2023 18:27:01 GMT) Full text and rfc822 format available.

Message #8 received at 60820 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Matthieu Lemerre <racin <at> free.fr>
Cc: 60820 <at> debbugs.gnu.org
Subject: Re: [bug#60820] [PATCH] Add 'totpages' latex package.
Date: Sun, 15 Jan 2023 19:26:06 +0100
Hello,

Matthieu Lemerre <racin <at> free.fr> writes:

> This is my first guix package -- I have some texlive, ocaml and emacs
> packages missing for my installation, so I thought it would be best to
> share them!

Thank you.

> +(define-public texlive-latex-totpages

The name should be texlive-totpages.

> +  (package
> +    (inherit (simple-texlive-package "texlive-latex-totpages"
> +                                     (list "doc/latex/totpages/"
> +                                           "source/latex/totpages/"
> +                                           "tex/latex/totpages/")
> +                                     (base32
> +                                      "1mmya2fqdskyavw3hvdiygfyp9cll7bl4lpi7pl2jf9s7ds49j5a")
> +                                     #:trivial? #t))

This is not a trivial package. The source contains ".ins" files that
should be used to generate the library itself. See, for example,
texlive-tabu package.

Regards,
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#60820; Package guix-patches. (Mon, 23 Jan 2023 21:56:02 GMT) Full text and rfc822 format available.

Message #11 received at 60820 <at> debbugs.gnu.org (full text, mbox):

From: racin <at> free.fr
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 60820 <at> debbugs.gnu.org
Subject: Re: [bug#60820] [PATCH] Add 'totpages' latex package.
Date: Mon, 23 Jan 2023 22:55:34 +0100 (CET)
Hello,

> > +(define-public texlive-latex-totpages

> The name should be texlive-totpages.

Is there a reason why? The package lives under the latex/ directory, like the hyphenat and totpages package, which have latex- in their name.

> > +  (package
> > +    (inherit (simple-texlive-package "texlive-latex-totpages"
> > +                                     (list "doc/latex/totpages/"
> > +                                           "source/latex/totpages/"
> > +                                           "tex/latex/totpages/")
> > +                                     (base32
> > +                                      "1mmya2fqdskyavw3hvdiygfyp9cll7bl4lpi7pl2jf9s7ds49j5a")
> > +                                     #:trivial? #t))

I am confused. The hyphenat package also has a .ins in its archive, and it is defined as a trivial package.
Maybe I need to just remove source/latex/totpages from the list?

Best regards,
Matthieu
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#60820; Package guix-patches. (Tue, 24 Jan 2023 13:17:02 GMT) Full text and rfc822 format available.

Message #14 received at 60820 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: racin <at> free.fr
Cc: 60820 <at> debbugs.gnu.org
Subject: Re: [bug#60820] [PATCH] Add 'totpages' latex package.
Date: Tue, 24 Jan 2023 14:16:29 +0100
Hello,

racin <at> free.fr writes:

>> > +(define-public texlive-latex-totpages
>
>> The name should be texlive-totpages.
>
> Is there a reason why? The package lives under the latex/ directory, like the hyphenat and totpages package, which have latex- in their name.

Guix dropped the directory part in package names months ago. It doesn't
always make sense: some packages install files in more than one
top-level directory. Also, it was decided packages should follow TeXLive
naming scheme, as used in "texlive.tlpdb".

As another data point, if you import hyphenat

  guix shell subversion -- import texlive hyphenat

you can see the suggested name is "texlive-hyphenat":

  (... (simple-texlive-package "texlive-hyphenat" ...))

Note also that a number of deprecation functions in "tex.scm" already
move packages to the suggested naming scheme, e.g.:

  (define-deprecated-package texlive-latex-beamer texlive-beamer)

It is unfortunate that hyphenat package was pushed with the wrong name.
It will need a deprecation notice at some point.

>> > +  (package
>> > +    (inherit (simple-texlive-package "texlive-latex-totpages"
>> > +                                     (list "doc/latex/totpages/"
>> > +                                           "source/latex/totpages/"
>> > +                                           "tex/latex/totpages/")
>> > +                                     (base32
>> > +                                      "1mmya2fqdskyavw3hvdiygfyp9cll7bl4lpi7pl2jf9s7ds49j5a")
>> > +                                     #:trivial? #t))
>
> I am confused. The hyphenat package also has a .ins in its archive,
> and it is defined as a trivial package.

Again, current hyphenat package is wrong. You should not consider it as
an example. It simply does not install enough files.

Guix provides an helper function to determine if a TeXLive package is
complete or not, `files-differ?' in (guix import texlive):

  $ guix repl
  scheme@(guix-user)> ,use (guix import texlive)
  scheme@(guix-user)> (files-differ? "/gnu/store/n7pbka00i9y7jvbvqpm2jzf961cmlyya-texlive-latex-hyphenat-59745/share" "hyphenat")
  $1 = ("texmf-dist/source/latex/hyphenat/hyphenat.ins" "texmf-dist/source/latex/hyphenat/hyphenat.dtx")

It means that hyphenat package doesn't install its sources. Not good.

> Maybe I need to just remove source/latex/totpages from the list?

Please don't. I already suggested how to deal with the issue. Do not
hesitate to ping me if you have troubles with what I suggest.

Regards,
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#60820; Package guix-patches. (Tue, 24 Jan 2023 22:26:02 GMT) Full text and rfc822 format available.

Message #17 received at 60820 <at> debbugs.gnu.org (full text, mbox):

From: racin <at> free.fr
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 60820 <60820 <at> debbugs.gnu.org>
Subject: Re: [bug#60820] [PATCH] Add 'totpages' latex package.
Date: Tue, 24 Jan 2023 23:25:37 +0100 (CET)
Hello,

> >> > +(define-public texlive-latex-totpages
> >
> >> The name should be texlive-totpages.
> >
> > Is there a reason why? The package lives under the latex/ directory, like the hyphenat and totpages package, which have latex- in their name.

> Guix dropped the directory part in package names months ago. It doesn't
> always make sense: some packages install files in more than one
> top-level directory. Also, it was decided packages should follow TeXLive
> naming scheme, as used in "texlive.tlpdb".

Thanks, it makes sense now. I did not understand that some cleanup was going on.

> It means that hyphenat package doesn't install its sources. Not good.

Thanks, I now know how to check if my package is correctly installed. 
I am not sure why we would want to install the sources in the final package,
instead of the .sty and the .pdf of the documentation

>  I already suggested how to deal with the issue. 
> Do not hesitate to ping me if you have troubles with what I suggest.

Thanks. The issue that I had is that the new definition is much more complex than what 
the importer suggested, or what old packages like hyphenat were doing, even though it is a 
very simple package. But I think I understand what it does and I can replicate that.

Best regards,
Matthieu




Information forwarded to guix-patches <at> gnu.org:
bug#60820; Package guix-patches. (Wed, 25 Jan 2023 16:37:01 GMT) Full text and rfc822 format available.

Message #20 received at 60820 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: racin <at> free.fr
Cc: 60820 <60820 <at> debbugs.gnu.org>
Subject: Re: [bug#60820] [PATCH] Add 'totpages' latex package.
Date: Wed, 25 Jan 2023 17:35:43 +0100
Hello,

racin <at> free.fr writes:

> Thanks, I now know how to check if my package is correctly installed. 
> I am not sure why we would want to install the sources in the final package,
> instead of the .sty and the .pdf of the documentation

It is not "instead of". We want to install all of them, while, when
possible, generating them from source.

Let's assume for a second Guix provides all TeX Live packages
piece-wise. The idea is that if someone installs all the packages, they
would get the whole TeX Live distribution, including the sources, i.e.,
the "texlive" package.

Regards,
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#60820; Package guix-patches. (Wed, 25 Jan 2023 17:43:02 GMT) Full text and rfc822 format available.

Message #23 received at 60820 <at> debbugs.gnu.org (full text, mbox):

From: racin <at> free.fr
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 60820 <60820 <at> debbugs.gnu.org>
Subject: Re: [bug#60820] [PATCH] Add 'totpages' latex package.
Date: Wed, 25 Jan 2023 18:42:46 +0100 (CET)
Hello,

> It is not "instead of". We want to install all of them, while, when
> possible, generating them from source.

> Let's assume for a second Guix provides all TeX Live packages
> piece-wise. The idea is that if someone installs all the packages, they
> would get the whole TeX Live distribution, including the sources, i.e.,
> the "texlive" package.

But if someone need the source, my understanding is that one can just use guix  build -S 
or some other command to retrieve them.
So I don't see the interest of having them too in the compiled output, as they are not useful for 
normal usage of the package; it seems to take up space for no reason.

Sorry to bother you with my questions, as I am new to guix.

Regards,
Matthieu Lemerre




Information forwarded to guix-patches <at> gnu.org:
bug#60820; Package guix-patches. (Fri, 27 Jan 2023 09:03:01 GMT) Full text and rfc822 format available.

Message #26 received at 60820 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: racin <at> free.fr
Cc: 60820 <60820 <at> debbugs.gnu.org>
Subject: Re: [bug#60820] [PATCH] Add 'totpages' latex package.
Date: Fri, 27 Jan 2023 10:02:11 +0100
Hello,

racin <at> free.fr writes:

>> Let's assume for a second Guix provides all TeX Live packages
>> piece-wise. The idea is that if someone installs all the packages, they
>> would get the whole TeX Live distribution, including the sources, i.e.,
>> the "texlive" package.
>
> But if someone need the source, my understanding is that one can just use guix  build -S 
> or some other command to retrieve them.
> So I don't see the interest of having them too in the compiled output, as they are not useful for 
> normal usage of the package; it seems to take up space for no reason.

I don't know if the reason is strong enough, but I gave you one above.

In any case, the main nit here is that we try to generate files from
source, which "#trivial? #t" prevents.

> Sorry to bother you with my questions, as I am new to guix.

No problem!

Regards,
-- 
Nicolas Goaziou




Reply sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
You have taken responsibility. (Tue, 18 Apr 2023 13:35:02 GMT) Full text and rfc822 format available.

Notification sent to Matthieu Lemerre <racin <at> free.fr>:
bug acknowledged by developer. (Tue, 18 Apr 2023 13:35:02 GMT) Full text and rfc822 format available.

Message #31 received at 60820-done <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: racin <at> free.fr
Cc: 60820 <60820-done <at> debbugs.gnu.org>
Subject: Re: [bug#60820] [PATCH] Add 'totpages' latex package.
Date: Tue, 18 Apr 2023 15:33:50 +0200
Hello,

Nicolas Goaziou <mail <at> nicolasgoaziou.fr> writes:

> racin <at> free.fr writes:
>
>> But if someone need the source, my understanding is that one can just use guix  build -S 
>> or some other command to retrieve them.
>> So I don't see the interest of having them too in the compiled output, as they are not useful for 
>> normal usage of the package; it seems to take up space for no reason.
>
> I don't know if the reason is strong enough, but I gave you one above.
>
> In any case, the main nit here is that we try to generate files from
> source, which "#trivial? #t" prevents.

I renamed the package, updated its definition, set propagated inputs,
and applied it. Thank you for the initial work.

You make a fair point with the source distribution, but unfortunately,
it didn't raise much interest so far. It might be worth asking it on
Guix Devel ML.

Meanwhile, I'm closing this bug.

Regards,
-- 
Nicolas Goaziou




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 17 May 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.