Implement researched Guix package outcome for #82: [Guix packaging] WeiDUorg/weidu #630

Closed
opened 2026-08-26 12:28:51 +00:00 by htayj · 1 comment
htayj commented 2026-08-26 12:28:51 +00:00 (Migrated from github.com)

Context

This delivery ticket was created from research issue #82 ([Guix packaging] WeiDUorg/weidu).

The host-validated research finding follows:

Canonical upstream is https://github.com/WeiDUorg/weidu at fixed devel commit 13f207b12833ce9bbbb119625a9b43b287738c52, source version 252.01 from src/version.ml, with the existing Guix codeload hash 0wpdg49dzcrr98a2izdg938l81nab83r6vy4zx6n7f1wa4ggvcsn. The exact parent tree is source-only, has no .gitmodules or gitlink entries, and contains no generated object or executable artifacts. COPYING is the GPL version 2 text and src/licence.ml identifies WeiDU as GPL with the upstream unmodified-binary permission; bundled notices at this fixed parent revision identify Elkhound as 3-clause BSD in elkhound/license.txt, fcase as MIT in fcase/fcase.c, zlib's permissive license in zlib/zlib.h, and xdiff plus Batteries-lite and the copied OCaml hash-table/parser/argument modules as LGPL 2.1 with the stated OCaml linking exception. The only separately fetched build origin needed is https://github.com/WeiDUorg/elkhound at fixed master commit b8f5589de119c89b36b1fc21d2f51c4a942ee3a8, Guix recursive source hash 04hypc95nnvab8nzxy76vvsbf7061wajn3rh6kn5rvwq24m2sjgj; its README and root license.txt give a 3-clause BSD redistribution grant and src/smbase/license.txt places that directory in the public domain. Thus every fetched origin is fixed and has explicit license evidence; do not use upstream CI's unpinned master.zip or The-Mod-Elephant's prebuilt Elkhound binary. The local channel and installed Guix search expose only weiduorg-weidu-source, an immutable source snapshot, and no equivalent installed weidu package; no weidu or equivalent was found in the inspected channel/package definitions. Add a public package in module (tay packages weidu), with a private source-built Elkhound helper using cmake-build-system and CMake flags -DEXTRAS=OFF and -DOCAML=OFF, native build inputs cmake, bison, flex, and a C/C++ toolchain; build WeiDU with gnu-build-system using native inputs ocaml-4.14 (Guix version 4.14.3), perl, and the helper, relying on the standard make/C toolchain. The pinned Makefile needs make weidu only, with Elkhound on PATH and OCaml's required -unsafe-string flags; do not build the zip/documentation targets. The Linux build emits obj/x86_LINUX/weidu.asm.exe, which must be installed as $out/bin/weidu; the compiler, OCaml, Elkhound, zlib, and other build inputs must not be runtime or propagated inputs. Install COPYING and the upstream README/license notices under share/doc/weidu and retain the embedded notices. No wrapper is needed: keep one executable named weidu, do not add setup-* aliases, and preserve the upstream CWD contract. At runtime WeiDU reads user-supplied mod/game files from the current directory, writes logs/backups/outputs there, and --nogame enables offline parsing/installation fixtures; Unix auto-update only scans/copies local WeiDU files and has no network client, while optional VIEW actions may call xdg-open and TP2 actions may invoke user-selected external commands via Unix.system. No service, credential, downloaded asset, game data, or network integration should be added. Acceptance must be proven by the implementation issue with guix lint -L. weidu passing with no new errors and guix build -L. weidu succeeding from the fixed source, plus an isolated no-network container smoke using fresh HOME, XDG_CONFIG_HOME, XDG_CACHE_HOME, and XDG_DATA_HOME: assert $out/bin/weidu --help exits 0 and contains WeiDU, assert --licence contains the GPL and fcaseopen notices, create input.txt and fixture.tp2 containing BACKUP backup, AUTHOR Guix smoke, BEGIN offline copy, and COPY input.txt output.txt, run $out/bin/weidu --nogame --noautoupdate --no-exit-pause --yes --force-install 0 fixture.tp2, and cmp input.txt output.txt. Snapshot the complete file list and sha256 digests of $out before the fixture, then assert the list/digests are unchanged afterward and that all fixture writes are confined to the temporary directory; this proves the installed executable contract and no package-output/store writes. The current research host could not execute Guix build because /var/guix/daemon-socket/socket is absent, so this is an execution-environment limitation and not package proof or an upstream blocker.

Acceptance criteria

  • Implement the viable package change identified in the host-validated research finding.
  • Preserve Guix source provenance, licensing, and deterministic build requirements recorded in the finding.
  • Add and pass a package-specific safe smoke proof using isolated HOME/XDG state before closure.

Imported from GitHub issue/PR. Originally posted by htayj on 2026-08-26T12:28:51Z.

