Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv, fetchFromGitHub, buildLuarocksPackage, lua, pkg-config, lib 2, substituteAll, zenity, AppKit }: 3 4buildLuarocksPackage { 5 pname = "nfd"; 6 version = "scm-1"; 7 8 src = fetchFromGitHub { 9 owner = "Vexatos"; 10 repo = "nativefiledialog"; 11 rev = "2f74a5758e8df9b27158d444953697bc13fe90d8"; 12 sha256 = "1f52mb0s9zrpsqjp10bx92wzqmy1lq7fg1fk1nd6xmv57kc3b1qv"; 13 fetchSubmodules = true; 14 }; 15 16 # use zenity because default gtk impl just crashes 17 patches = [ 18 (substituteAll { 19 src = ./zenity.patch; 20 inherit zenity; 21 }) 22 ]; 23 rockspecDir = "lua"; 24 25 extraVariables.LUA_LIBDIR = "${lua}/lib"; 26 nativeBuildInputs = [ pkg-config ]; 27 28 buildInputs = lib.optionals stdenv.isDarwin [ AppKit ]; 29 30 fixupPhase = '' 31 find $out -name nfd_zenity.so -execdir mv {} nfd.so \; 32 ''; 33 34 disabled = with lua; (luaversion != "5.1"); 35 36 meta = { 37 description = 38 "A tiny, neat lua library that portably invokes native file open and save dialogs."; 39 homepage = "https://github.com/Alloyed/nativefiledialog/tree/master/lua"; 40 license = lib.licenses.zlib; 41 maintainers = [ lib.maintainers.scoder12 ]; 42 }; 43}