diff options
-rw-r--r-- | nix/mkAstalPkg.nix | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/nix/mkAstalPkg.nix b/nix/mkAstalPkg.nix index 36fcf51..b0a00af 100644 --- a/nix/mkAstalPkg.nix +++ b/nix/mkAstalPkg.nix @@ -1,5 +1,7 @@ pkgs: let - inherit (builtins) replaceStrings readFile; + inherit (builtins) elem elemAt readFile replaceStrings splitVersion toJSON; + inherit (pkgs.lib) filterAttrs; + readVer = file: replaceStrings ["\n"] [""] (readFile file); toTOML = (pkgs.formats.toml {}).generate; @@ -42,7 +44,7 @@ pkgs: let }; urlmap = pkgs.writeText "urlmap" '' - baseURLs = ${builtins.toJSON [ + baseURLs = ${toJSON [ ["GLib" "https://docs.gtk.org/glib/"] ["GObject" "https://docs.gtk.org/gobject/"] ["Gio" "https://docs.gtk.org/gio/"] @@ -72,24 +74,34 @@ in postUnpack ? "", }: let version = readVer "${src}/version"; + + ver = splitVersion version; + api-ver = "${elemAt ver 0}.${elemAt ver 1}"; + girName = "Astal${gir-suffix}-${api-ver}"; in pkgs.stdenv.mkDerivation { inherit pname src version; outputs = ["out" "dev" "doc"]; - nativeBuildInputs = with pkgs; [ - wrapGAppsHook - gobject-introspection - meson - pkg-config - ninja - vala - wayland - wayland-scanner - python3 - ]; - - propagatedBuildInputs = [pkgs.glib] ++ packages; + nativeBuildInputs = with pkgs; + [ + wrapGAppsHook + gobject-introspection + meson + pkg-config + ninja + vala + wayland + wayland-scanner + python3 + ] + ++ nativeBuildInputs; + + propagatedBuildInputs = with pkgs; + [ + glib + ] + ++ packages; postUnpack = '' cp --remove-destination ${../lib/gir.py} $sourceRoot/gir.py @@ -97,13 +109,6 @@ in ''; postInstall = let - inherit (builtins) splitVersion elemAt elem; - inherit (pkgs.lib.attrsets) filterAttrs; - - ver = splitVersion version; - api-ver = "${elemAt ver 0}.${elemAt ver 1}"; - girName = "Astal${gir-suffix}-${api-ver}"; - data = toTOML libname { library = { inherit description authors version; @@ -133,6 +138,10 @@ in mv ${girName}/* $out/share/doc/${website-path} ''; + passthru = { + inherit girName; + }; + meta = { inherit description; homepage = "https://aylur.github.io/astal"; |