From 3e2fd6595391975b097cdb9672e0acf256ac1bc8 Mon Sep 17 00:00:00 2001 From: j-hui Date: Sat, 7 Aug 2021 22:35:36 -0400 Subject: [PATCH 1/4] vieb: Use autoPatchelfHook for 7z binary Attempt at fixing NixOS/nixpkgs#133077. Patched 7z binary works, but Vieb browser still unable to install extensions. --- pkgs/applications/networking/browsers/vieb/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/vieb/default.nix b/pkgs/applications/networking/browsers/vieb/default.nix index f97e8d8250e7..606253b1e0f2 100644 --- a/pkgs/applications/networking/browsers/vieb/default.nix +++ b/pkgs/applications/networking/browsers/vieb/default.nix @@ -1,4 +1,4 @@ -{ mkYarnPackage, fetchFromGitHub, electron, makeWrapper, makeDesktopItem, lib }: +{ mkYarnPackage, fetchFromGitHub, electron, makeWrapper, makeDesktopItem, lib, autoPatchelfHook, stdenv }: mkYarnPackage rec { pname = "vieb"; @@ -16,7 +16,7 @@ mkYarnPackage rec { yarnNix = ./yarn.nix; yarnFlags = [ "--production" "--offline" ]; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ makeWrapper autoPatchelfHook stdenv.cc.cc.lib ]; desktopItem = makeDesktopItem { name = "vieb"; From 2a6c2b4a1b2535fe06c5a6d4f46c3e941f0d0c61 Mon Sep 17 00:00:00 2001 From: j-hui Date: Sun, 8 Aug 2021 11:54:54 -0400 Subject: [PATCH 2/4] vieb: fix internal node_modules structure Vieb's source code manually constructs the path the 7z binary using a relative path. This breaks because vieb is running under libexec/vieb/deps/vieb (and expects 7z to be inside libexec/vieb/deps/vieb/node_modules), whereas the actual binary is in libexec/vieb/node_modules). We fix this with a symlink. --- pkgs/applications/networking/browsers/vieb/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/networking/browsers/vieb/default.nix b/pkgs/applications/networking/browsers/vieb/default.nix index 606253b1e0f2..d9a250759867 100644 --- a/pkgs/applications/networking/browsers/vieb/default.nix +++ b/pkgs/applications/networking/browsers/vieb/default.nix @@ -34,6 +34,9 @@ mkYarnPackage rec { }; postInstall = '' + unlink $out/libexec/vieb/deps/vieb/node_modules + ln -s $out/libexec/vieb/node_modules $out/libexec/vieb/deps/vieb/node_modules + install -Dm0644 {${desktopItem},$out}/share/applications/vieb.desktop pushd $out/libexec/vieb/node_modules/vieb/app/img/icons From 8da786e9f8fbdf97a22d3c16643e1f99221a3cfa Mon Sep 17 00:00:00 2001 From: j-hui Date: Sun, 8 Aug 2021 14:22:18 -0400 Subject: [PATCH 3/4] nixos: symlink to p7zip instead of using patchelf --- pkgs/applications/networking/browsers/vieb/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/vieb/default.nix b/pkgs/applications/networking/browsers/vieb/default.nix index d9a250759867..25d82d0b7e27 100644 --- a/pkgs/applications/networking/browsers/vieb/default.nix +++ b/pkgs/applications/networking/browsers/vieb/default.nix @@ -1,4 +1,4 @@ -{ mkYarnPackage, fetchFromGitHub, electron, makeWrapper, makeDesktopItem, lib, autoPatchelfHook, stdenv }: +{ mkYarnPackage, fetchFromGitHub, electron, makeWrapper, makeDesktopItem, lib, p7zip }: mkYarnPackage rec { pname = "vieb"; @@ -16,7 +16,7 @@ mkYarnPackage rec { yarnNix = ./yarn.nix; yarnFlags = [ "--production" "--offline" ]; - nativeBuildInputs = [ makeWrapper autoPatchelfHook stdenv.cc.cc.lib ]; + nativeBuildInputs = [ makeWrapper ]; desktopItem = makeDesktopItem { name = "vieb"; @@ -37,6 +37,8 @@ mkYarnPackage rec { unlink $out/libexec/vieb/deps/vieb/node_modules ln -s $out/libexec/vieb/node_modules $out/libexec/vieb/deps/vieb/node_modules + find $out/libexec/vieb/node_modules/7zip-bin -name 7za -exec ln -s -f ${p7zip}/bin/7z {} ';' + install -Dm0644 {${desktopItem},$out}/share/applications/vieb.desktop pushd $out/libexec/vieb/node_modules/vieb/app/img/icons From 6ed50f7dbf1e7fcd9ec74285de4b1cbdd5398c2f Mon Sep 17 00:00:00 2001 From: j-hui Date: Sun, 8 Aug 2021 15:02:52 -0400 Subject: [PATCH 4/4] vieb: Use 7za instead of 7z --- pkgs/applications/networking/browsers/vieb/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/browsers/vieb/default.nix b/pkgs/applications/networking/browsers/vieb/default.nix index 25d82d0b7e27..8853ec46d1e8 100644 --- a/pkgs/applications/networking/browsers/vieb/default.nix +++ b/pkgs/applications/networking/browsers/vieb/default.nix @@ -37,7 +37,7 @@ mkYarnPackage rec { unlink $out/libexec/vieb/deps/vieb/node_modules ln -s $out/libexec/vieb/node_modules $out/libexec/vieb/deps/vieb/node_modules - find $out/libexec/vieb/node_modules/7zip-bin -name 7za -exec ln -s -f ${p7zip}/bin/7z {} ';' + find $out/libexec/vieb/node_modules/7zip-bin -name 7za -exec ln -s -f ${p7zip}/bin/7za {} ';' install -Dm0644 {${desktopItem},$out}/share/applications/vieb.desktop