Hi,

On Thu, 2026-01-15 at 15:44 +0000, Ashish SHUKLA wrote:
> Which library are you trying to package ? In absence of a build
> system, 

I am trying to package
[evolved.lua](https://github.com/BlackMATov/evolved.lua).

> I would find the closest resembling build system to go with, usually 
> it's gnu-build-system (if they've a Makefile or something), or 
> copy-build-system.

This is what my package expression looks like:

```scm
(define-module (packages lua)
  #:use-module (gnu packages lua)
  #:use-module (guix gexp)
  #:use-module (guix utils)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix git-download)
  #:use-module (guix packages)
  #:use-module (guix build-system copy))

(define-public lua-evolved
  (package
    (name "lua-evolved")
    (version "1.7.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/BlackMATov/evolved.lua";)
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
"0bl4709qm2j0lmvvk8pdgr5f0c5mnrmlk9fvgiv1z0hap7fwpm9w"))))
    (build-system copy-build-system)
    (arguments
     (let* ((lua-version (version-major+minor (package-version lua)))
            (share (string-append "share/lua/" lua-version))
            (lua-path (string-append share "/?.lua")))
         (list
          #:install-plan
          #~`(("." #$share #:include-regexp
("evolved\\.[(lua|d\\.ts)]+$")))
          ;; Maybe I am mistaken, but we don't need to
          ;; modify phase?
          #:phases
          #~(modify-phases %standard-phases
               (add-before 'install 'set-env
                  (lambda _
                     (setenv "LUA_PATH" #$lua-path)))))))
    (home-page "https://github.com/BlackMATov/evolved.lua";)
    (synopsis "Evolved ECS for Lua")
    (description "@code{evolved.lua} is a fast and flexible ECS
(Entity-Component-System) library for Lua. It is designed to be
simple and easy to use, while providing all the features needed to
create complex systems with blazing performance.")
    (license license:expat)))
```

However, when I try to launch an [example project]
(https://github.com/BlackMATov/evolved.lua/blob/main/example/main.lua)
inside of the shell created with manifest.scm containing love and lua-
evolved, it is throwing a bunch of error messages?

manifest.scm for reference:

```scm
(load "./packages/lua.scm")

(use-modules (gnu packages game-development)
             (biome packages lua))

(packages->manifest (list love lua-evolved))
```

When trying to launch the example game:

```console
[env]$ love .
Error: main.lua:1: module 'evolved' not found:
        no field package.preload['evolved']
        no 'evolved' in LOVE game directories.
        no file 'evolved' in LOVE paths.
        no file './evolved.lua'
        no file '/gnu/store/5c2a9vg2rb29nnk0lxrg7ybig2snjwy1-luajit-
v2.1-0.04dca79/share/luajit-2.1/evolved.lua'
        no file '/usr/local/share/lua/5.1/evolved.lua'
        no file '/usr/local/share/lua/5.1/evolved/init.lua'
        no file '/gnu/store/5c2a9vg2rb29nnk0lxrg7ybig2snjwy1-luajit-
v2.1-0.04dca79/share/lua/5.1/evolved.lua'
        no file '/gnu/store/5c2a9vg2rb29nnk0lxrg7ybig2snjwy1-luajit-
v2.1-0.04dca79/share/lua/5.1/evolved/init.lua'
        no file './evolved.so'
        no file '/usr/local/lib/lua/5.1/evolved.so'
        no file '/gnu/store/5c2a9vg2rb29nnk0lxrg7ybig2snjwy1-luajit-
v2.1-0.04dca79/lib/lua/5.1/evolved.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [love "boot.lua"]:352: in function <[love "boot.lua"]:348>
        [C]: in function 'require'
        main.lua:1: in main chunk
        [C]: in function 'require'
        [love "boot.lua"]:323: in function <[love "boot.lua"]:126>
        [C]: in function 'xpcall'
        [love "boot.lua"]:362: in function <[love "boot.lua"]:355>
        [C]: in function 'xpcall'
```

Since I have packaged the app, I expected it to be able to resolve the
location to `/gnu/store/9x67zym9mm894dj4va805ja33zlf9kzs-lua-evolved-
1.7.0` ? Or do I also have to package the game that I'm making?

Regards,
Ashvith

Reply via email to