unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#60820] [PATCH] Add 'totpages' latex package.
@ 2023-01-14 22:36 Matthieu Lemerre
  2023-01-15 18:26 ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Matthieu Lemerre @ 2023-01-14 22:36 UTC (permalink / raw)
  To: 60820


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





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#60820] [PATCH] Add 'totpages' latex package.
  2023-01-14 22:36 [bug#60820] [PATCH] Add 'totpages' latex package Matthieu Lemerre
@ 2023-01-15 18:26 ` Nicolas Goaziou
  2023-01-23 21:55   ` racin
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2023-01-15 18:26 UTC (permalink / raw)
  To: Matthieu Lemerre; +Cc: 60820

Hello,

Matthieu Lemerre <racin@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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#60820] [PATCH] Add 'totpages' latex package.
  2023-01-15 18:26 ` Nicolas Goaziou
@ 2023-01-23 21:55   ` racin
  2023-01-24 13:16     ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: racin @ 2023-01-23 21:55 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 60820

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#60820] [PATCH] Add 'totpages' latex package.
  2023-01-23 21:55   ` racin
@ 2023-01-24 13:16     ` Nicolas Goaziou
  2023-01-24 22:25       ` racin
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2023-01-24 13:16 UTC (permalink / raw)
  To: racin; +Cc: 60820

Hello,

racin@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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#60820] [PATCH] Add 'totpages' latex package.
  2023-01-24 13:16     ` Nicolas Goaziou
@ 2023-01-24 22:25       ` racin
  2023-01-25 16:35         ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: racin @ 2023-01-24 22:25 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 60820

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#60820] [PATCH] Add 'totpages' latex package.
  2023-01-24 22:25       ` racin
@ 2023-01-25 16:35         ` Nicolas Goaziou
  2023-01-25 17:42           ` racin
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2023-01-25 16:35 UTC (permalink / raw)
  To: racin; +Cc: 60820

Hello,

racin@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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#60820] [PATCH] Add 'totpages' latex package.
  2023-01-25 16:35         ` Nicolas Goaziou
@ 2023-01-25 17:42           ` racin
  2023-01-27  9:02             ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: racin @ 2023-01-25 17:42 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 60820

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#60820] [PATCH] Add 'totpages' latex package.
  2023-01-25 17:42           ` racin
@ 2023-01-27  9:02             ` Nicolas Goaziou
  2023-04-18 13:33               ` bug#60820: " Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2023-01-27  9:02 UTC (permalink / raw)
  To: racin; +Cc: 60820

Hello,

racin@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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#60820: [PATCH] Add 'totpages' latex package.
  2023-01-27  9:02             ` Nicolas Goaziou
@ 2023-04-18 13:33               ` Nicolas Goaziou
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2023-04-18 13:33 UTC (permalink / raw)
  To: racin; +Cc: 60820

Hello,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> racin@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




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-04-18 13:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-14 22:36 [bug#60820] [PATCH] Add 'totpages' latex package Matthieu Lemerre
2023-01-15 18:26 ` Nicolas Goaziou
2023-01-23 21:55   ` racin
2023-01-24 13:16     ` Nicolas Goaziou
2023-01-24 22:25       ` racin
2023-01-25 16:35         ` Nicolas Goaziou
2023-01-25 17:42           ` racin
2023-01-27  9:02             ` Nicolas Goaziou
2023-04-18 13:33               ` bug#60820: " Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).