From 31a6982b2bc66f878e212d7d18ab6feb6febfadc Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 13 Jun 2024 10:23:59 -0500 Subject: [PATCH 1/3] btrfs-assistant: fix nix-shell -p --- pkgs/by-name/bt/btrfs-assistant/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/bt/btrfs-assistant/package.nix b/pkgs/by-name/bt/btrfs-assistant/package.nix index f461d67b6f78..aa94ec1592f9 100644 --- a/pkgs/by-name/bt/btrfs-assistant/package.nix +++ b/pkgs/by-name/bt/btrfs-assistant/package.nix @@ -29,6 +29,7 @@ stdenv.mkDerivation (finalAttrs: { cmake git pkg-config + qt6.wrapQtAppsHook ]; buildInputs = [ @@ -39,7 +40,6 @@ stdenv.mkDerivation (finalAttrs: { qt6.qtwayland ]; - propagatedBuildInputs = [ qt6.wrapQtAppsHook ]; prePatch = '' substituteInPlace src/util/System.cpp \ From dc2ccabad299702aac8c9b53798669f5651f60f6 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 13 Jun 2024 19:05:28 -0500 Subject: [PATCH 2/3] btrfs-assistant: fix runtime errors --- pkgs/by-name/bt/btrfs-assistant/package.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/bt/btrfs-assistant/package.nix b/pkgs/by-name/bt/btrfs-assistant/package.nix index aa94ec1592f9..3be7b54d5e8c 100644 --- a/pkgs/by-name/bt/btrfs-assistant/package.nix +++ b/pkgs/by-name/bt/btrfs-assistant/package.nix @@ -34,16 +34,21 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ btrfs-progs + coreutils qt6.qtbase qt6.qtsvg qt6.qttools qt6.qtwayland - ]; + util-linux + ] ++ lib.optionals enableSnapper [ snapper ]; prePatch = '' substituteInPlace src/util/System.cpp \ --replace '/bin/bash' "${lib.getExe bash}" + + substituteInPlace src/main.cpp \ + --replace-fail 'if (!qEnvironmentVariableIsEmpty("DISPLAY"))' ' if(!qEnvironmentVariableIsEmpty("DISPLAY") || !qEnvironmentVariableIsEmpty("WAYLAND_DISPLAY"))' '' + lib.optionalString enableSnapper '' substituteInPlace src/main.cpp \ From 976a8edb68d1450a2b1503aa430454c8702384d5 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 13 Jun 2024 19:08:23 -0500 Subject: [PATCH 3/3] btrfs-assistant: cleanup --- pkgs/by-name/bt/btrfs-assistant/package.nix | 88 +++++++++------------ 1 file changed, 39 insertions(+), 49 deletions(-) diff --git a/pkgs/by-name/bt/btrfs-assistant/package.nix b/pkgs/by-name/bt/btrfs-assistant/package.nix index 3be7b54d5e8c..fce0bd8fc6eb 100644 --- a/pkgs/by-name/bt/btrfs-assistant/package.nix +++ b/pkgs/by-name/bt/btrfs-assistant/package.nix @@ -1,17 +1,18 @@ -{ lib -, stdenv -, fetchFromGitLab -, bash -, btrfs-progs -, cmake -, coreutils -, git -, pkg-config -, qt6 -, snapper -, util-linux -, enableSnapper ? true -, nix-update-script +{ + lib, + stdenv, + fetchFromGitLab, + bash, + btrfs-progs, + cmake, + coreutils, + git, + pkg-config, + qt6, + snapper, + util-linux, + enableSnapper ? true, + nix-update-script, }: stdenv.mkDerivation (finalAttrs: { @@ -42,45 +43,34 @@ stdenv.mkDerivation (finalAttrs: { util-linux ] ++ lib.optionals enableSnapper [ snapper ]; + prePatch = + '' + substituteInPlace src/util/System.cpp \ + --replace-fail '/bin/bash' "${lib.getExe bash}" - prePatch = '' - substituteInPlace src/util/System.cpp \ - --replace '/bin/bash' "${lib.getExe bash}" + substituteInPlace src/main.cpp \ + --replace-fail 'if (!qEnvironmentVariableIsEmpty("DISPLAY"))' ' if(!qEnvironmentVariableIsEmpty("DISPLAY") || !qEnvironmentVariableIsEmpty("WAYLAND_DISPLAY"))' + '' + + lib.optionalString enableSnapper '' + substituteInPlace src/main.cpp \ + --replace-fail '/usr/bin/snapper' "${lib.getExe snapper}" + ''; - substituteInPlace src/main.cpp \ - --replace-fail 'if (!qEnvironmentVariableIsEmpty("DISPLAY"))' ' if(!qEnvironmentVariableIsEmpty("DISPLAY") || !qEnvironmentVariableIsEmpty("WAYLAND_DISPLAY"))' - '' - + lib.optionalString enableSnapper '' - substituteInPlace src/main.cpp \ - --replace '/usr/bin/snapper' "${lib.getExe snapper}" - ''; + postPatch = + '' + substituteInPlace src/org.btrfs-assistant.pkexec.policy \ + --replace-fail '/usr/bin' "$out/bin" - postPatch = '' - substituteInPlace src/org.btrfs-assistant.pkexec.policy \ - --replace '/usr/bin' "$out/bin" + substituteInPlace src/btrfs-assistant \ + --replace-fail 'btrfs-assistant-bin' "$out/bin/btrfs-assistant-bin" - substituteInPlace src/btrfs-assistant \ - --replace 'btrfs-assistant-bin' "$out/bin/btrfs-assistant-bin" - - substituteInPlace src/btrfs-assistant-launcher \ - --replace 'btrfs-assistant' "$out/bin/btrfs-assistant" - '' - + lib.optionalString enableSnapper '' - substituteInPlace src/btrfs-assistant.conf \ - --replace '/usr/bin/snapper' "${lib.getExe snapper}" - ''; - - qtWrapperArgs = - let - runtimeDeps = lib.makeBinPath ([ - coreutils - util-linux - ] - ++ lib.optionals enableSnapper [ snapper ]); - in - [ - "--prefix PATH : ${runtimeDeps}" - ]; + substituteInPlace src/btrfs-assistant-launcher \ + --replace-fail 'btrfs-assistant' "$out/bin/btrfs-assistant" + '' + + lib.optionalString enableSnapper '' + substituteInPlace src/btrfs-assistant.conf \ + --replace-fail '/usr/bin/snapper' "${lib.getExe snapper}" + ''; passthru.updateScript = nix-update-script { };