diff mbox series

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

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

Commit Message

cage Sept. 6, 2023, 2:06 p.m. UTC
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(+)


base-commit: 42ae42cf41e8f5e88422e30d801251a3427d7f3b
--
2.34.0

Comments

Maxim Cournoyer Sept. 6, 2023, 4:06 p.m. UTC | #1
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.
cage Sept. 6, 2023, 5:42 p.m. UTC | #2
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.
diff mbox series

Patch

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