<!-- goocastle-implementation-ticket:sequential-reviewer:82:1:implementation-ready --> ## Context This delivery ticket was created from research issue #82 ([Guix packaging] WeiDUorg/weidu). The host-validated research finding follows: Canonical upstream is https://github.com/WeiDUorg/weidu at fixed devel commit 13f207b12833ce9bbbb119625a9b43b287738c52, source version 252.01 from src/version.ml, with the existing Guix codeload hash 0wpdg49dzcrr98a2izdg938l81nab83r6vy4zx6n7f1wa4ggvcsn. The exact parent tree is source-only, has no .gitmodules or gitlink entries, and contains no generated object or executable artifacts. COPYING is the GPL version 2 text and src/licence.ml identifies WeiDU as GPL with the upstream unmodified-binary permission; bundled notices at this fixed parent revision identify Elkhound as 3-clause BSD in elkhound/license.txt, fcase as MIT in fcase/fcase.c, zlib's permissive license in zlib/zlib.h, and xdiff plus Batteries-lite and the copied OCaml hash-table/parser/argument modules as LGPL 2.1 with the stated OCaml linking exception. The only separately fetched build origin needed is https://github.com/WeiDUorg/elkhound at fixed master commit b8f5589de119c89b36b1fc21d2f51c4a942ee3a8, Guix recursive source hash 04hypc95nnvab8nzxy76vvsbf7061wajn3rh6kn5rvwq24m2sjgj; its README and root license.txt give a 3-clause BSD redistribution grant and src/smbase/license.txt places that directory in the public domain. Thus every fetched origin is fixed and has explicit license evidence; do not use upstream CI's unpinned master.zip or The-Mod-Elephant's prebuilt Elkhound binary. The local channel and installed Guix search expose only weiduorg-weidu-source, an immutable source snapshot, and no equivalent installed weidu package; no weidu or equivalent was found in the inspected channel/package definitions. Add a public package in module (tay packages weidu), with a private source-built Elkhound helper using cmake-build-system and CMake flags -DEXTRAS=OFF and -DOCAML=OFF, native build inputs cmake, bison, flex, and a C/C++ toolchain; build WeiDU with gnu-build-system using native inputs ocaml-4.14 (Guix version 4.14.3), perl, and the helper, relying on the standard make/C toolchain. The pinned Makefile needs make weidu only, with Elkhound on PATH and OCaml's required -unsafe-string flags; do not build the zip/documentation targets. The Linux build emits obj/x86_LINUX/weidu.asm.exe, which must be installed as $out/bin/weidu; the compiler, OCaml, Elkhound, zlib, and other build inputs must not be runtime or propagated inputs. Install COPYING and the upstream README/license notices under share/doc/weidu and retain the embedded notices. No wrapper is needed: keep one executable named weidu, do not add setup-* aliases, and preserve the upstream CWD contract. At runtime WeiDU reads user-supplied mod/game files from the current directory, writes logs/backups/outputs there, and --nogame enables offline parsing/installation fixtures; Unix auto-update only scans/copies local WeiDU files and has no network client, while optional VIEW actions may call xdg-open and TP2 actions may invoke user-selected external commands via Unix.system. No service, credential, downloaded asset, game data, or network integration should be added. Acceptance must be proven by the implementation issue with guix lint -L. weidu passing with no new errors and guix build -L. weidu succeeding from the fixed source, plus an isolated no-network container smoke using fresh HOME, XDG_CONFIG_HOME, XDG_CACHE_HOME, and XDG_DATA_HOME: assert $out/bin/weidu --help exits 0 and contains WeiDU, assert --licence contains the GPL and fcaseopen notices, create input.txt and fixture.tp2 containing BACKUP ~backup~, AUTHOR ~Guix smoke~, BEGIN ~offline copy~, and COPY ~input.txt~ ~output.txt~, run $out/bin/weidu --nogame --noautoupdate --no-exit-pause --yes --force-install 0 fixture.tp2, and cmp input.txt output.txt. Snapshot the complete file list and sha256 digests of $out before the fixture, then assert the list/digests are unchanged afterward and that all fixture writes are confined to the temporary directory; this proves the installed executable contract and no package-output/store writes. The current research host could not execute Guix build because /var/guix/daemon-socket/socket is absent, so this is an execution-environment limitation and not package proof or an upstream blocker. ## Acceptance criteria - Implement the viable package change identified in the host-validated research finding. - Preserve Guix source provenance, licensing, and deterministic build requirements recorded in the finding. - Add and pass a package-specific safe smoke proof using isolated HOME/XDG state before closure. --- Imported from [GitHub issue/PR](https://github.com/htayj/guix-channel/issues/630). Originally posted by [htayj](https://github.com/htayj) on 2026-08-26T12:28:51Z.
htayj commented 2026-08-27 05:43:17 +00:00 (Migrated from github.com)

Completed by Goocastle


Imported from GitHub comment. Originally posted by htayj on 2026-08-27T05:43:17Z.

Completed by Goocastle --- Imported from [GitHub comment](https://github.com/htayj/guix-channel/issues/630#issuecomment-5434886695). Originally posted by [htayj](https://github.com/htayj) on 2026-08-27T05:43:17Z.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tay/guix-channel#630
No description provided.