Skip to content

nixos/services.dictd: init gcide at 0.54 #427615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

S0AndS0
Copy link

@S0AndS0 S0AndS0 commented Jul 23, 2025

GCIDE AKA GNU version of the Collaborative International Dictionary of English is a locally host-able database compatible with dictd service.

This should fix #248974 by yoinking, and translating, AUR's packaging of dict-gcide into something that conforms to NixOS expectations.

And may also address questions found on discourse

⚠️ sed-scripts are a source of future fragility, and I ain't happy about how libmaa dependency is currently being stolen into these proposed changes.

On a positive note; local tests such as dict hello return, almost instantly, results from the database

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.


Edit 2025-07-22 I see I'm failing the Lint checks, and will get 'round to trying to sort that soon 🤦

Update 2025-07-22 the error: path './sed-scripts/' has a trailing slash is, uh, kinda strange and I'd appreciate a bit o' expert help on that one 🙏

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle! 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels Jul 23, 2025
Copy link
Contributor

@dramforever dramforever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I only realized now that the comments below have reached double digits, but I hope you don't mind that these are what brings your contributions more in line with what Nixpkgs expects.

I haven't tried it out yet, and I don't fullyunderstand how the build process works, so hopefully someone with more energy or familiarity can provide further insights.

In addition to code suggestions, the commit message for the second commit should be dictdDBs.gcide: init at 0.53. Also please remember to squash any fixups at the end, so the history remains clean.

@S0AndS0
Copy link
Author

S0AndS0 commented Jul 25, 2025

Thanks for your contribution! I only realized now that the comments below have reached double digits, but I hope you don't mind that these are what brings your contributions more in line with what Nixpkgs expects.

I haven't tried it out yet, and I don't fullyunderstand how the build process works, so hopefully someone with more energy or familiarity can provide further insights.

In addition to code suggestions, the commit message for the second commit should be dictdDBs.gcide: init at 0.53. Also please remember to squash any fixups at the end, so the history remains clean.

Thanks for the rapid && actionable feedback! Oh and mind it I do not as main aim is to contribute, while also not making a mess ;-)

Build process is totally stolen from the AUR dict-gcide, including the sed-scripts, because I use Arch BTW™ but am making a transition to NixOS. Two things, so far, worthy of note;

  • Git repo from AUR does not include Git tags or similar, so updates here are likely to lag
  • It might have been smarter, and in the future/present smarter, to instead clone directly from AUR and run PKGBUILD script, then move stuff after

As for squashing and updating commit message, I'll be sure to do that once things are in an acceptable state, thanks for the correction(s)!


Update 2025-07-25 04:06 UTC: I've mostly got change requests sorted... mostly... And current commit changes are targeted to hopefully make reviewing through time a bit easier. The version attribute and libmaa dependency are where I'm expecting are still wrong.

@dramforever
Copy link
Contributor

I want to clarify before any misunderstanding that by squash, I mean eventually getting down to three commits: Adding yourself to maintainers list, extracting libmaa, dictdDBS.gcide: init

@S0AndS0
Copy link
Author

S0AndS0 commented Jul 25, 2025

I want to clarify before any misunderstanding that by squash, I mean eventually getting down to three commits: Adding yourself to maintainers list, extracting libmaa, dictdDBS.gcide: init

Ah, okay that seems reasonable, and I'll get on re-ordering changes and squashing thangs


Update 2025-07-25 08:24 UTC: I've re-ordered and squashed and updated commit messages 🎉

Currently I'm doing a fsck on the device hosting my NixOS install, had a hard-shutdown, so testing on my end if libmaa really is finally available via function arguments... and that I didn't break dictd... may be a few hours away x-)

S0AndS0 added a commit to S0AndS0/nixpkgs that referenced this pull request Jul 25, 2025
Extracted and version updated as part of NixOS#427615 change requests;

    NixOS#427615 (comment)

Version `1.5.1` as of date on this commit, 2025-07-25, seems the latest
`libmaa` package update around 2024-11-16 on SourceForge;

    https://sourceforge.net/projects/dict/

Due diligence steps preformed to mitigate breaking `dict`/`dictd` package;

