Merge pull request #121378 from danieldk/1password-tarball

_1password-gui: 8.0.30 -> 8.0.33-53.BETA
This commit is contained in:
Daniël de Kok 2021-05-04 16:57:18 +02:00 committed by GitHub
commit b68211318a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 16 deletions

View File

@ -1,6 +1,6 @@
{ lib, stdenv { lib
, stdenv
, fetchurl , fetchurl
, appimageTools
, makeWrapper , makeWrapper
, electron_11 , electron_11
, openssl , openssl
@ -8,21 +8,15 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "1password"; pname = "1password";
version = "8.0.30"; version = "8.0.33-53.BETA";
src = fetchurl { src = fetchurl {
url = "https://onepassword.s3.amazonaws.com/linux/appimage/${pname}-${version}.AppImage"; url = "https://downloads.1password.com/linux/tar/beta/x86_64/1password-${version}.x64.tar.gz";
hash = "sha256-j+fp/f8nta+OOuOFU4mmUrGYlVmAqdaXO4rLJ0in+m8="; hash = "sha256-YUYER+UiM1QEDgGl0P9bIT65YVacUnuGtQVkV91teEU=";
}; };
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
appimageContents = appimageTools.extractType2 {
name = "${pname}-${version}";
inherit src;
};
dontUnpack = true;
dontConfigure = true; dontConfigure = true;
dontBuild = true; dontBuild = true;
@ -35,20 +29,33 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin $out/share/1password mkdir -p $out/bin $out/share/1password
# Applications files. # Applications files.
cp -a ${appimageContents}/{locales,resources} $out/share/${pname} cp -a {locales,resources} $out/share/${pname}
install -Dm0755 -t $out/share/${pname} {1Password-BrowserSupport,1Password-KeyringHelper}
# Desktop file. # Desktop file.
install -Dt $out/share/applications ${appimageContents}/${pname}.desktop install -Dt $out/share/applications resources/${pname}.desktop
substituteInPlace $out/share/applications/${pname}.desktop \ substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}' --replace 'Exec=/opt/1Password/${pname}' 'Exec=${pname}'
# Icons. # Icons.
cp -a ${appimageContents}/usr/share/icons $out/share cp -a resources/icons $out/share
# Wrap the application with Electron. # Wrap the application with Electron.
makeWrapper "${electron_11}/bin/electron" "$out/bin/${pname}" \ makeWrapper "${electron_11}/bin/electron" "$out/bin/${pname}" \
--add-flags "$out/share/${pname}/resources/app.asar" \ --add-flags "$out/share/${pname}/resources/app.asar" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}" --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}"
# Set the interpreter for the helper binaries and wrap them with
# the runtime libraries.
interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
patchelf --set-interpreter $interp \
$out/share/$pname/{1Password-BrowserSupport,1Password-KeyringHelper}
wrapProgram $out/share/${pname}/1Password-BrowserSupport \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}"
wrapProgram $out/share/${pname}/1Password-KeyringHelper \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}"
''; '';
passthru.updateScript = ./update.sh; passthru.updateScript = ./update.sh;

View File

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused common-updater-scripts #!nix-shell -i bash -p curl gnused common-updater-scripts
version="$(curl -sL https://onepassword.s3.amazonaws.com/linux/debian/dists/edge/main/binary-amd64/Packages | sed -r -n 's/^Version: (.*)-[0-9]+/\1/p' | head -n1)" version="$(curl -sL https://onepassword.s3.amazonaws.com/linux/debian/dists/edge/main/binary-amd64/Packages | sed -r -n 's/^Version: (.*)/\1/p' | head -n1)"
update-source-version _1password-gui "$version" update-source-version _1password-gui "$version"