unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#65097] [PATCH] gnu: Add tk-img.
@ 2023-08-05 13:45 cage
  2023-09-05 14:21 ` Maxim Cournoyer
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: cage @ 2023-08-05 13:45 UTC (permalink / raw)
  To: 65097

Hi!

Note that this patch suffers for some problems:

- the package will skips the test (it complains "tk" can not be found");

- the manpages will not be installed as make installs exit with an error code because the script 'dtplite' can not be found (seems a TCL script according to README);

- the license seems X11 to me, but i am unsure (see the last paragraph in the file: "license.terms".

Any suggestion to improve the patch is appreciated! :)

Bye!
C.

---
 gnu/packages/tcl.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index b69dba2254..5bfcc63f96 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -509,3 +509,43 @@ (define-public go-github.com-nsf-gothic
     (description "Gothic contains Go bindings for Tcl/Tk.  The package contains
 only one type and one function that can be used to create a Tk interpreter.")
     (license license:expat))))
+
+
+
+(define-public tk-img
+  (package
+    (name "tk-img")
+    (version "1.4.14")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "mirror://sourceforge/tkimg/tkimg/1.4/tkimg%20"
+             version
+             "/Img-" version "-Source.tar.gz"))
+       (file-name (string-append "tkimg-" version ".tar.gz"))
+       (sha256
+        (base32 "08dvb8bfkxr919wp6fq14cfb9lz1v59jx1la4a6j4ks636wb243m"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f
+           #:phases
+           #~(modify-phases %standard-phases
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (invoke "make" "install-libraries"))))
+           #:configure-flags
+           #~(list
+              (string-append "--exec-prefix=" #$output)
+              (string-append "--with-tcl="
+                             (assoc-ref %build-inputs "tcl") "/lib")
+              (string-append "--with-tk="
+                             (assoc-ref %build-inputs "tk") "/lib"))))
+    (native-inputs
+     (list tcl
+           tk))
+    (home-page "https://sourceforge.net/projects/tkimg/")
+    (synopsis "The Img package adds several image formats to Tcl/Tk.")
+    (description
+     "The Img package adds several image formats to Tcl/Tk.")
+    (license license:public-domain)))

base-commit: 42ae42cf41e8f5e88422e30d801251a3427d7f3b
--
2.34.0




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

* [bug#65097] [PATCH] gnu: Add tk-img.
  2023-08-05 13:45 [bug#65097] [PATCH] gnu: Add tk-img cage
@ 2023-09-05 14:21 ` Maxim Cournoyer
  2023-09-05 14:43   ` Maxim Cournoyer
  2023-09-05 17:11   ` cage
  2023-09-05 14:22 ` Maxim Cournoyer
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Maxim Cournoyer @ 2023-09-05 14:21 UTC (permalink / raw)
  To: cage; +Cc: 65097

Hi!

cage <cage-dev@twistfold.it> writes:

> Hi!
>
> Note that this patch suffers for some problems:
>
> - the package will skips the test (it complains "tk" can not be found");

It'd be best to say so in the package, with a XXX comment (meaning
subpar/hackish/dirty) like:

#:tests #f   ;tests fails with "tk" can not be found error

> - the manpages will not be installed as make installs exit with an error code because the script 'dtplite' can not be found (seems a TCL script according to README);
>
> - the license seems X11 to me, but i am unsure (see the last paragraph in the file: "license.terms".
>
> Any suggestion to improve the patch is appreciated! :)
>
> Bye!
> C.
>
> ---
>  gnu/packages/tcl.scm | 40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
>
> diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
> index b69dba2254..5bfcc63f96 100644
> --- a/gnu/packages/tcl.scm
> +++ b/gnu/packages/tcl.scm
> @@ -509,3 +509,43 @@ (define-public go-github.com-nsf-gothic
>      (description "Gothic contains Go bindings for Tcl/Tk.  The package contains
>  only one type and one function that can be used to create a Tk interpreter.")
>      (license license:expat))))
> +
> +
> +
> +(define-public tk-img
> +  (package
> +    (name "tk-img")
> +    (version "1.4.14")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "mirror://sourceforge/tkimg/tkimg/1.4/tkimg%20"
> +             version
> +             "/Img-" version "-Source.tar.gz"))
> +       (file-name (string-append "tkimg-" version ".tar.gz"))
> +       (sha256
> +        (base32 "08dvb8bfkxr919wp6fq14cfb9lz1v59jx1la4a6j4ks636wb243m"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     (list #:tests? #f
> +           #:phases
> +           #~(modify-phases %standard-phases
> +               (replace 'install
> +                 (lambda* (#:key outputs #:allow-other-keys)
> +                   (invoke "make" "install-libraries"))))
> +           #:configure-flags
> +           #~(list
> +              (string-append "--exec-prefix=" #$output)
> +              (string-append "--with-tcl="
> +                             (assoc-ref %build-inputs "tcl") "/lib")
> +              (string-append "--with-tk="
> +                             (assoc-ref %build-inputs "tk") "/lib"))))
> +    (native-inputs
> +     (list tcl
> +           tk))

I'd format on a single line since there are less than 5 dependencies
(that's what 'guix style' does).

> +    (home-page "https://sourceforge.net/projects/tkimg/")
> +    (synopsis "The Img package adds several image formats to Tcl/Tk.")

Synopsis shouldn't be complete sentence but just a very terse expression
saying what the package *is*, e.g. "Image library for Tcl/Tk".  Debian
uses "Extended image format support for Tcl/Tk".

> +    (description
> +     "The Img package adds several image formats to Tcl/Tk.")

Description should be more generous; here I'd enumerate the specific
image formats it adds.  Debian uses:

--8<---------------cut here---------------start------------->8---
 Img is a package to enhance Tk by providing support for various image
 formats such as XPM, GIF (transparency supported, but not LZW), PNG,
 JPEG, TIFF, and PostScript.
--8<---------------cut here---------------end--------------->8---

It lacks some according to the home page [0]:

BMP, GIF, ICO, JPEG, PCX, PNG, PPM, PS, SGI, SUN, TGA, TIFF, XBM, XPM

[0]  https://sourceforge.net/projects/tkimg/

> +    (license license:public-domain)))

According to Debian's copyright file (which can be found in
http://deb.debian.org/debian/pool/main/libt/libtk-img/libtk-img_1.4.14+dfsg.orig.tar.xz),
the licenses used is a mix of the tcl license and public-domain.  I'd
use (license (list license:tcl/tk
                   license:public-domain))

Reading the last paragraph of license.terms:

--8<---------------cut here---------------start------------->8---
GOVERNMENT USE: If you are acquiring this software on behalf of the
U.S. government, the Government shall have only "Restricted Rights"
in the software and related documentation as defined in the Federal
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you
are acquiring the software on behalf of the Department of Defense, the
software shall be classified as "Commercial Computer Software" and the
Government shall have only "Restricted Rights" as defined in Clause
252.227-7013 (b) (3) of DFARs.  Notwithstanding the foregoing, the
authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.
--8<---------------cut here---------------end--------------->8---

I'm not too sure what that really means, even after reading the clauses
[1, 2].

[1]  https://www.acquisition.gov/far/52.227-19#FAR_52_227_19__d3451e77
[2]  https://www.acquisition.gov/dfars/252.227-7013-rights-technical-data%E2%80%94other-commercial-products-and-commercial-services.

Although, taking it from a high level, it seems like it implies
additional restrictions for the US government, which is incompatible
with the free software and thus, the FSDG, which means we cannot
distribute this package.

I'd be happy to proven wrong, I am not a lawyer.

-- 
Thanks,
Maxim




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

* [bug#65097] [PATCH] gnu: Add tk-img.
  2023-08-05 13:45 [bug#65097] [PATCH] gnu: Add tk-img cage
  2023-09-05 14:21 ` Maxim Cournoyer
