From 612534e7cfb3eab7889d3bb456867e12948e77d7 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 3 Nov 2023 18:58:45 +0300 Subject: [PATCH] pkgs: add rofi-calc-wayland and rofi-emoji-wayland Wayland patched versions of rofi-calc and rofi-emoji --- .github/workflows/build.yml | 2 + README.md | 22 +++++----- npins/sources.json | 28 +++++++++++++ patches/0002-patch-plugin-dir.patch | 25 +++++++++++ pkgs/default.nix | 2 + pkgs/rofi-calc-wayland/default.nix | 56 +++++++++++++++++++++++++ pkgs/rofi-emoji-wayland/default.nix | 65 +++++++++++++++++++++++++++++ 7 files changed, 190 insertions(+), 10 deletions(-) create mode 100644 patches/0002-patch-plugin-dir.patch create mode 100644 pkgs/rofi-calc-wayland/default.nix create mode 100644 pkgs/rofi-emoji-wayland/default.nix diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ec4fdf..b3a2be6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,8 @@ jobs: - mov-cli - rat - ani-cli + - rofi-calc-wayland + - rofi-emoji-wayland uses: ./.github/workflows/nix.yml with: diff --git a/README.md b/README.md index 00acb8f..85c5a8a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ inputs = { }; ``` -After adding the input, you can consume the [exposed packages](#packages) in your system configuration. +After adding the input, you can consume the [exposed packages](#-packages) in your system configuration. An example `flake.nix` would be as follows: ```nix @@ -99,15 +99,15 @@ in { There are several packages exposed by this flake. Each directory in `pkgs` contains a description of the package inside its README. -| Package | Description | -| :--------------- | :------------------------------------------------------------------------------------------------: | -| ani-cli | An up-to-date, auto updated version of ani-cli | -| cloneit | A CLI tool to download specific GitHub directories or files | -| foot-transparent | A patched version of the foot terminal emulator that brings back fullscreen transparency[^1] | -| rat | Linux shell port of the horizontally spinning rat meme, complete with soundtrack and spin counter. | -| reposilite-bin | A derivation for the reposilite maven repository. | - -[^1]: Foot has broken fullscreen transparency on 1.15, which looks **really** ugly with padding. The author is dead set on not fixing it, because it's broken on one wayland compositor that a total of 7 people use. +| Package | Description | +| :----------------- | :------------------------------------------------------------------------------------------------: | +| ani-cli | An up-to-date, auto updated version of ani-cli | +| cloneit | A CLI tool to download specific GitHub directories or files | +| foot-transparent | A patched version of the foot terminal emulator that brings back fullscreen transparency[^1] | +| rat | Linux shell port of the horizontally spinning rat meme, complete with soundtrack and spin counter. | +| reposilite-bin | A derivation for the reposilite maven repository. | +| rofi-calc-wayland | A wayland patched version of [rofi-calc](https://github.com/svenstaro/rofi-calc) | +| rofi-emoji-wayland | A wayland patched version of [rofi-emoji](https://github.com/Mange/rofi-emoji) | ## 🔧 Contributing @@ -116,3 +116,5 @@ PRs are always welcome. ## 🫂 Credits The repository structure is mostly borrowed from [@fufexan](https://github.com/fufexan)'s [nix-gaming](https://github.com/fufexan/nix-gaming). + +[^1]: Foot has broken fullscreen transparency on 1.15, which looks **really** ugly with padding. The author is dead set on not fixing it, because it's broken on one wayland compositor that a total of 7 people use. diff --git a/npins/sources.json b/npins/sources.json index 6e57fd0..0b97787 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -47,6 +47,34 @@ "name": "nixpkgs-unstable", "url": "https://releases.nixos.org/nixpkgs/nixpkgs-23.11pre543441.b644d97bda6d/nixexprs.tar.xz", "hash": "1xq7rz2bcb115xkahpvslsqpliisv2587z93izz81lna77r4na1d" + }, + "rofi-calc": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "svenstaro", + "repo": "rofi-calc" + }, + "pre_releases": false, + "version_upper_bound": null, + "version": "v2.2.0", + "revision": "6b9729f8cfba7f83cdf7f801509ed63bb9edd6f0", + "url": "https://api.github.com/repos/svenstaro/rofi-calc/tarball/v2.2.0", + "hash": "00qcl06birzh1kpva0vzvw7xkdv4i84krv4z9f7lx5pyfm2cwq28" + }, + "rofi-emoji": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "Mange", + "repo": "rofi-emoji" + }, + "pre_releases": false, + "version_upper_bound": null, + "version": "v3.2.0", + "revision": "d07ba9ff3b1bd9daae043c297e65238be35b530f", + "url": "https://api.github.com/repos/Mange/rofi-emoji/tarball/v3.2.0", + "hash": "0pj44xx7lfysj2hsixcnv2zzzl4rg789f4cdwhiscw5218phgc1z" } }, "version": 3 diff --git a/patches/0002-patch-plugin-dir.patch b/patches/0002-patch-plugin-dir.patch new file mode 100644 index 0000000..eedd7a5 --- /dev/null +++ b/patches/0002-patch-plugin-dir.patch @@ -0,0 +1,25 @@ +From 0eaef67b683683fb423fcb2d5096b3cdf9a4a9cd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= +Date: Sun, 22 Mar 2020 12:26:10 +0100 +Subject: [PATCH] Patch plugindir to output + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 50edb74..639ee86 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -50,7 +50,7 @@ PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.40 gio-unix-2.0 gmodule-2.0 ]) + PKG_CHECK_MODULES([cairo], [cairo]) + PKG_CHECK_MODULES([rofi], [rofi >= 1.5.4]) + +-[rofi_PLUGIN_INSTALL_DIR]="`$PKG_CONFIG --variable=pluginsdir rofi`" ++[rofi_PLUGIN_INSTALL_DIR]="`echo $out/lib/rofi`" + AC_SUBST([rofi_PLUGIN_INSTALL_DIR]) + + LT_INIT([disable-static]) +-- +2.25.1 + diff --git a/pkgs/default.nix b/pkgs/default.nix index 23e8e6c..d905ae4 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -27,6 +27,8 @@ ani-cli = mkPackage ./ani-cli; rat = mkPackage ./rat; mov-cli = mkPackage ./mov-cli; + rofi-calc-wayland = mkPackage ./rofi-calc-wayland; + rofi-emoji-wayland = mkPackage ./rofi-emoji-wayland; # static packages # need manual intervention with each update diff --git a/pkgs/rofi-calc-wayland/default.nix b/pkgs/rofi-calc-wayland/default.nix new file mode 100644 index 0000000..ad884b7 --- /dev/null +++ b/pkgs/rofi-calc-wayland/default.nix @@ -0,0 +1,56 @@ +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, + pkg-config, + rofi-wayland-unwrapped, + libqalculate, + glib, + cairo, + gobject-introspection, + wrapGAppsHook, + pins, + ... +}: let + pin = pins.rofi-calc; +in + stdenv.mkDerivation { + pname = "rofi-calc-wayland"; + inherit (pin) version; + + src = fetchFromGitHub { + inherit (pin.repository) owner repo; + sha256 = pin.hash; + rev = pin.revision; + }; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + gobject-introspection + wrapGAppsHook + ]; + + buildInputs = [ + rofi-wayland-unwrapped + libqalculate + glib + cairo + ]; + + patches = [ + ../../patches/0002-patch-plugin-dir.patch + ]; + + postPatch = '' + sed "s|qalc_binary = \"qalc\"|qalc_binary = \"${libqalculate}/bin/qalc\"|" -i src/calc.c + ''; + + meta = with lib; { + description = "Do live calculations in rofi!"; + homepage = "https://github.com/svenstaro/rofi-calc"; + license = licenses.mit; + platforms = with platforms; linux; + }; + } diff --git a/pkgs/rofi-emoji-wayland/default.nix b/pkgs/rofi-emoji-wayland/default.nix new file mode 100644 index 0000000..ccc7dcc --- /dev/null +++ b/pkgs/rofi-emoji-wayland/default.nix @@ -0,0 +1,65 @@ +{ + stdenv, + lib, + fetchFromGitHub, + makeWrapper, + autoreconfHook, + pkg-config, + cairo, + glib, + libnotify, + rofi-wayland-unwrapped, + wl-clipboard, + wtype, + pins, + ... +}: let + pin = pins.rofi-emoji; +in + stdenv.mkDerivation { + pname = "rofi-emoji-wayland"; + inherit (pin) version; + + src = fetchFromGitHub { + inherit (pin.repository) owner repo; + sha256 = pin.hash; + rev = pin.revision; + }; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + makeWrapper + ]; + + buildInputs = [ + cairo + glib + libnotify + rofi-wayland-unwrapped + wl-clipboard + wtype + ]; + + patches = [ + ../../patches/0002-patch-plugin-dir.patch + ]; + + postPatch = '' + patchShebangs clipboard-adapter.sh + ''; + + postFixup = '' + chmod +x $out/share/rofi-emoji/clipboard-adapter.sh + wrapProgram $out/share/rofi-emoji/clipboard-adapter.sh \ + --prefix PATH ":" ${lib.makeBinPath [libnotify wl-clipboard wtype]} + ''; + + meta = { + description = "An emoji selector plugin for Rofi"; + homepage = "https://github.com/Mange/rofi-emoji"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [NotAShelf]; + platforms = lib.platforms.linux; + }; + }