Skip to content

Commit

Permalink
1password-gui: fix crash opening file selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Enzime committed Sep 28, 2022
1 parent 3b5ee8a commit 4aaa0a8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
25 changes: 16 additions & 9 deletions pkgs/applications/misc/1password-gui/beta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, stdenv
, fetchurl
, makeWrapper
, wrapGAppsHook
, alsa-lib
, at-spi2-atk
, at-spi2-core
Expand Down Expand Up @@ -58,11 +59,13 @@ in stdenv.mkDerivation rec {
sha256 = "0vqrcwn5y350g91w3kh8n43gw21kck1cwim92dw9i0xxxch91hrg";
};

nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
buildInputs = [ glib ];

dontConfigure = true;
dontBuild = true;
dontPatchELF = true;
dontWrapGApps = true;

installPhase =
let rpath = lib.makeLibraryPath [
Expand Down Expand Up @@ -123,17 +126,21 @@ in stdenv.mkDerivation rec {
patchelf --set-rpath ${rpath}:$out/share/1password $file
done
# Electron is trying to open udev via dlopen()
# and for some reason that doesn't seem to be impacted from the rpath.
# Adding udev to LD_LIBRARY_PATH fixes that.
# Make xdg-open overrideable at runtime.
makeWrapper $out/share/1password/1password $out/bin/1password \
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]}
runHook postInstall
'';

preFixup = ''
# Electron is trying to open udev via dlopen()
# and for some reason that doesn't seem to be impacted from the rpath.
# Adding udev to LD_LIBRARY_PATH fixes that.
# Make xdg-open overrideable at runtime.
makeWrapper $out/share/1password/1password $out/bin/1password \
''${gappsWrapperArgs[@]} \
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]}
'';


meta = with lib; {
description = "Multi-platform password manager";
homepage = "https://1password.com/";
Expand Down
24 changes: 15 additions & 9 deletions pkgs/applications/misc/1password-gui/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, stdenv
, fetchurl
, makeWrapper
, wrapGAppsHook
, alsa-lib
, at-spi2-atk
, at-spi2-core
Expand Down Expand Up @@ -58,11 +59,13 @@ in stdenv.mkDerivation rec {
sha256 = "1rcvxxcz2q7kgf6qbcjnjhysnx9z81hvl0jfv0nkp0p1w8bf1h66";
};

nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
buildInputs = [ glib ];

dontConfigure = true;
dontBuild = true;
dontPatchELF = true;
dontWrapGApps = true;

installPhase =
let rpath = lib.makeLibraryPath [
Expand Down Expand Up @@ -123,17 +126,20 @@ in stdenv.mkDerivation rec {
patchelf --set-rpath ${rpath}:$out/share/1password $file
done
# Electron is trying to open udev via dlopen()
# and for some reason that doesn't seem to be impacted from the rpath.
# Adding udev to LD_LIBRARY_PATH fixes that.
# Make xdg-open overrideable at runtime.
makeWrapper $out/share/1password/1password $out/bin/1password \
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]}
runHook postInstall
'';

preFixup = ''
# Electron is trying to open udev via dlopen()
# and for some reason that doesn't seem to be impacted from the rpath.
# Adding udev to LD_LIBRARY_PATH fixes that.
# Make xdg-open overrideable at runtime.
makeWrapper $out/share/1password/1password $out/bin/1password \
''${gappsWrapperArgs[@]} \
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]}
'';

meta = with lib; {
description = "Multi-platform password manager";
homepage = "https://1password.com/";
Expand Down

0 comments on commit 4aaa0a8

Please sign in to comment.