From 577129cb1c7e28417bfe1066800f4e55de9fc7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 29 May 2025 22:49:23 +0200 Subject: [PATCH] frobar: Better building method --- hm/desktop/frobar/default.nix | 40 ++++++++++++++++++++++++----------- hm/desktop/frobar/setup.py | 2 +- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/hm/desktop/frobar/default.nix b/hm/desktop/frobar/default.nix index 180e58f..ec61076 100644 --- a/hm/desktop/frobar/default.nix +++ b/hm/desktop/frobar/default.nix @@ -1,4 +1,5 @@ { + # nixpkgs ? , # nixpkgs ? builtins.getFlake "github:GeoffreyFrogeye/nixpkgs/zelbar", nixpkgs ? /nix/store/8g86qw3c2fr56bhhvqznrlic4jig9hb3-source, pkgs ? import nixpkgs { @@ -9,29 +10,44 @@ }: # Tried using pyproject.nix but mpd2 dependency wouldn't resolve, # is called pyton-mpd2 on PyPi but mpd2 in nixpkgs. -pkgs.python3Packages.buildPythonApplication rec { +pkgs.python3Packages.buildPythonPackage rec { pname = "frobar"; - version = "3.0"; + version = "3.1"; - propagatedBuildInputs = with pkgs.python3Packages; [ + dependencies = with pkgs.python3Packages; [ i3ipc psutil pulsectl-asyncio pygobject3 rich ]; - # TODO Might just be buildInputs, maybe without the need for prefix? + nativeBuildInputs = with pkgs; [ - wirelesstools - playerctl - zelbar - ]; - makeWrapperArgs = [ - "--prefix PATH : ${pkgs.lib.makeBinPath nativeBuildInputs}" - "--prefix GI_TYPELIB_PATH : ${GI_TYPELIB_PATH}" + wrapGAppsHook4 + gobject-introspection ]; - GI_TYPELIB_PATH = pkgs.lib.makeSearchPath "lib/girepository-1.0" [ + buildInputs = with pkgs; [ + playerctl + ]; + + preFixup = '' + makeWrapperArgs+=( + ''${gappsWrapperArgs[@]} + --prefix PATH : ${ + pkgs.lib.makeBinPath ( + with pkgs; + [ + wirelesstools + zelbar + ] + ) + } + --prefix LD_LIBRARY_PATH : ${LD_LIBRARY_PATH} + ) + ''; + + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.glib.out pkgs.playerctl ]; diff --git a/hm/desktop/frobar/setup.py b/hm/desktop/frobar/setup.py index 8528d03..7bd880a 100644 --- a/hm/desktop/frobar/setup.py +++ b/hm/desktop/frobar/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name="frobar", - version="3.0", + version="3.1", install_requires=[ "i3ipc", "psutil",