From b993479ada76fd3081926dba591190399e70ae09 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 7 Aug 2023 03:10:02 +0000 Subject: [PATCH] sxmo-utils: use busybox --- .../sxmo-utils/0004-no-busybox.patch | 24 ------------------- pkgs/additional/sxmo-utils/default.nix | 21 +++++++++------- 2 files changed, 13 insertions(+), 32 deletions(-) delete mode 100644 pkgs/additional/sxmo-utils/0004-no-busybox.patch diff --git a/pkgs/additional/sxmo-utils/0004-no-busybox.patch b/pkgs/additional/sxmo-utils/0004-no-busybox.patch deleted file mode 100644 index 2d0634fb..00000000 --- a/pkgs/additional/sxmo-utils/0004-no-busybox.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/setup_config_version.sh b/setup_config_version.sh -index fde40c1..6386014 100755 ---- a/setup_config_version.sh -+++ b/setup_config_version.sh -@@ -8,7 +8,7 @@ case "$1" in - exit - esac - --case "$(busybox head -n1 "$1")" in -+case "$(head -n1 "$1")" in - "#"*) - comment="#" - ;; -@@ -23,7 +23,7 @@ case "$(busybox head -n1 "$1")" in - ;; - esac - --busybox md5sum "$1" | \ -- busybox cut -d" " -f1 | \ -- busybox xargs -I{} busybox sed -i "2i$comment configversion: {}" \ -+md5sum "$1" | \ -+ cut -d" " -f1 | \ -+ xargs -I{} sed -i "2i$comment configversion: {}" \ - "$1" diff --git a/pkgs/additional/sxmo-utils/default.nix b/pkgs/additional/sxmo-utils/default.nix index 12c4c1bf..47d386c1 100644 --- a/pkgs/additional/sxmo-utils/default.nix +++ b/pkgs/additional/sxmo-utils/default.nix @@ -2,6 +2,8 @@ , bc , bemenu , bonsai +, buildPackages +, busybox , conky , coreutils , dbus @@ -40,13 +42,14 @@ let # anything which any sxmo script or default hook in this package might invoke runtimeDeps = [ - bc + # bc # busybox bemenu bonsai + busybox # sxmo targets busybox, which differs from non-busybox utilities in subtle ways (e.g. `pidof` behavior) conky dbus # dmenu # or dmenu-wayland? only used on x11? - gnugrep + # gnugrep # busybox gojq grim inotify-tools @@ -106,7 +109,6 @@ stdenv.mkDerivation rec { url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42880/mbox"; hash = "sha256-tAMPBb6vwzj1dFMTEaqrcCJU6FbQirwZgB0+tqW3rQA="; }) - ./0004-no-busybox.patch # wanted to fix/silence some non-fatal errors ./0005-system-audio.patch ./0007-workspace-wrapping.patch @@ -160,11 +162,14 @@ stdenv.mkDerivation rec { scdoc ]; - installFlags = [ - "OPENRC=0" - "DESTDIR=$(out)" - "PREFIX=" - ]; + installPhase = '' + runHook preInstall + + # busybox is used by setup_config_version.sh, but placing it in nativeBuildInputs breaks the nix builder + PATH="$PATH:${buildPackages.busybox}/bin" make OPENRC=0 DESTDIR=$out PREFIX= install + + runHook postInstall + ''; # we don't wrap sxmo_common.sh or sxmo_init.sh # which is unfortunate, for non-sxmo-utils files that might source though.