all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages
@ 2024-11-17 18:06 Runciter via Guix-patches via
  2024-11-18  5:55 ` [bug#74411] [PATCH 1/4] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-17 18:06 UTC (permalink / raw)
  To: 74411; +Cc: Runciter

Add the dictd package from the DICT project along with its library dependency
libmaa.

Add the human-written bilingual dictionaries from the FreeDict projects
freedict-dictionaries, with its toolchain dependency freedict-tools.

Runciter (4):
  gnu: Add (gnu packages dictd).
  gnu: Add dictd-1.13.1.
  gnu: Add freedict-tools-0.6.0.
  gnu: Add freedict-dictionaries.

 gnu/local.mk                  |   2 +
 gnu/packages/dictd.scm        |  98 ++++++++++++++++++++++++++++++++
 gnu/packages/dictionaries.scm | 103 +++++++++++++++++++++++++++++++++-
 3 files changed, 202 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/dictd.scm


base-commit: b790db7589858fc77989b4d1f369c52bca6d6e7c
-- 
2.46.0






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

* [bug#74411] [PATCH 1/4] gnu: Add (gnu packages dictd).
  2024-11-17 18:06 [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages Runciter via Guix-patches via
@ 2024-11-18  5:55 ` Runciter via Guix-patches via
  2024-11-18  5:56 ` [bug#74411] [PATCH 2/4] gnu: Add dictd-1.13.1 Runciter via Guix-patches via
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-18  5:55 UTC (permalink / raw)
  To: 74411; +Cc: Runciter

* gnu/packages/dictd.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/local.mk           |  2 ++
 gnu/packages/dictd.scm | 61 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 gnu/packages/dictd.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index a97e988add..7004d02547 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -67,6 +67,7 @@
 # Copyright © 2024 David Elsing <david.elsing@posteo.net>
 # Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
 # Copyright © 2024 Fabio Natali <me@fabionatali.com>
+# Copyright © 2024 Runciter <runciter@whispers-vpn.org>
 #
 # This file is part of GNU Guix.
 #
@@ -239,6 +240,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/decker.scm			\
   %D%/packages/dhall.scm			\
   %D%/packages/dico.scm				\
+  %D%/packages/dictd.scm			\
   %D%/packages/dictionaries.scm			\
   %D%/packages/diffoscope.scm			\
   %D%/packages/digest.scm			\
diff --git a/gnu/packages/dictd.scm b/gnu/packages/dictd.scm
new file mode 100644
index 0000000000..fed41def64
--- /dev/null
+++ b/gnu/packages/dictd.scm
@@ -0,0 +1,61 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2024 Runciter <runciter@whispers-vpn.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages dictd)
+  #:use-module (guix packages)
+  #:use-module (guix gexp)
+  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages autotools))
+
+(define-public libmaa-1.3.2
+  (package
+    (name "libmaa")
+    (version "1.3.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/dict/libmaa/"
+                           "libmaa-"
+                           version
+                           "/libmaa-"
+                           version
+                           ".tar.gz"))
+       (sha256
+        (base32 "1idi4c30pi79g5qfl7rr9s17krbjbg93bi8f2qrbsdlh78ga19ar"))))
+    (native-inputs (list libtool))
+    (arguments
+     (list
+      #:make-flags #~'("CFLAGS=-DHAVE_CONFIG_H  -Wall -Wno-error -g -O2 $(VERCFLAGS) -I. -I${srcdir}")
+      #:test-target "test"))
+    (build-system gnu-build-system)
+    (synopsis "Low-level data structures used by the dictd program")
+    (description
+     "The libmaa library provides many low-level
+data structures which are helpful for writing compilers, including hash
+tables, sets, lists, debugging support, and memory management.  Although
+libmaa was designed and implemented as a foundation for the Khepara
+transformation system, the data structures are generally applicable to a
+wide range of programming problems.
+
+  The memory management routines are especially helpful for improving
+the performance of memory-intensive applications.")
+    (home-page "https://sourceforge.net/projects/dict/")
+    (license gpl2+)))
-- 
2.46.0






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

* [bug#74411] [PATCH 2/4] gnu: Add dictd-1.13.1.
  2024-11-17 18:06 [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages Runciter via Guix-patches via
  2024-11-18  5:55 ` [bug#74411] [PATCH 1/4] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
@ 2024-11-18  5:56 ` Runciter via Guix-patches via
  2024-11-18  5:56 ` [bug#74411] [PATCH 3/4] gnu: Add freedict-tools-0.6.0 Runciter via Guix-patches via
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-18  5:56 UTC (permalink / raw)
  To: 74411; +Cc: Runciter

    * gnu/packages/dictd.scm (dictd-1.13.1): New variable.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/packages/dictd.scm | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/dictd.scm b/gnu/packages/dictd.scm
index fed41def64..732f2bb6cc 100644
--- a/gnu/packages/dictd.scm
+++ b/gnu/packages/dictd.scm
@@ -23,7 +23,10 @@ (define-module (gnu packages dictd)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
-  #:use-module (gnu packages autotools))
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages bison)
+  #:use-module (gnu packages flex)
+  #:use-module (gnu packages compression))
 
 (define-public libmaa-1.3.2
   (package
@@ -59,3 +62,37 @@ (define-public libmaa-1.3.2
 the performance of memory-intensive applications.")
     (home-page "https://sourceforge.net/projects/dict/")
     (license gpl2+)))
+
+(define-public dictd-1.13.1
+  (package
+    (name "dictd")
+    (version "1.13.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/dict/dictd/"
+                           "dictd-"
+                           version
+                           "/dictd-"
+                           version
+                           ".tar.gz"))
+       (sha256
+        (base32 "06racmv25ihwgwf67fgj2703ik0m5i2cjzcxasa88kc92rysdwg4"))))
+    (inputs (list libmaa-1.3.2 zlib))
+    (native-inputs (list libtool bison flex))
+    (arguments
+     (list
+      #:test-target "test"))
+    (build-system gnu-build-system)
+    (synopsis "@command{dict}, @command{dictd} and @command{dictfmt} programs")
+    (description
+     "The DICT Interchange Format (DICF) is a human-readable
+ format for the interchange of dictionary databases for the use with
+DICT protocol client/server software.
+
+This package provides a client @command{dict} and a server program
+@command{dictd} for the DICT protocol, as well as a utility
+@command{dictfmt} to convert various dictionary formats into
+dictionaries that can be served by @command{dictd} or @command{dicos}")
+    (home-page "https://sourceforge.net/projects/dict/")
+    (license gpl2+)))
-- 
2.46.0






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

* [bug#74411] [PATCH 3/4] gnu: Add freedict-tools-0.6.0.
  2024-11-17 18:06 [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages Runciter via Guix-patches via
  2024-11-18  5:55 ` [bug#74411] [PATCH 1/4] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
  2024-11-18  5:56 ` [bug#74411] [PATCH 2/4] gnu: Add dictd-1.13.1 Runciter via Guix-patches via
@ 2024-11-18  5:56 ` Runciter via Guix-patches via
  2024-11-18  5:56 ` [bug#74411] [PATCH 4/4] gnu: Add freedict-dictionaries Runciter via Guix-patches via
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-18  5:56 UTC (permalink / raw)
  To: 74411; +Cc: Runciter

    * gnu/packages/dictionaries.scm (freedict-tools-0.6.0): New variable.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/packages/dictionaries.scm | 55 ++++++++++++++++++++++++++++++++++-
 1 file changed, 54 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 3f9b59c960..3470d8d945 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -28,6 +28,7 @@
 (define-module (gnu packages dictionaries)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix gexp)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
@@ -55,7 +56,10 @@ (define-module (gnu packages dictionaries)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages web)
-  #:use-module (gnu packages xml))
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages dictd)
+  #:use-module (gnu packages speech)
+  #:use-module (gnu packages perl))
 
 
 (define-public vera
@@ -466,3 +470,52 @@ (define-public skk-jisyo
 for SKK Japanese input systems, and various dictionary files.
 @file{SKK-JISYO.L} can be used with @code{emacs-ddskk} or @code{uim} package.")
       (license license:gpl2+))))
+
+(define-public freedict-tools-0.6.0
+  (package
+    (name "freedict-tools")
+    (version "0.6.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/freedict/tools")
+             (commit "3596640e6e0582cc5fb76a342e5d8e7413aa4b34")))
+       (sha256
+        (base32 "1raayynvn1j8x0ck8pnbbljl6zxnsyzzil7y54xz03dpj7k9w7mk"))))
+    (inputs (list espeak-ng
+                  python
+                  perl
+                  gzip
+                  tar
+                  libxslt
+                  dictd-1.13.1
+                  perl-libxml))
+    (arguments
+     (list
+      #:tests? #f
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'configure)
+                   (add-before 'build 'set-prefix-in-makefile
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "Makefile"
+                         (("PREFIX \\?=.*")
+                          (string-append "PREFIX = "
+                                         #$output "\n")))
+                       (substitute* "mk/dicts.mk"
+                         (("available_platforms := src dictd slob")
+                          "available_platforms := dictd")))))))
+    (build-system gnu-build-system)
+    (synopsis "FreeDict tools to import, export (build) and manage FreeDict
+dictionaries")
+    (description
+     "FreeDict is a project that offers over 140 free
+ dictionaries in about 45 languages, with the right to study, change and
+ modify them.  You can use them offline on your computer or mobile phone
+ and export them to any format and application.
+
+In order to limit store size and build complexity, only the build
+targets that build dictionaries in dictd format are retained when this
+Guix package is installed.")
+    (home-page "https://freedict.org")
+    (license license:gpl2+)))
-- 
2.46.0






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

* [bug#74411] [PATCH 4/4] gnu: Add freedict-dictionaries.
  2024-11-17 18:06 [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages Runciter via Guix-patches via
                   ` (2 preceding siblings ...)
  2024-11-18  5:56 ` [bug#74411] [PATCH 3/4] gnu: Add freedict-tools-0.6.0 Runciter via Guix-patches via
@ 2024-11-18  5:56 ` Runciter via Guix-patches via
  2024-11-18  6:37 ` [bug#74411] freedict-dictionaries build non-deterministic Runciter via Guix-patches via
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-18  5:56 UTC (permalink / raw)
  To: 74411; +Cc: Runciter

    * gnu/packages/dictionaries (freedict-dictionaries): New variable.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/packages/dictionaries.scm | 48 +++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 3470d8d945..3e5d991890 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2020 Lu hux <luhux@outlook.com>
 ;;; Copyright © 2022 ROCKTAKEY <rocktakey@gmail.com>
+;;; Copyright © 2022 Runciter <runciter@whispers-vpn.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -519,3 +520,50 @@ (define-public freedict-tools-0.6.0
 Guix package is installed.")
     (home-page "https://freedict.org")
     (license license:gpl2+)))
+
+(define-public freedict-dictionaries
+  (package
+    (name "freedict-dictionaries")
+    (version "914b5f7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/freedict/fd-dictionaries")
+             (commit "914b5f754b695e9422bf951837b0682a077e244e")))
+       (sha256
+        (base32 "0a8k5rq94rl1nmz0354sx2gmyqica0yjavirh5v5wdybkfq8nv83"))))
+    (inputs (list espeak-ng
+                  python
+                  perl
+                  gzip
+                  tar
+                  libxslt
+                  dictd-1.13.1
+                  perl-libxml
+                  freedict-tools-0.6.0))
+    (arguments
+     (list
+      #:tests? #f
+      #:make-flags #~(list (string-append "PREFIX="
+                                          #$output))
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'configure)
+                   (add-before 'build 'set-tools-prefix-in-makefile
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "Makefile"
+                         (("FREEDICT_TOOLS \\?= ../tools")
+                          (string-append "export FREEDICT_TOOLS = "
+                                         #$(file-append
+                                            freedict-tools-0.6.0
+                                            "/share/freedict")))))))))
+    (build-system gnu-build-system)
+    (synopsis "Freedict multilingual dictionaries compiled to the dictd
+format")
+    (description
+     "FreeDict is a project that offers over 140 free
+ dictionaries in about 45 languages, with the right to study, change and
+ modify them.  You can use them offline on your computer or mobile phone
+ and export them to any format and application.")
+    (home-page "https://freedict.org")
+    (license license:gpl2+)))
-- 
2.46.0






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

