emiluaPlugins.qt6: init at 1.0.3

Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
lucasew 2024-09-10 21:49:11 -03:00
parent 6f3735f382
commit 32741141c7
3 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,12 @@
local qt = require 'qt6'
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,91 @@
{
lib,
stdenv,
fetchFromGitLab,
asciidoctor,
ninja,
gperf,
gawk,
pkg-config,
boost,
luajit_openresty,
fmt,
meson,
emilua,
qt6Packages,
openssl,
liburing,
gitUpdater,
runCommand,
xvfb-run,
qt6, # this
}:
stdenv.mkDerivation rec {
pname = "emilua-qt6";
version = "1.0.3";
src = fetchFromGitLab {
owner = "emilua";
repo = "qt6";
rev = "v${version}";
hash = "sha256-azMnM17HQMzC0ExgWurQzbR3fX9EwBRSu4kVTm3U2Ic=";
};
buildInputs = with qt6Packages; [
qtbase
qtdeclarative
boost
luajit_openresty
emilua
fmt
openssl
liburing
];
nativeBuildInputs = with qt6Packages; [
qttools
wrapQtAppsHook
gperf
gawk
asciidoctor
pkg-config
meson
ninja
];
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests.basic =
runCommand "test-basic-qt6"
{
buildInputs = [
emilua
qt6
qt6Packages.wrapQtAppsHook
qt6Packages.qtbase
qt6Packages.qtdeclarative
xvfb-run
];
dontWrapQtApps = true;
}
''
makeWrapper ${lib.getExe emilua} payload \
''${qtWrapperArgs[@]} \
--add-flags ${./basic_test.lua}
xvfb-run ./payload
touch $out
'';
};
meta = with lib; {
description = "Qt6 bindings for Emilua";
homepage = "https://emilua.org/";
license = licenses.boost;
maintainers = with maintainers; [
manipuladordedados
lucasew
];
platforms = platforms.linux;
};
}

View File

@ -10,4 +10,5 @@ emilua:
inherit emilua;
beast = self.callPackage ../development/emilua-plugins/beast { };
qt5 = self.callPackage ../development/emilua-plugins/qt5 { };
qt6 = self.callPackage ../development/emilua-plugins/qt6 { };
}))