diff options
Diffstat (limited to 'pkgs/applications/window-managers')
4 files changed, 89 insertions, 61 deletions
diff --git a/pkgs/applications/window-managers/wayfire/applications.nix b/pkgs/applications/window-managers/wayfire/applications.nix deleted file mode 100644 index a77d3f8bf5d..00000000000 --- a/pkgs/applications/window-managers/wayfire/applications.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ lib, newScope, wayfirePlugins }: - -lib.makeExtensible (self: with self; { - inherit wayfirePlugins; - - callPackage = newScope self; - - wayfire = callPackage ./. { }; - - wcm = callPackage ./wcm.nix { - inherit (wayfirePlugins) wf-shell; - }; - - wrapWayfireApplication = callPackage ./wrapper.nix { }; - - withPlugins = selector: self // { - wayfire = wrapWayfireApplication wayfire selector; - wcm = wrapWayfireApplication wcm selector; - }; -}) diff --git a/pkgs/applications/window-managers/wayfire/plugins.nix b/pkgs/applications/window-managers/wayfire/plugins.nix index 830a918fcb7..111a8c87dd7 100644 --- a/pkgs/applications/window-managers/wayfire/plugins.nix +++ b/pkgs/applications/window-managers/wayfire/plugins.nix @@ -1,12 +1,11 @@ -{ newScope, wayfire }: - -let - self = with self; { - inherit wayfire; - - callPackage = newScope self; +{ lib, pkgs }: +lib.makeScope pkgs.newScope (self: + let + inherit (self) callPackage; + in { + wayfire-plugins-extra = callPackage ./wayfire-plugins-extra.nix { }; + wcm = callPackage ./wcm.nix { }; wf-shell = callPackage ./wf-shell.nix { }; - }; -in -self + } +) diff --git a/pkgs/applications/window-managers/wayfire/wayfire-plugins-extra.nix b/pkgs/applications/window-managers/wayfire/wayfire-plugins-extra.nix new file mode 100644 index 00000000000..110fcfe75ff --- /dev/null +++ b/pkgs/applications/window-managers/wayfire/wayfire-plugins-extra.nix @@ -0,0 +1,56 @@ +{ stdenv +, lib +, fetchFromGitHub +, meson +, ninja +, pkg-config +, wayfire +, wf-config +, gtkmm3 +, gtk-layer-shell +, libxkbcommon +, xcbutilwm +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "wayfire-plugins-extra"; + version = "0.7.5"; + + src = fetchFromGitHub { + owner = "WayfireWM"; + repo = "wayfire-plugins-extra"; + rev = "v${finalAttrs.version}"; + fetchSubmodules = true; + hash = "sha256-hnsRwIrl0+pRKhRlrF/Wdlu6HkzLfYukGk4Hzx3wNeo="; + }; + + postPatch = '' + substituteInPlace metadata/meson.build \ + --replace "wayfire.get_variable(pkgconfig: 'metadatadir')" "join_paths(get_option('prefix'), 'share/wayfire/metadata')" + ''; + + nativeBuildInputs = [ + meson + ninja + pkg-config + ]; + + buildInputs = [ + wayfire + wf-config + libxkbcommon + xcbutilwm + gtkmm3 + gtk-layer-shell + ]; + + mesonFlags = [ "--sysconfdir /etc" ]; + + meta = { + homepage = "https://github.com/WayfireWM/wayfire-plugins-extra"; + description = "Additional plugins for Wayfire"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ rewine ]; + inherit (wayfire.meta) platforms; + }; +}) diff --git a/pkgs/applications/window-managers/wayfire/wrapper.nix b/pkgs/applications/window-managers/wayfire/wrapper.nix index e972929237d..35bb3ad1583 100644 --- a/pkgs/applications/window-managers/wayfire/wrapper.nix +++ b/pkgs/applications/window-managers/wayfire/wrapper.nix @@ -1,39 +1,32 @@ -{ runCommand, lib, makeWrapper, wayfirePlugins }: +{ symlinkJoin, lib, makeWrapper, wayfire, plugins ? [ ] }: -let - inherit (lib) escapeShellArg makeBinPath; +symlinkJoin { + name = "wayfire-wrapped-${lib.getVersion wayfire}"; - xmlPath = plugin: "${plugin}/share/wayfire/metadata/wf-shell"; - - makePluginPath = lib.makeLibraryPath; - makePluginXMLPath = lib.concatMapStringsSep ":" xmlPath; -in + nativeBuildInputs = [ makeWrapper ]; -application: + paths = [ + wayfire + ] ++ plugins; -choosePlugins: + postBuild = '' + for binary in $out/bin/*; do + wrapProgram $binary \ + --prefix WAYFIRE_PLUGIN_PATH : $out/lib/wayfire \ + --prefix WAYFIRE_PLUGIN_XML_PATH : $out/share/wayfire/metadata + done + ''; -let - plugins = choosePlugins wayfirePlugins; -in + preferLocalBuild = true; -runCommand "${application.name}-wrapped" { - nativeBuildInputs = [ makeWrapper ]; - - passthru = application.passthru // { - unwrapped = application; + passthru = wayfire.passthru // { + unwrapped = wayfire; }; - inherit (application) meta; -} '' - mkdir -p $out/bin - for bin in ${application}/bin/* - do - makeWrapper "$bin" $out/bin/''${bin##*/} \ - --suffix PATH : ${escapeShellArg (makeBinPath plugins)} \ - --suffix WAYFIRE_PLUGIN_PATH : ${escapeShellArg (makePluginPath plugins)} \ - --suffix WAYFIRE_PLUGIN_XML_PATH : ${escapeShellArg (makePluginXMLPath plugins)} - done - find ${application} -mindepth 1 -maxdepth 1 -not -name bin \ - -exec ln -s '{}' $out ';' -'' + meta = wayfire.meta // { + # To prevent builds on hydra + hydraPlatforms = []; + # prefer wrapper over the package + priority = (wayfire.meta.priority or 0) - 1; + }; +} |