emilua: bump + plugin support (#339898)
This commit is contained in:
commit
6427bcad3b
37
pkgs/development/emilua-plugins/beast/default.nix
Normal file
37
pkgs/development/emilua-plugins/beast/default.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
stdenv,
|
||||
emilua,
|
||||
meson,
|
||||
gperf,
|
||||
ninja,
|
||||
asciidoctor,
|
||||
pkg-config,
|
||||
fetchFromGitLab,
|
||||
gitUpdater,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (self: {
|
||||
pname = "emilua_beast";
|
||||
version = "1.1.0";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "emilua";
|
||||
repo = "beast";
|
||||
rev = "v${self.version}";
|
||||
hash = "sha256-HvfEigHJTZelPvHFk22PWxkTFEajHJXfiCndxXHVgq8=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
emilua
|
||||
asciidoctor
|
||||
gperf
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
pkg-config
|
||||
ninja
|
||||
];
|
||||
|
||||
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
|
||||
})
|
@ -22,6 +22,7 @@
|
||||
cmake,
|
||||
asciidoctor,
|
||||
makeWrapper,
|
||||
gitUpdater
|
||||
}:
|
||||
|
||||
let
|
||||
@ -29,24 +30,41 @@ let
|
||||
owner = "breese";
|
||||
repo = "trial.protocol";
|
||||
rev = "79149f604a49b8dfec57857ca28aaf508069b669";
|
||||
name = "trial-protocol";
|
||||
hash = "sha256-Xd8bX3z9PZWU17N9R95HXdj6qo9at5FBL/+PTVaJgkw=";
|
||||
sparseCheckout = [
|
||||
"include"
|
||||
];
|
||||
hash = "sha256-QpQ70KDcJyR67PtOowAF6w48GitMJ700B8HiEwDA5sU=";
|
||||
postFetch = ''
|
||||
rm $out/*.*
|
||||
mkdir -p $out/lib/pkgconfig
|
||||
cat > $out/lib/pkgconfig/trial-protocol.pc << EOF
|
||||
Name: trial.protocol
|
||||
Version: 0-unstable-2023-02-10
|
||||
Description: C++ header-only library with parsers and generators for network wire protocols
|
||||
Requires:
|
||||
Libs:
|
||||
Cflags:
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
|
||||
boost = boost182;
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
stdenv.mkDerivation (self: {
|
||||
pname = "emilua";
|
||||
version = "0.7.3";
|
||||
version = "0.10.1";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "emilua";
|
||||
repo = "emilua";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-j8ohhqHjSBgc4Xk9PcQNrbADmsz4VH2zCv+UNqiCv4I=";
|
||||
rev = "v${self.version}";
|
||||
hash = "sha256-D6XKXik9nWQ6t6EF6dLbRGB60iFbPUM8/H8iFAz1QlE=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
propagatedBuildInputs = [
|
||||
luajit_openresty
|
||||
boost182
|
||||
boost
|
||||
fmt
|
||||
ncurses
|
||||
serd
|
||||
@ -55,6 +73,7 @@ stdenv.mkDerivation rec {
|
||||
liburing
|
||||
openssl
|
||||
cereal
|
||||
trial-protocol-wrap
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
@ -80,12 +99,6 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
pushd subprojects
|
||||
cp -r ${trial-protocol-wrap} trial-protocol
|
||||
chmod +w trial-protocol
|
||||
cp "packagefiles/trial.protocol/meson.build" "trial-protocol/"
|
||||
popd
|
||||
|
||||
patchShebangs src/emilua_gperf.awk --interpreter '${lib.getExe gawk} -f'
|
||||
'';
|
||||
|
||||
@ -97,12 +110,25 @@ stdenv.mkDerivation rec {
|
||||
"--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 @sitePackages@ "${self.passthru.sitePackages}"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
updateScript = gitUpdater {rev-prefix = "v";};
|
||||
inherit boost;
|
||||
sitePackages = "lib/emilua-${(lib.concatStringsSep "." (lib.take 2 (lib.splitVersion self.version)))}";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Lua execution engine";
|
||||
mainProgram = "emilua";
|
||||
homepage = "https://emilua.org/";
|
||||
license = licenses.boost;
|
||||
maintainers = with maintainers; [ manipuladordedados ];
|
||||
maintainers = with maintainers; [ manipuladordedados lucasew ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
17
pkgs/development/interpreters/emilua/setup-hook.sh
Normal file
17
pkgs/development/interpreters/emilua/setup-hook.sh
Normal file
@ -0,0 +1,17 @@
|
||||
addEmiluaPath() {
|
||||
addToSearchPathWithCustomDelimiter : EMILUA_PATH $1/@sitePackages@
|
||||
}
|
||||
|
||||
toEmiluaPath() {
|
||||
local paths="$1"
|
||||
local result=
|
||||
for i in $paths; do
|
||||
p="$i/@sitePackages@"
|
||||
result="${result}${result:+:}$p"
|
||||
done
|
||||
echo $result
|
||||
}
|
||||
|
||||
if [ -z "${dontAddEmiluaPath:-}" ]; then
|
||||
addEnvHooks "$hostOffset" addEmiluaPath
|
||||
fi
|
@ -16620,7 +16620,11 @@ with pkgs;
|
||||
zuo = callPackage ../development/interpreters/zuo { };
|
||||
|
||||
### LUA interpreters
|
||||
emilua = callPackage ../development/interpreters/emilua { };
|
||||
emiluaPlugins = recurseIntoAttrs
|
||||
(callPackage ./emilua-plugins.nix {}
|
||||
(callPackage ../development/interpreters/emilua { }));
|
||||
|
||||
inherit (emiluaPlugins) emilua;
|
||||
|
||||
luaInterpreters = callPackage ./../development/interpreters/lua-5 { };
|
||||
inherit (luaInterpreters) lua5_1 lua5_2 lua5_2_compat lua5_3 lua5_3_compat lua5_4 lua5_4_compat luajit_2_1 luajit_2_0 luajit_openresty;
|
||||
|
12
pkgs/top-level/emilua-plugins.nix
Normal file
12
pkgs/top-level/emilua-plugins.nix
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
lib,
|
||||
newScope,
|
||||
pkgs,
|
||||
config,
|
||||
}:
|
||||
|
||||
emilua:
|
||||
(lib.makeScope newScope (self: {
|
||||
inherit emilua;
|
||||
beast = self.callPackage ../development/emilua-plugins/beast { };
|
||||
}))
|
Loading…
Reference in New Issue
Block a user