diff mbox series

[bug#65097] gnu: Add tk-img.

Message ID 637de43ce6edf9cebaf84d3b456901a184e6de82.1691242776.git.cage-dev@twistfold.it
State New
Headers show
Series [bug#65097] gnu: Add tk-img. | expand

Commit Message

cage Aug. 5, 2023, 1:45 p.m. UTC
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(+)


base-commit: 42ae42cf41e8f5e88422e30d801251a3427d7f3b
--
2.34.0

Comments

Maxim Cournoyer Sept. 5, 2023, 2:21 p.m. UTC | #1
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.
Maxim Cournoyer Sept. 5, 2023, 2:22 p.m. UTC | #2
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.
Maxim Cournoyer Sept. 5, 2023, 2:43 p.m. UTC | #3
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.
cage Sept. 5, 2023, 5:11 p.m. UTC | #4
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.
cage Nov. 16, 2023, 3:39 p.m. UTC | #5
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.
diff mbox series

Patch

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