- Hunt for `libmaa` references;
   ```bash
   find {pkgs,nixos} -type f -iname '*.nix' -exec grep -nHE 'libmaa' {} \;
   ```
- Hunt for `dict(d)?` references;
   ```bash
   find {pkgs,nixos} -type f -iname '*.nix' -exec grep -nHE '\s?dictd?\s+=' {} \;
   ```
@S0AndS0 S0AndS0 force-pushed the dictd-add-gcide-db branch from c15090f to 6a0809a Compare July 25, 2025 22:24
@nixpkgs-ci nixpkgs-ci bot removed 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jul 25, 2025
@@ -6,7 +6,7 @@
}:

stdenv.mkDerivation rec {
version = "1.3.2";
version = "1.5.1";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hash was not updated in src below, so this is definitely wrong.

cc maintainer @sikmir

Copy link
Author

@S0AndS0 S0AndS0 Jul 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, my bad and I'll git that fixed forthwith!


Update 2025-07-26 01:39 UTC: Makefile somewhere/when between version 1.3.2 and 1.5.1 upstream seems to have broken the for libmaa

error: builder for '/nix/store/rvy2c5x7r1gl6czxqrxapggjw6pjcrda-libmaa-1.5.1.drv' failed with exit code 2;
       last 11 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/qsgxi8l2vvfk9szlqgkynrxwqm0kan09-libmaa-1.5.1.tar.gz
       > source root is libmaa-1.5.1
       > setting SOURCE_DATE_EPOCH to timestamp 1716996386 of file "libmaa-1.5.1/tests/string/stringtest.c"
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > build flags: SHELL=/nix/store/p79bgyzmmmddi554ckwzbqlavbkw07zh-bash-5.2p37/bin/bash
       > Makefile:8: *** missing separator.  Stop.
       For full logs, run:
         nix log /nix/store/rvy2c5x7r1gl6czxqrxapggjw6pjcrda-libmaa-1.5.1.drv

If anyone wants to sort that out, the sha256-OjDiXwOOmcRxUSVUVRZJDZkf46UFglzIMrGpVuMb9mk= for version 1.5.1 seems to make the fetcher happy, but on my end I'm gonna have to revert version/hash updates and reduce changes to a move/rename 🤷

On a somewhat related note I'd like to know if there's a proper way of obtaining a hash without having to fail a rebuild, I found the nix-prefetch-url command;

nix-prefetch-url --type sha256 mirror://sourceforge/dict/libmaa-1.5.1.tar.gz

... but that doesn't produce the same hash as what fetchurl desires.

S0AndS0 added a commit to S0AndS0/nixpkgs that referenced this pull request Jul 26, 2025
Extracted and version updated as part of NixOS#427615 change requests;

    NixOS#427615 (comment)

Version `1.5.1` as of date on this commit, 2025-07-25, seems the latest
`libmaa` package update around 2024-11-16 on SourceForge;

    https://sourceforge.net/projects/dict/

Due diligence steps preformed to mitigate breaking `dict`/`dictd` package;

- Hunt for `libmaa` references;
   ```bash
   find {pkgs,nixos} -type f -iname '*.nix' -exec grep -nHE 'libmaa' {} \;
   ```
- Hunt for `dict(d)?` references;
   ```bash
   find {pkgs,nixos} -type f -iname '*.nix' -exec grep -nHE '\s?dictd?\s+=' {} \;
   ```
@S0AndS0 S0AndS0 force-pushed the dictd-add-gcide-db branch from 6a0809a to 779d8da Compare July 26, 2025 15:40
Extracted and version updated as part of NixOS#427615 change requests;

    NixOS#427615 (comment)

Version `1.5.1` as of date on this commit, 2025-07-25, seems the latest
`libmaa` package update around 2024-11-16 on SourceForge;

    https://sourceforge.net/projects/dict/

...  However, that fails to build due to upstream Makefile missing a
separator on line 8 so this patch set is rename/move only.

Due diligence steps preformed to mitigate breaking `dict`/`dictd` package;

- Hunt for `libmaa` references;
   ```bash
   find {pkgs,nixos} -type f -iname '*.nix' -exec grep -nHE 'libmaa' {} \;
   ```
- Hunt for `dict(d)?` references;
   ```bash
   find {pkgs,nixos} -type f -iname '*.nix' -exec grep -nHE '\s?dictd?\s+=' {} \;
   ```
@S0AndS0 S0AndS0 force-pushed the dictd-add-gcide-db branch from 779d8da to 3b6c7f2 Compare July 26, 2025 15:48
@S0AndS0
Copy link
Author

S0AndS0 commented Jul 26, 2025

Thanks dramforever for sticking with me, and ensuring I don't make a total mess of things!

Latest force-push (commit hash 3b6c7f24a0b6) should include almost all change requests, and local build/tests seem to be okay 🎉

[root@nixos:/etc/nixos]# nixos-rebuild switch --impure --flake . && dict hello

warning: Git tree '/etc/nixos' is dirty
building the system configuration...
warning: Git tree '/etc/nixos' is dirty
#> ...
Done. The new configuration is /nix/store/377vr3j69x4kbhmkgd777pabyh7l12kv-nixos-system-nixos-25.11.20250708.9807714
1 definition found

From The Collaborative International Dictionary of English v.0.53 [dict-gcide]:

  Hello \Hel*lo"\, interj. & n.
     An exclamation used as a greeting, to call attention, as an
     exclamation of surprise, or to encourage one. This variant of
     {Halloo} and {Holloo} has become the dominant form. In the
     United States, it is the most common greeting used in
     answering a telephone.
     [1913 Webster +PJC]

Copy link
Contributor

@dramforever dramforever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two other things:

  • The sed scripts have unclear license. Shipping it in Nixpkgs would amount to relicensing it to MIT. We should ask the AUR author about it.
  • In general, a fooPhase needs runPhase preFoo at the start and runPhase postFoo at the end. This is a limitation in the current phase framework of Nixpkgs, but it is what it is.

@S0AndS0 S0AndS0 force-pushed the dictd-add-gcide-db branch from 3b6c7f2 to 41cedbf Compare July 28, 2025 19:39
@S0AndS0
Copy link
Author

S0AndS0 commented Jul 28, 2025

The sed scripts have unclear license. Shipping it in Nixpkgs would amount to relicensing it to MIT. We should ask the AUR author about it.

Smart! I figured the "Package Details" → "Licenses" value was the project's license, but also get how even though it's a copy-left license it could technically apply to the package being distributed only.

Consider it asked :-)
And I got notifications turned-on, so if/when the team answers I'll be sure to

