IppClub / IppClub/YueScript

Issues creating Gentoo package for Yuescript

Open
#171 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
613
Forks
45
PR merge metrics
No merged PRs in 30d

Description

Hello!

I thought I'd try my hand at creating a Gentoo package for Yuescript, but I'm running into a few issues. If you want, you can read the forum post I made, but I'll try to outline the relevant issues here.

Building against different Lua implementations.

In Gentoo, you can add the ability to build certain packages against certain language versions, either multiple or single. In the case of fennel, you can build it against Lua 5.3, 5.4 or LuaJIT, not all 3. See the ebuild (it's somewhat like PKGBUILD) for fennel here.

To do this for Yuescript, I'm unsure. Using Gentoo's functionality to build Yuescript against LuaJIT, I notice that it will build with -DLUA_COMPAT_5_3. Obviously one probably doesn't want this if they want to build against Lua 5.4 or LuaJIT. How to change this specifically I imagine involves patching something in a (c)makefile.

User CFLAGS are ignored

Another Gentoo thing is that you can set your CFLAGS universally for all packages, as well as LDFLAGS and so on. See the wiki page for /etc/portage/make.conf if you want to look at it in more detail.

It seems the makefiles for Yuescript will ignore these entirely, as it will build with

-std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX

This excludes a lot of flags that I've set, and I suspect the build is also ignoring that I've set the default linker to be mold. Again, maybe this involves patching something in a (c)makefile.

Resulting yue executable should go in /usr/bin

This is likely the simplest thing, but in Gentoo package's executables should go in /usr/bin not /usr/local/bin. Again, probably another patch situation or just overriding some envvar Yuescript's (c)makefiles will read.


To clarify, when I say "patch" I don't mean anyone here needs to change something in the project. In Gentoo, one can have package specific patches that can be applied before building said package. These could be for project build files (makefiles) or files in the source code itself.

I can make the patches, I just need to know what needs to be patched.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the project's makefiles and CMake files, focusing on Lua implementation selection, compiler and linker flags, and the install location of the yue executable. Compare those build entry points with the Gentoo ebuild requirements described in the issue. Done means a Gentoo package can select its Lua implementation, preserve user flags, and install yue under /usr/bin.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, lua
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.