* [bug#74411] freedict-dictionaries build non-deterministic
  2024-11-17 18:06 [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages Runciter via Guix-patches via
                   ` (3 preceding siblings ...)
  2024-11-18  5:56 ` [bug#74411] [PATCH 4/4] gnu: Add freedict-dictionaries Runciter via Guix-patches via
@ 2024-11-18  6:37 ` Runciter via Guix-patches via
  2024-11-19  8:43   ` Nicolas Graves via Guix-patches via
  2024-11-19 15:13 ` Runciter via Guix-patches via
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-18  6:37 UTC (permalink / raw)
  To: 74411

The build of the package freedict-dictionaries is non-deterministic, at
least because the output dictionaries are compressed by the utility
dictzip, which includes a timestamp in the compressed file headers.

I have not confirmed it yet but I think I could fix it: it would involve
a patch to the freedict-tools package, and then output dictionaries of
freedict-dictionaries would not be compressed.

The maintainers should just tell me if it's worth it to fix
non-determinism in this way: we have to carry forward a patch (unless a
better idea comes up), and we lose the benefit of compressing the outputs.





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

* [bug#74411] freedict-dictionaries build non-deterministic
  2024-11-18  6:37 ` [bug#74411] freedict-dictionaries build non-deterministic Runciter via Guix-patches via
@ 2024-11-19  8:43   ` Nicolas Graves via Guix-patches via
  0 siblings, 0 replies; 14+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-11-19  8:43 UTC (permalink / raw)
  To: Runciter, 74411

On 2024-11-18 06:37, Runciter via Guix-patches via wrote:

> The build of the package freedict-dictionaries is non-deterministic, at
> least because the output dictionaries are compressed by the utility
> dictzip, which includes a timestamp in the compressed file headers.

Are you sure there are no options at compression time to force
determinism on the archive?

Usually, there are some, see tar invocations for instance: 
(invoke "tar" "cvfa" (string-append this-file ".tar")
      "--mtime=1" "--owner=root:0" "--group=root:0" ; determinism
      "--sort=name" ".")

The sort is here for determinism too.

>
> I have not confirmed it yet but I think I could fix it: it would involve
> a patch to the freedict-tools package, and then output dictionaries of
> freedict-dictionaries would not be compressed.
>
> The maintainers should just tell me if it's worth it to fix
> non-determinism in this way: we have to carry forward a patch (unless a
> better idea comes up), and we lose the benefit of compressing the outputs.


-- 
Best regards,
Nicolas Graves




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

* [bug#74411] freedict-dictionaries build non-deterministic
  2024-11-17 18:06 [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages Runciter via Guix-patches via
                   ` (4 preceding siblings ...)
  2024-11-18  6:37 ` [bug#74411] freedict-dictionaries build non-deterministic Runciter via Guix-patches via
@ 2024-11-19 15:13 ` Runciter via Guix-patches via
  2024-11-21  0:49 ` [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
  2024-11-21  1:15 ` [bug#74411] patch v2 non-determinism fix Runciter via Guix-patches via
  7 siblings, 0 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-19 15:13 UTC (permalink / raw)
  To: Nicolas Graves; +Cc: 74411

"Nicolas Graves" <ngraves@ngraves.fr> writes:

> On 2024-11-18 06:37, Runciter via Guix-patches via wrote:
>
>> The build of the package freedict-dictionaries is non-deterministic, at
>> least because the output dictionaries are compressed by the utility
>> dictzip, which includes a timestamp in the compressed file headers.
>
> Are you sure there are no options at compression time to force
> determinism on the archive?
>

I'm as sure as one can be when one has read the man page of
dictzip. That is to say, not sure about undocumented features.

Independently of dictzip capabilities, one problem actually is having to
patch the freedict-tools package if one wants to change anything to the
output compression of freedict-dictionaries. From what I found online,
FreeDict does not document how to fine-tune or disable dictzip
compression within its build system. In the place where it's done at
compile-time, I don't see any handles I could use; you can look if you
want, it's in the source of the freedict-tools package, the
'install-base' target found in the file mk/dicts.mk.

Now that I think about it I figure, IF a patch has to be done, then
surely anyway some command-line hack could be inserted into the target
from the patch that would make up for the lack of a usable command-line
switch in dictzip... It's lame to have to create, setup and maintain a
patch, but if it has to be done we might as well enjoy the flexibility.

Incidentally, gzip as a subsitute for dictzip is documented to work in
dictd, some dictd optimizations would be lost though, I guess gzipped
dictionaries may also work in dicod and I also guess, dicod probably
does not bother to make detailed optimizations tailored to the dictzip
format specifics. This and other considerations makes it potentially
worthwhile to experiment a little by creating a dictd service in my
system, if that is practical, as well as playing around with the
relevant dicod handler.

Let me study in those directions until the end of the week and get back
to you.

Regards,





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

* [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd).
  2024-11-17 18:06 [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages Runciter via Guix-patches via
                   ` (5 preceding siblings ...)
  2024-11-19 15:13 ` Runciter via Guix-patches via
@ 2024-11-21  0:49 ` Runciter via Guix-patches via
  2024-11-21  0:49   ` [bug#74411] [PATCH v2 2/5] gnu: Add dictd-1.13.1 Runciter via Guix-patches via
                     ` (3 more replies)
  2024-11-21  1:15 ` [bug#74411] patch v2 non-determinism fix Runciter via Guix-patches via
  7 siblings, 4 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-21  0:49 UTC (permalink / raw)
  To: 74411; +Cc: Runciter

* gnu/packages/dictd.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/local.mk           |  2 ++
 gnu/packages/dictd.scm | 61 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 gnu/packages/dictd.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index a97e988add..7004d02547 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -67,6 +67,7 @@
 # Copyright © 2024 David Elsing <david.elsing@posteo.net>
 # Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
 # Copyright © 2024 Fabio Natali <me@fabionatali.com>
+# Copyright © 2024 Runciter <runciter@whispers-vpn.org>
 #
 # This file is part of GNU Guix.
 #
@@ -239,6 +240,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/decker.scm			\
   %D%/packages/dhall.scm			\
   %D%/packages/dico.scm				\
+  %D%/packages/dictd.scm			\
   %D%/packages/dictionaries.scm			\
   %D%/packages/diffoscope.scm			\
   %D%/packages/digest.scm			\
diff --git a/gnu/packages/dictd.scm b/gnu/packages/dictd.scm
new file mode 100644
index 0000000000..fed41def64
--- /dev/null
+++ b/gnu/packages/dictd.scm
@@ -0,0 +1,61 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2024 Runciter <runciter@whispers-vpn.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages dictd)
+  #:use-module (guix packages)
+  #:use-module (guix gexp)
+  #:use-module ((guix licenses) #:select (gpl2+))
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages autotools))
+
+(define-public libmaa-1.3.2
+  (package
+    (name "libmaa")
+    (version "1.3.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/dict/libmaa/"
+                           "libmaa-"
+                           version
+                           "/libmaa-"
+                           version
+                           ".tar.gz"))
+       (sha256
+        (base32 "1idi4c30pi79g5qfl7rr9s17krbjbg93bi8f2qrbsdlh78ga19ar"))))
+    (native-inputs (list libtool))
+    (arguments
+     (list
+      #:make-flags #~'("CFLAGS=-DHAVE_CONFIG_H  -Wall -Wno-error -g -O2 $(VERCFLAGS) -I. -I${srcdir}")
+      #:test-target "test"))
+    (build-system gnu-build-system)
+    (synopsis "Low-level data structures used by the dictd program")
+    (description
+     "The libmaa library provides many low-level
+data structures which are helpful for writing compilers, including hash
+tables, sets, lists, debugging support, and memory management.  Although
+libmaa was designed and implemented as a foundation for the Khepara
+transformation system, the data structures are generally applicable to a
+wide range of programming problems.
+
+  The memory management routines are especially helpful for improving
+the performance of memory-intensive applications.")
+    (home-page "https://sourceforge.net/projects/dict/")
+    (license gpl2+)))

base-commit: b790db7589858fc77989b4d1f369c52bca6d6e7c
-- 
2.46.0






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

* [bug#74411] [PATCH v2 2/5] gnu: Add dictd-1.13.1.
  2024-11-21  0:49 ` [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
@ 2024-11-21  0:49   ` Runciter via Guix-patches via
  2024-11-21  0:50   ` [bug#74411] [PATCH v2 3/5] gnu: Add freedict-tools-0.6.0 Runciter via Guix-patches via
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-21  0:49 UTC (permalink / raw)
  To: 74411; +Cc: Runciter

* gnu/packages/dictd.scm (dictd-1.13.1): New variable.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/packages/dictd.scm | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/dictd.scm b/gnu/packages/dictd.scm
index fed41def64..732f2bb6cc 100644
--- a/gnu/packages/dictd.scm
+++ b/gnu/packages/dictd.scm
@@ -23,7 +23,10 @@ (define-module (gnu packages dictd)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
-  #:use-module (gnu packages autotools))
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages bison)
+  #:use-module (gnu packages flex)
+  #:use-module (gnu packages compression))
 
 (define-public libmaa-1.3.2
   (package
@@ -59,3 +62,37 @@ (define-public libmaa-1.3.2
 the performance of memory-intensive applications.")
     (home-page "https://sourceforge.net/projects/dict/")
     (license gpl2+)))
+
+(define-public dictd-1.13.1
+  (package
+    (name "dictd")
+    (version "1.13.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/dict/dictd/"
+                           "dictd-"
+                           version
+                           "/dictd-"
+                           version
+                           ".tar.gz"))
+       (sha256
+        (base32 "06racmv25ihwgwf67fgj2703ik0m5i2cjzcxasa88kc92rysdwg4"))))
+    (inputs (list libmaa-1.3.2 zlib))
+    (native-inputs (list libtool bison flex))
+    (arguments
+     (list
+      #:test-target "test"))
+    (build-system gnu-build-system)
+    (synopsis "@command{dict}, @command{dictd} and @command{dictfmt} programs")
+    (description
+     "The DICT Interchange Format (DICF) is a human-readable
+ format for the interchange of dictionary databases for the use with
+DICT protocol client/server software.
+
+This package provides a client @command{dict} and a server program
+@command{dictd} for the DICT protocol, as well as a utility
+@command{dictfmt} to convert various dictionary formats into
+dictionaries that can be served by @command{dictd} or @command{dicos}")
+    (home-page "https://sourceforge.net/projects/dict/")
+    (license gpl2+)))
-- 
2.46.0






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

* [bug#74411] [PATCH v2 3/5] gnu: Add freedict-tools-0.6.0.
  2024-11-21  0:49 ` [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
  2024-11-21  0:49   ` [bug#74411] [PATCH v2 2/5] gnu: Add dictd-1.13.1 Runciter via Guix-patches via
@ 2024-11-21  0:50   ` Runciter via Guix-patches via
  2024-11-21  0:50   ` [bug#74411] [PATCH v2 4/5] gnu: Add freedict-dictionaries Runciter via Guix-patches via
  2024-11-21  0:50   ` [bug#74411] [PATCH v2 5/5] gnu: freedict-tools: Fix non-determinism of dictzip compressed file headers Runciter via Guix-patches via
  3 siblings, 0 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-21  0:50 UTC (permalink / raw)
  To: 74411; +Cc: Runciter

* gnu/packages/dictionaries.scm (freedict-tools-0.6.0): New variable.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/packages/dictionaries.scm | 55 ++++++++++++++++++++++++++++++++++-
 1 file changed, 54 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 3f9b59c960..3470d8d945 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -28,6 +28,7 @@
 (define-module (gnu packages dictionaries)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix gexp)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
@@ -55,7 +56,10 @@ (define-module (gnu packages dictionaries)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages web)
-  #:use-module (gnu packages xml))
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages dictd)
+  #:use-module (gnu packages speech)
+  #:use-module (gnu packages perl))
 
 
 (define-public vera
@@ -466,3 +470,52 @@ (define-public skk-jisyo
 for SKK Japanese input systems, and various dictionary files.
 @file{SKK-JISYO.L} can be used with @code{emacs-ddskk} or @code{uim} package.")
       (license license:gpl2+))))
+
+(define-public freedict-tools-0.6.0
+  (package
+    (name "freedict-tools")
+    (version "0.6.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/freedict/tools")
+             (commit "3596640e6e0582cc5fb76a342e5d8e7413aa4b34")))
+       (sha256
+        (base32 "1raayynvn1j8x0ck8pnbbljl6zxnsyzzil7y54xz03dpj7k9w7mk"))))
+    (inputs (list espeak-ng
+                  python
+                  perl
+                  gzip
+                  tar
+                  libxslt
+                  dictd-1.13.1
+                  perl-libxml))
+    (arguments
+     (list
+      #:tests? #f
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'configure)
+                   (add-before 'build 'set-prefix-in-makefile
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "Makefile"
+                         (("PREFIX \\?=.*")
+                          (string-append "PREFIX = "
+                                         #$output "\n")))
+                       (substitute* "mk/dicts.mk"
+                         (("available_platforms := src dictd slob")
+                          "available_platforms := dictd")))))))
+    (build-system gnu-build-system)
+    (synopsis "FreeDict tools to import, export (build) and manage FreeDict
+dictionaries")
+    (description
+     "FreeDict is a project that offers over 140 free
+ dictionaries in about 45 languages, with the right to study, change and
+ modify them.  You can use them offline on your computer or mobile phone
+ and export them to any format and application.
+
+In order to limit store size and build complexity, only the build
+targets that build dictionaries in dictd format are retained when this
+Guix package is installed.")
+    (home-page "https://freedict.org")
+    (license license:gpl2+)))
-- 
2.46.0






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

* [bug#74411] [PATCH v2 4/5] gnu: Add freedict-dictionaries.
  2024-11-21  0:49 ` [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
  2024-11-21  0:49   ` [bug#74411] [PATCH v2 2/5] gnu: Add dictd-1.13.1 Runciter via Guix-patches via
  2024-11-21  0:50   ` [bug#74411] [PATCH v2 3/5] gnu: Add freedict-tools-0.6.0 Runciter via Guix-patches via
@ 2024-11-21  0:50   ` Runciter via Guix-patches via
  2024-11-21  0:50   ` [bug#74411] [PATCH v2 5/5] gnu: freedict-tools: Fix non-determinism of dictzip compressed file headers Runciter via Guix-patches via
  3 siblings, 0 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-21  0:50 UTC (permalink / raw)
  To: 74411; +Cc: Runciter

* gnu/packages/dictionaries (freedict-dictionaries): New variable.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/packages/dictionaries.scm | 48 +++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 3470d8d945..3e5d991890 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2020 Lu hux <luhux@outlook.com>
 ;;; Copyright © 2022 ROCKTAKEY <rocktakey@gmail.com>
+;;; Copyright © 2022 Runciter <runciter@whispers-vpn.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -519,3 +520,50 @@ (define-public freedict-tools-0.6.0
 Guix package is installed.")
     (home-page "https://freedict.org")
     (license license:gpl2+)))
+
+(define-public freedict-dictionaries
+  (package
+    (name "freedict-dictionaries")
+    (version "914b5f7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/freedict/fd-dictionaries")
+             (commit "914b5f754b695e9422bf951837b0682a077e244e")))
+       (sha256
+        (base32 "0a8k5rq94rl1nmz0354sx2gmyqica0yjavirh5v5wdybkfq8nv83"))))
+    (inputs (list espeak-ng
+                  python
+                  perl
+                  gzip
+                  tar
+                  libxslt
+                  dictd-1.13.1
+                  perl-libxml
+                  freedict-tools-0.6.0))
+    (arguments
+     (list
+      #:tests? #f
+      #:make-flags #~(list (string-append "PREFIX="
+                                          #$output))
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'configure)
+                   (add-before 'build 'set-tools-prefix-in-makefile
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "Makefile"
+                         (("FREEDICT_TOOLS \\?= ../tools")
+                          (string-append "export FREEDICT_TOOLS = "
+                                         #$(file-append
+                                            freedict-tools-0.6.0
+                                            "/share/freedict")))))))))
+    (build-system gnu-build-system)
+    (synopsis "Freedict multilingual dictionaries compiled to the dictd
+format")
+    (description
+     "FreeDict is a project that offers over 140 free
+ dictionaries in about 45 languages, with the right to study, change and
+ modify them.  You can use them offline on your computer or mobile phone
+ and export them to any format and application.")
+    (home-page "https://freedict.org")
+    (license license:gpl2+)))
-- 
2.46.0






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

* [bug#74411] [PATCH v2 5/5] gnu: freedict-tools: Fix non-determinism of dictzip compressed file headers.
  2024-11-21  0:49 ` [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
                     ` (2 preceding siblings ...)
  2024-11-21  0:50   ` [bug#74411] [PATCH v2 4/5] gnu: Add freedict-dictionaries Runciter via Guix-patches via
@ 2024-11-21  0:50   ` Runciter via Guix-patches via
  3 siblings, 0 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-21  0:50 UTC (permalink / raw)
  To: 74411; +Cc: Runciter

Reset .dict file mtime to start of the epoch before compressing with dictzip.

* gnu/packages/patches/freedict-tools-fix-determinism.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/dictionaries.scm (freedict-tools): Use it.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/dictionaries.scm                 |  3 ++-
 .../freedict-tools-fix-determinism.patch      | 22 +++++++++++++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/freedict-tools-fix-determinism.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 7004d02547..f6b465441a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1291,6 +1291,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/fpc-glibc-2.34-compat.patch		\
   %D%/packages/patches/fpm-newer-clamp-fix.patch		\
   %D%/packages/patches/freecad-vtk-9.3.patch		\
+  %D%/packages/patches/freedict-tools-fix-determinism.patch	\
   %D%/packages/patches/freedink-engine-fix-sdl-hints.patch	\
   %D%/packages/patches/freeimage-libtiff-compat.patch		\
   %D%/packages/patches/freeimage-libraw-0.21-compat.patch	\
diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 3e5d991890..a6daf209e3 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -483,7 +483,8 @@ (define-public freedict-tools-0.6.0
              (url "https://github.com/freedict/tools")
              (commit "3596640e6e0582cc5fb76a342e5d8e7413aa4b34")))
        (sha256
-        (base32 "1raayynvn1j8x0ck8pnbbljl6zxnsyzzil7y54xz03dpj7k9w7mk"))))
+        (base32 "1raayynvn1j8x0ck8pnbbljl6zxnsyzzil7y54xz03dpj7k9w7mk"))
+       (patches (search-patches "freedict-tools-fix-determinism.patch"))))
     (inputs (list espeak-ng
                   python
                   perl
diff --git a/gnu/packages/patches/freedict-tools-fix-determinism.patch b/gnu/packages/patches/freedict-tools-fix-determinism.patch
new file mode 100644
index 0000000000..ad100bbba9
--- /dev/null
+++ b/gnu/packages/patches/freedict-tools-fix-determinism.patch
@@ -0,0 +1,22 @@
+The compression utility dictzip writes the compressed file's mtime in a header
+of the compressed file. No command-line switch is documented to control or
+suppress this behavior. This makes the build of packages relying on
+freedict-tools such as freedict-dictionaries non-deterministic.
+
+This patch sets the mtime of the .dict file to be compressed by dictzip to the
+start of the epoch on the Greenwich meridian, restoring build determinism.
+
+diff --git a/mk/dicts.mk b/mk/dicts.mk
+index 08e8923..e671cf3 100644
+--- a/mk/dicts.mk
++++ b/mk/dicts.mk
+@@ -265,7 +265,8 @@ $(BUILD_DICTD)/%.dict $(BUILD_DICTD)/%.index: $(BUILD_DICTD)/%.c5 query-dictd
+ 		dictfmt --without-time -t --headword-separator %%% $(DICTFMTFLAGS) $* < $(notdir $<)
+ 
+ $(BUILD_DICTD)/%.dict.dz: $(BUILD_DICTD)/%.dict
+-	dictzip -k $<
++	touch -m -d "$$(date -u -R -d @0)" $< && \
++		dictzip -k $<
+ 
+ # prevent make from removing our precious file
+ .PRECIOUS: $(BUILD_DICTD)/$(dictname).dict
-- 
2.46.0






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

* [bug#74411] patch v2 non-determinism fix
  2024-11-17 18:06 [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages Runciter via Guix-patches via
                   ` (6 preceding siblings ...)
  2024-11-21  0:49 ` [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
@ 2024-11-21  1:15 ` Runciter via Guix-patches via
  7 siblings, 0 replies; 14+ messages in thread
From: Runciter via Guix-patches via @ 2024-11-21  1:15 UTC (permalink / raw)
  To: 74411

Version 2 of the patch is a change to the freedict-tools package which
is a fix for the non-determinism of dictzip headers.

Before compressing .dict files, a shell command involving touch and date
sets the file's mtime to the start of the epoch taken on the Greenwich
meridian.

The build is now repeatable on my machine, and probably on any single
machine. As for reproducibility across machines, well, good chance it'll
be reproducible: the design intent is that the compressed file headers
should be insensitive to the system's configured time zone. This will
need to be assured by challenging a substitutes build from a computer
which is configured on a timezone different from its substitute server.

Runciter





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

end of thread, other threads:[~2024-11-21  1:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-17 18:06 [bug#74411] [PATCH 0/4] Add DICT and FreeDict projects packages Runciter via Guix-patches via
2024-11-18  5:55 ` [bug#74411] [PATCH 1/4] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
2024-11-18  5:56 ` [bug#74411] [PATCH 2/4] gnu: Add dictd-1.13.1 Runciter via Guix-patches via
2024-11-18  5:56 ` [bug#74411] [PATCH 3/4] gnu: Add freedict-tools-0.6.0 Runciter via Guix-patches via
2024-11-18  5:56 ` [bug#74411] [PATCH 4/4] gnu: Add freedict-dictionaries Runciter via Guix-patches via
2024-11-18  6:37 ` [bug#74411] freedict-dictionaries build non-deterministic Runciter via Guix-patches via
2024-11-19  8:43   ` Nicolas Graves via Guix-patches via
2024-11-19 15:13 ` Runciter via Guix-patches via
2024-11-21  0:49 ` [bug#74411] [PATCH v2 1/5] gnu: Add (gnu packages dictd) Runciter via Guix-patches via
2024-11-21  0:49   ` [bug#74411] [PATCH v2 2/5] gnu: Add dictd-1.13.1 Runciter via Guix-patches via
2024-11-21  0:50   ` [bug#74411] [PATCH v2 3/5] gnu: Add freedict-tools-0.6.0 Runciter via Guix-patches via
2024-11-21  0:50   ` [bug#74411] [PATCH v2 4/5] gnu: Add freedict-dictionaries Runciter via Guix-patches via
2024-11-21  0:50   ` [bug#74411] [PATCH v2 5/5] gnu: freedict-tools: Fix non-determinism of dictzip compressed file headers Runciter via Guix-patches via
2024-11-21  1:15 ` [bug#74411] patch v2 non-determinism fix Runciter via Guix-patches via

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.