@ 2023-09-05 14:22 ` Maxim Cournoyer
  2023-09-06 14:06 ` cage
  2023-11-16 15:39 ` [bug#65097] failed attempt cage
  3 siblings, 0 replies; 9+ messages in thread
From: Maxim Cournoyer @ 2023-09-05 14:22 UTC (permalink / raw)
  To: cage; +Cc: 65097

Hi again,

cage <cage-dev@twistfold.it> writes:

> Hi!
>
> Note that this patch suffers for some problems:
>
> - the package will skips the test (it complains "tk" can not be found");
>
> - the manpages will not be installed as make installs exit with an error code because the script 'dtplite' can not be found (seems a TCL script according to README);
>
> - the license seems X11 to me, but i am unsure (see the last paragraph in the file: "license.terms".
>
> Any suggestion to improve the patch is appreciated! :)

One last thing, the source of tk-img carries many 'contrib' sources;
they should be removed in a snippet to ensure only Guix-provided system
libraries are used instead.

-- 
Thanks,
Maxim




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

* [bug#65097] [PATCH] gnu: Add tk-img.
  2023-09-05 14:21 ` Maxim Cournoyer
@ 2023-09-05 14:43   ` Maxim Cournoyer
  2023-09-05 17:11   ` cage
  1 sibling, 0 replies; 9+ messages in thread
From: Maxim Cournoyer @ 2023-09-05 14:43 UTC (permalink / raw)
  To: cage; +Cc: 65097

Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

[...]

