emiluaPlugins.qt5: init at 1.0.1

Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
lucasew 2024-09-10 21:38:15 -03:00
parent 54dc5d189a
commit 6f3735f382
3 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,12 @@
local qt = require 'qt5'
local qml = qt.load_qml(byte_span.append([[
import QtQml 2.0
QtObject {
function foobar(a: int, b: int): int {
return a + b
}
}
]]))
assert(qml.object('foobar(int,int)', 1, 2), 3)
print("done 👍")

View File

@ -0,0 +1,87 @@
{
lib,
stdenv,
meson,
ninja,
fetchFromGitLab,
gperf,
gawk,
gitUpdater,
pkg-config,
boost,
luajit_openresty,
asciidoctor,
libsForQt5,
emilua,
liburing,
fmt,
runCommand,
xvfb-run,
qt5, # this
}:
stdenv.mkDerivation rec {
pname = "emilua-qt5";
version = "1.0.1";
src = fetchFromGitLab {
owner = "emilua";
repo = "qt5";
rev = "v${version}";
hash = "sha256-FkBfzGzUX7dvHjWRBjVwppU4jZBbY02gP+fIta8mjIw=";
};
buildInputs = [
luajit_openresty
boost
libsForQt5.qtdeclarative
emilua
liburing
fmt
libsForQt5.qtbase
];
nativeBuildInputs = [
gperf
gawk
pkg-config
asciidoctor
meson
ninja
libsForQt5.wrapQtAppsHook
libsForQt5.qttools
];
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests.basic =
runCommand "test-basic-qt5"
{
buildInputs = [
emilua
qt5
libsForQt5.wrapQtAppsHook
xvfb-run
];
dontWrapQtApps = true;
}
''
makeWrapper ${lib.getExe emilua} payload \
''${qtWrapperArgs[@]} \
--add-flags ${./basic_test.lua}
xvfb-run ./payload
touch $out
'';
};
meta = with lib; {
description = "Qt5 bindings for Emilua";
homepage = "https://emilua.org/";
license = licenses.boost;
maintainers = with maintainers; [
manipuladordedados
lucasew
];
platforms = platforms.linux;
};
}

View File

@ -9,4 +9,5 @@ emilua:
(lib.makeScope newScope (self: {
inherit emilua;
beast = self.callPackage ../development/emilua-plugins/beast { };
qt5 = self.callPackage ../development/emilua-plugins/qt5 { };
}))