Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

122 lines
2.4 KiB
Nix

{
lib,
stdenv,
meson,
ninja,
fetchFromGitLab,
re2c,
gperf,
gawk,
pkg-config,
boost,
fmt,
luajit_openresty,
ncurses,
serd,
sord,
libcap,
liburing,
openssl,
cereal,
cmake,
asciidoctor,
makeWrapper,
versionCheckHook,
gitUpdater,
enableIoUring ? false,
emilua, # this package
}:
stdenv.mkDerivation (finalAttrs: {
pname = "emilua";
version = "0.11.7";
src = fetchFromGitLab {
owner = "emilua";
repo = "emilua";
tag = "v${finalAttrs.version}";
hash = "sha256-c+X8HD/G75XD54Fs89DSkebLDd7h12Bk45+w7VBUXPY=";
};
propagatedBuildInputs = [
luajit_openresty
boost
fmt
ncurses
serd
sord
libcap
liburing
openssl
cereal
];
nativeBuildInputs = [
re2c
gperf
gawk
pkg-config
asciidoctor
meson
cmake
ninja
makeWrapper
];
dontUseCmakeConfigure = true;
mesonFlags = [
(lib.mesonBool "enable_io_uring" enableIoUring)
(lib.mesonBool "enable_file_io" enableIoUring)
(lib.mesonBool "enable_tests" true)
(lib.mesonBool "enable_manpages" true)
(lib.mesonOption "version_suffix" "-nixpkgs1")
];
postPatch = ''
patchShebangs src/emilua_gperf.awk --interpreter '${lib.getExe gawk} -f'
'';
# io_uring is not allowed in Nix sandbox, that breaks the tests
doCheck = !enableIoUring;
mesonCheckFlags = [
# Skipped test: libpsx
# Known issue with no-new-privs disabled in the Nix build environment.
"--no-suite"
"libpsx"
];
postInstall = ''
mkdir -p $out/nix-support
cp ${./setup-hook.sh} $out/nix-support/setup-hook
substituteInPlace $out/nix-support/setup-hook \
--replace-fail @sitePackages@ "${finalAttrs.passthru.sitePackages}"
'';
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
inherit boost;
sitePackages = "lib/emilua-${(lib.concatStringsSep "." (lib.take 2 (lib.splitVersion finalAttrs.version)))}";
tests.with-io-uring = emilua.override { enableIoUring = true; };
};
meta = {
description = "Lua execution engine";
mainProgram = "emilua";
homepage = "https://emilua.org/";
license = lib.licenses.boost;
maintainers = with lib.maintainers; [
manipuladordedados
lucasew
];
platforms = lib.platforms.linux;
};
})