> Reading the last paragraph of license.terms:
>
> GOVERNMENT USE: If you are acquiring this software on behalf of the
> U.S. government, the Government shall have only "Restricted Rights"
> in the software and related documentation as defined in the Federal
> Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you
> are acquiring the software on behalf of the Department of Defense, the
> software shall be classified as "Commercial Computer Software" and the
> Government shall have only "Restricted Rights" as defined in Clause
> 252.227-7013 (b) (3) of DFARs.  Notwithstanding the foregoing, the
> authors grant the U.S. Government and others acting in its behalf
> permission to use and distribute the software in accordance with the
> terms specified in this license.
>
> I'm not too sure what that really means, even after reading the clauses
> [1, 2].
>
> [1]  https://www.acquisition.gov/far/52.227-19#FAR_52_227_19__d3451e77
> [2]
> https://www.acquisition.gov/dfars/252.227-7013-rights-technical-data%E2%80%94other-commercial-products-and-commercial-services.

That's probably fine actually, given that's the same license text as the
license.terms found in the tcl/tk project itself.

I'd use just (license license:tcl/tk) then.

-- 
Thanks,
Maxim




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

* [bug#65097] [PATCH] gnu: Add tk-img.
  2023-09-05 14:21 ` Maxim Cournoyer
  2023-09-05 14:43   ` Maxim Cournoyer
@ 2023-09-05 17:11   ` cage
  1 sibling, 0 replies; 9+ messages in thread
From: cage @ 2023-09-05 17:11 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 65097, cage

On Tue, Sep 05, 2023 at 10:21:26AM -0400, you wrote:
> Hi!

Hi!

[…]

Thank you very much for your accurate review of this patch!

I am going to address the  issues you highlighted in your messages and
updating the patch.

I have just a question:

> > the package will skips the test (it complains "tk" can not be found");

> It'd be best to say so in the package, with a XXX comment (meaning
> subpar/hackish/dirty) like:
>
> #:tests #f   ;tests fails with "tk" can not be found error

I am  OK with this change  but I would  rather prefer to not  skip the
tests, if possible; do you have any suggestions about making the build
environment find the tk executable?

Thanks again for your help!
C.




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

* [bug#65097] [PATCH] gnu: Add tk-img.
  2023-08-05 13:45 [bug#65097] [PATCH] gnu: Add tk-img cage
  2023-09-05 14:21 ` Maxim Cournoyer
  2023-09-05 14:22 ` Maxim Cournoyer
@ 2023-09-06 14:06 ` cage
  2023-09-06 16:06   ` Maxim Cournoyer
  2023-11-16 15:39 ` [bug#65097] failed attempt cage
  3 siblings, 1 reply; 9+ messages in thread
From: cage @ 2023-09-06 14:06 UTC (permalink / raw)
  To: 65097; +Cc: maxim.cournoyer

Hi!

With this patch I tried to address all the issues that was pointed out
(hope they are fine :)) except one:

> One last thing, the source of tk-img carries many 'contrib' sources;
> they should be removed in a snippet to ensure only Guix-provided system
> libraries are used instead.

Because I was not able to find out the contribs sources.

Also, for the record, the problem with  tests is not that the Tk (as I
erroneously thought)  executable can not  be found but that,  for some
reasons, the tcl script seems to fails to resolve Tk as dependency:

$ tclsh

% package require Tk → raise an error

the same line works on my other system (Debian)

Bye!
C.

---
 gnu/packages/tcl.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index b69dba2254..22602c177a 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -36,6 +36,7 @@ (define-module (gnu packages tcl)
   #:use-module (gnu packages)
   #:use-module (gnu packages image)
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages tls)
@@ -509,3 +510,42 @@ (define-public go-github.com-nsf-gothic
     (description "Gothic contains Go bindings for Tcl/Tk.  The package contains
 only one type and one function that can be used to create a Tk interpreter.")
     (license license:expat))))
+
+(define-public tk-img
+  (package
+    (name "tk-img")
+    (version "1.4.14")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "mirror://sourceforge/tkimg/tkimg/1.4/tkimg%20"
+             version
+             "/Img-" version "-Source.tar.gz"))
+       (file-name (string-append "tkimg-" version ".tar.gz"))
+       (sha256
+        (base32 "08dvb8bfkxr919wp6fq14cfb9lz1v59jx1la4a6j4ks636wb243m"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f ; tests fails because the tcl shell can not find Tk ("package require Tk" fails)
+           #:phases
+           #~(modify-phases %standard-phases
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (invoke "make" "install-libraries"))))
+           #:configure-flags
+           #~(list
+              (string-append "--exec-prefix=" #$output)
+              (string-append "--with-tcl="
+                             (assoc-ref %build-inputs "tcl") "/lib")
+              (string-append "--with-tk="
+                             (assoc-ref %build-inputs "tk") "/lib"))))
+    (native-inputs
+     (list tcl tk ghostscript))
+    (home-page "https://sourceforge.net/projects/tkimg/")
+    (synopsis "Increase the number bitmap file formats supported by TK.")
+    (description
+     "The Img package adds supports for several image formats to TCl/TK; notably JPEG, ICO, BMP, TGA and PostScript (using an external PostScript interpreter).")
+    (license (license:non-copyleft
+              "file://license.terms"
+              "See license.terms in the distribution."))))