In general, a fooPhase needs runPhase preFoo at the start and runPhase postFoo at the end. This is a limitation in the current phase framework of Nixpkgs, but it is what it is.

🤔 I'm not sure if this is something I need to take action on, because I moved stuff to the prePatch phase as requested, but if it be more of a keep it in mind for any future packaging then I certainly will. And am grateful regardless!

No ... here please. Again, check how it's done on similar packages.

Ooof, okay that's a bit embarrassing 🤦
Here I thought I read the ellipsis was needed to prevent errors of too many args, but nope! And re-looking at neighboring packages I should've been smorter

Latest force push will have that removed as well as missing semicolons at the checkPhase added. Please do let me know if there's anything else I gotta tackle while with await an answer from AUR maintainers!

@dramforever
Copy link
Contributor

In general, a fooPhase needs runPhase preFoo at the start and runPhase postFoo at the end. This is a limitation in the current phase framework of Nixpkgs, but it is what it is.

🤔 I'm not sure if this is something I need to take action on, because I moved stuff to the prePatch phase as requested, but if it be more of a keep it in mind for any future packaging then I certainly will. And am grateful regardless!

I should have spelled it out, but in any case I simply meant installPhase and buildPhase

@S0AndS0
Copy link
Author

S0AndS0 commented Jul 29, 2025

In general, a fooPhase needs runPhase preFoo at the start and runPhase postFoo at the end. This is a limitation in the current phase framework of Nixpkgs, but it is what it is.

🤔 I'm not sure if this is something I need to take action on, because I moved stuff to the prePatch phase as requested, but if it be more of a keep it in mind for any future packaging then I certainly will. And am grateful regardless!

