push sheeet
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

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
{
fetchFromGitHub,
buildLuarocksPackage,
lua,
pkg-config,
lib,
replaceVars,
zenity,
}:
buildLuarocksPackage {
pname = "nfd";
version = "scm-1";
src = fetchFromGitHub {
owner = "Vexatos";
repo = "nativefiledialog";
rev = "2f74a5758e8df9b27158d444953697bc13fe90d8";
sha256 = "1f52mb0s9zrpsqjp10bx92wzqmy1lq7fg1fk1nd6xmv57kc3b1qv";
fetchSubmodules = true;
};
# use zenity because default gtk impl just crashes
patches = [
(replaceVars ./zenity.patch {
inherit zenity;
})
];
knownRockspec = "lua/nfd-scm-1.rockspec";
luarocksConfig.variables.LUA_LIBDIR = "${lua}/lib";
nativeBuildInputs = [ pkg-config ];
postInstall = ''
find $out -name nfd_zenity.so -execdir mv {} nfd.so \;
'';
doInstallCheck = true;
installCheckInputs = [ lua.pkgs.busted ];
installCheckPhase = ''
busted lua/spec/
'';
meta = {
description = "Tiny, neat Lua library that invokes native file open and save dialogs";
homepage = "https://github.com/Alloyed/nativefiledialog/tree/master/lua";
license = lib.licenses.zlib;
maintainers = [ lib.maintainers.scoder12 ];
broken = lua.luaversion != "5.1";
};
}

View File

@@ -0,0 +1,47 @@
diff --git a/lua/Makefile.linux b/lua/Makefile.linux
index 9f5aa68..77660d4 100644
--- a/lua/Makefile.linux
+++ b/lua/Makefile.linux
@@ -37,5 +37,5 @@ nfd_zenity.o: src/nfd_zenity.c
clean:
rm nfd_common.o nfd_gtk.o nfd_wrap_lua.o nfd.so
-install: nfd.so
- cp nfd.so $(INST_LIBDIR)
+install:
+ cp nfd*.so $(INST_LIBDIR)
diff --git a/lua/nfd-scm-1.rockspec b/lua/nfd-scm-1.rockspec
index 503399d..2d0a7da 100644
--- a/lua/nfd-scm-1.rockspec
+++ b/lua/nfd-scm-1.rockspec
@@ -17,9 +17,6 @@ supported_platforms = { "linux", "macosx", "windows" }
external_dependencies = {
platforms = {
linux = {
- gtk3 = {
- library = "gtk-3",
- }
}
}
}
@@ -28,6 +25,7 @@ build = {
linux = {
type = "make",
makefile = "lua/Makefile.linux",
+ build_target = "nfd_zenity.so",
build_variables = {
CFLAGS="$(CFLAGS)",
LIBFLAG="$(LIBFLAG)",
diff --git a/src/nfd_zenity.c b/src/nfd_zenity.c
index 43ccc6d..3fcdea0 100644
--- a/src/nfd_zenity.c
+++ b/src/nfd_zenity.c
@@ -109,6 +109,8 @@ ZenityCommon(char** command,
command[i] = tmp;
}
+ // caller always sets command[0] to "zenity"
+ command[0] = strdup("@zenity@/bin/zenity");
AddFiltersToCommandArgs(command, commandLen, filterList);
int byteCount = 0;