base-commit: 42ae42cf41e8f5e88422e30d801251a3427d7f3b
--
2.34.0




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

* [bug#65097] [PATCH] gnu: Add tk-img.
  2023-09-06 14:06 ` cage
@ 2023-09-06 16:06   ` Maxim Cournoyer
  2023-09-06 17:42     ` cage
  0 siblings, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2023-09-06 16:06 UTC (permalink / raw)
  To: cage; +Cc: 65097

Hi!

cage <cage-dev@twistfold.it> writes:

> Hi!
>
> With this patch I tried to address all the issues that was pointed out
> (hope they are fine :)) except one:
>
>> One last thing, the source of tk-img carries many 'contrib' sources;
>> they should be removed in a snippet to ensure only Guix-provided system
>> libraries are used instead.
>
> Because I was not able to find out the contribs sources.

(assuming the source is a gzipped tarball)

If you './pre-inst-env guix build --source tk-img', then unpack it to
/tmp with 'tar xf /gnu/store...-cage.tar.gz -C /tmp', you should then be
able to look at what it contains, e.g.

find /tmp/cage-x.y.z/ -name '*contrib*'

> Also, for the record, the problem with  tests is not that the Tk (as I
> erroneously thought)  executable can not  be found but that,  for some
> reasons, the tcl script seems to fails to resolve Tk as dependency:
>
> $ tclsh
>
> % package require Tk → raise an error

Oh!  So it seems we have a bigger problem to resolve first :-)

Thanks for your investigations.

-- 
Maxim




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

* [bug#65097] [PATCH] gnu: Add tk-img.
  2023-09-06 16:06   ` Maxim Cournoyer
@ 2023-09-06 17:42     ` cage
  0 siblings, 0 replies; 9+ messages in thread
From: cage @ 2023-09-06 17:42 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 65097, cage

On Wed, Sep 06, 2023 at 12:06:46PM -0400, You wrote:
> Hi!

Hi!

[...]

> > Because I was not able to find out the contribs sources.
>
> (assuming the source is a gzipped tarball)
>
> If you './pre-inst-env guix build --source tk-img', then unpack it to
> /tmp with 'tar xf /gnu/store...-cage.tar.gz -C /tmp', you should then be
> able to look at what it contains, e.g.
>
> find /tmp/cage-x.y.z/ -name '*contrib*'

So they were hiding under the "compat" directory! :D

I have learnt a new (to me) guix switch ("--source"), thanks!

> > Also, for the record, the problem with  tests is not that the Tk (as I
> > erroneously thought)  executable can not  be found but that,  for some
> > reasons, the tcl script seems to fails to resolve Tk as dependency:
> >
> > $ tclsh
> >
> > % package require Tk → raise an error
>
> Oh!  So it seems we have a bigger problem to resolve first :-)
>
> Thanks for your investigations.

My pleasure, I am happy if I  can give a contribution to guix, even if can be only
minimal.

Bye!
C.




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

* [bug#65097] failed attempt
  2023-08-05 13:45 [bug#65097] [PATCH] gnu: Add tk-img cage
                   ` (2 preceding siblings ...)
  2023-09-06 14:06 ` cage
@ 2023-11-16 15:39 ` cage
  3 siblings, 0 replies; 9+ messages in thread
From: cage @ 2023-11-16 15:39 UTC (permalink / raw)
  To: 65097

Hi!

I was not able to remove  the bundled libraries and make the library
builds.  Moreover I  lost  interest  in this  solution  as i  managed,
someway, to support  more bitmap file format, in my  code, using other
libraries.

Thanks for your help anyway and sorry if I did not not succeed.

Bye!
C.




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

end of thread, other threads:[~2023-11-16 15:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-05 13:45 [bug#65097] [PATCH] gnu: Add tk-img cage
2023-09-05 14:21 ` Maxim Cournoyer
2023-09-05 14:43   ` Maxim Cournoyer
2023-09-05 17:11   ` cage
2023-09-05 14:22 ` Maxim Cournoyer
2023-09-06 14:06 ` cage
2023-09-06 16:06   ` Maxim Cournoyer
2023-09-06 17:42     ` cage
2023-11-16 15:39 ` [bug#65097] failed attempt cage

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).