I should have spelled it out, but in any case I simply meant installPhase and buildPhase

Heh, thanks! I can be kinda dense, sometimes, and will for sure spend some quality time with the docs before submitting any new PRs


Edit 2025-07-29 05:36 UTC -- Uh, so skimming some other packages I'm seeing runHook preInstall within installPhase and, again, feel like I gotta ask if ya be asking for changes? Like should I do runPhase checkPhase within the installPhase instead of leveraging the doCheck = true attribute?

   '';

-  doCheck = true;
   checkPhase = ''
@...@
   '';

   installPhase = ''
+   runPhase checkPhase
    install -Dm 0644 -t "$out/share/dictd/" ./gcide.{dict.dz,index};

@S0AndS0
Copy link
Author

S0AndS0 commented Aug 5, 2025

Thought it wise to pop-in, no updates from the AUR package maintainers about license of .sed scripts, but I did to a bit of exploring of commit history via git whatchanged *.sed

And found there be one author that is involved with those files, who was last active just under one year ago for that repository. Plus a little cyber-stalking, AKA searching the commit email address on GitHub, shows @respiranto might be who we need to ask licensing clarification of.

Note I base this on checking the commit history of;

https://github.com/lawandorga/lawandorga-mail-server/commit/b900def64fe393f638f3195fd0e5e66c96c2d871

... and spotting the same name/email combo as what's in the AUR

Though I am not sure about the etiquette of reaching out directly via email just yet, maybe a public ping here is better 🤷

@respiranto
Copy link

I have added licensing information on the sedfiles and such in the AUR package.

@S0AndS0 S0AndS0 force-pushed the dictd-add-gcide-db branch from 41cedbf to a006c23 Compare August 13, 2025 19:28
@S0AndS0
Copy link
Author

S0AndS0 commented Aug 13, 2025

@respiranto you're the best! I noticed in the diff some things were removed, other than comments, and a few executable lines were added too. But rebuild against version 0.53 seems to be functional, and run-time is happy, so I'm gonna trust ya ;-)

@dramforever I tried bumping the version locally to 0.54 but that led to fetchurl time-outs so, for now, I'm gonna keep the proposed version at 0.53 for folks to enjoy and report back on. Please do let me know, when ya got a chance, if anything else need be done by me to get this PR into an acceptable state.

@respiranto
Copy link

@S0AndS0:

  • You may have used an older version of the AUR package; my commits from today definitely only added licensing. The previous commit is from 2025-07-14.
  • The current state of the sedfiles is specifically adapted to version 0.54; it may work for 0.53, but I actually removed many no-longer-needed fixes on update for version 0.54.

@S0AndS0
Copy link
Author

S0AndS0 commented Aug 14, 2025

Ah thanks for clarifying where other changes be from, and I'll try bumping the version here tomorrow to 0.54 as it my have been a rate-limiting thing that caused time-outs 🤷


Update 2025-08-14 20:36 UTC

I was being dumb about the time-outs 🤦 version and hash be updated in the latest force-push and I'll get to updating the title for this PR in a moment

This _should_ fix NixOS#248974 by yoinking, and translating, AUR's packaging
of [`dict-gcide`](https://aur.archlinux.org/packages/dict-gcide) into
something that conforms to NixOS expectations.

And may also address questions found on
[discourse](https://discourse.nixos.org/t/dict-offline-version/33004)

:warning: `sed-scripts` are a source of future fragility, and updates
here for NixOS will lag behind those provided by AUR team.

Big thanks to @respiranto for adding license info to sed scripts!

```bash
git clone https://aur.archlinux.org/dict-gcide.git &&
  git checkout ff81bcc526e3716f58a616a95d1f12b00ceb5695
```
@S0AndS0 S0AndS0 force-pushed the dictd-add-gcide-db branch from a006c23 to 168ee0c Compare August 14, 2025 20:39
@S0AndS0 S0AndS0 changed the title nixos/services.dictd: init gcide at 0.53 nixos/services.dictd: init gcide at 0.54 Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: dict-gcide
3 participants