dunlin/default.nix

96 lines
2.0 KiB
Nix
Raw Normal View History

2022-12-19 18:49:10 +00:00
{ stdenv
, callPackage
, copyDesktopItems
, fennel
, fetchFromGitHub
, fetchurl
, glib-networking
, gobject-introspection
, gtk3
, gnome3
, lib
, librsvg
, lua53Packages
, lua5_3
, makeDesktopItem
, makeWrapper
2022-12-22 22:52:37 +00:00
, pandoc
2022-12-19 18:49:10 +00:00
, webkitgtk
, writeText
}:
let pname = "dunlin";
2022-12-27 12:23:24 +00:00
lume = let lua = lua5_3; in lua53Packages.buildLuaPackage rec {
pname = "lume";
version = "1";
src = fetchFromGitHub {
repo = "lume"; owner = "rxi";
rev = "98847e7812cf28d3d64b289b03fad71dc704547d";
hash = "sha256-/u23EqgjjkU8FV9oXvMNXBkY8JAOJUhJAzXTSibJthU=";
};
buildPhase = ":";
installPhase = ''
mkdir -p "$out/share/lua/${lua.luaversion}"
cp lume.lua "$out/share/lua/${lua.luaversion}"
'';
};
lsqlite3 = callPackage ./lsqlite3.nix { lua = lua5_3; };
2022-12-19 18:49:10 +00:00
lua = lua5_3.withPackages (ps: with ps; [
lgi
luafilesystem
luaposix
readline
2022-12-27 12:23:24 +00:00
lume
lsqlite3
2022-12-19 18:49:10 +00:00
]);
fennel_ = lua.pkgs.fennel;
glib_networking_gio = "${glib-networking}/lib/gio/modules";
in stdenv.mkDerivation rec {
inherit pname;
fennel = fennel_;
version = "0.1";
src = lib.sources.cleanSource ./.;
2022-12-19 18:49:10 +00:00
GIO_EXTRA_MODULES = glib_networking_gio;
buildInputs = [
lua
gtk3
webkitgtk
gobject-introspection.dev
fennel
glib-networking
];
nativeBuildInputs = [
lua
2022-12-23 15:11:26 +00:00
pandoc
2022-12-19 18:49:10 +00:00
makeWrapper
copyDesktopItems
];
makeFlags = [ "PREFIX=${placeholder "out"}" ];
desktopItems = [
(makeDesktopItem rec {
desktopName = "Just Browsing";
name = pname;
exec = pname;
categories = ["Network"] ;
# icon = ./just.png;
genericName = "Web browser";
})
];
postInstall = ''
makeWrapper ${fennel}/bin/fennel \
$out/bin/${pname} \
--set GI_TYPELIB_PATH "$GI_TYPELIB_PATH" \
--prefix GIO_EXTRA_MODULES ":" "${glib_networking_gio}" \
--add-flags "--add-fennel-path $out/lib/just/?.fnl" \
--add-flags "--add-package-path $out/lib/just/?.lua" \
--add-flags "$out/lib/just/just.fnl"
'';
}