mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
Merge pull request #327189 from NixOS/1pwd_darwin-broken
This commit is contained in:
commit
da8fd5be9f
@ -1,16 +1,25 @@
|
||||
{ stdenv
|
||||
, pname
|
||||
, version
|
||||
, src
|
||||
, meta
|
||||
, unzip
|
||||
, undmg
|
||||
{
|
||||
stdenv,
|
||||
pname,
|
||||
version,
|
||||
src,
|
||||
meta,
|
||||
unzip,
|
||||
undmg,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
inherit pname version src meta;
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
src
|
||||
meta
|
||||
;
|
||||
|
||||
nativeBuildInputs = [ unzip undmg ];
|
||||
nativeBuildInputs = [
|
||||
unzip
|
||||
undmg
|
||||
];
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
|
@ -1,13 +1,14 @@
|
||||
{ stdenv
|
||||
, callPackage
|
||||
, channel ? "stable"
|
||||
, fetchurl
|
||||
, lib
|
||||
# This is only relevant for Linux, so we need to pass it through
|
||||
, polkitPolicyOwners ? [ ] }:
|
||||
{
|
||||
stdenv,
|
||||
callPackage,
|
||||
channel ? "stable",
|
||||
fetchurl,
|
||||
lib,
|
||||
# This is only relevant for Linux, so we need to pass it through
|
||||
polkitPolicyOwners ? [ ],
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
pname = "1password";
|
||||
version = if channel == "stable" then "8.10.36" else "8.10.38-13.BETA";
|
||||
|
||||
@ -51,19 +52,46 @@ let
|
||||
};
|
||||
|
||||
src = fetchurl {
|
||||
inherit (sources.${channel}.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}")) url hash;
|
||||
inherit
|
||||
(sources.${channel}.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"))
|
||||
url
|
||||
hash
|
||||
;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
# Requires to be installed in "/Application" which is not possible for now (https://github.com/NixOS/nixpkgs/issues/254944)
|
||||
broken = stdenv.isDarwin;
|
||||
description = "Multi-platform password manager";
|
||||
homepage = "https://1password.com/";
|
||||
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
||||
license = licenses.unfree;
|
||||
maintainers = with maintainers; [ timstott savannidgerinel sebtm ];
|
||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
||||
license = lib.licenses.unfree;
|
||||
maintainers = with lib.maintainers; [
|
||||
timstott
|
||||
savannidgerinel
|
||||
sebtm
|
||||
];
|
||||
platforms = builtins.attrNames sources.${channel};
|
||||
mainProgram = "1password";
|
||||
};
|
||||
|
||||
in if stdenv.isDarwin
|
||||
then callPackage ./darwin.nix { inherit pname version src meta; }
|
||||
else callPackage ./linux.nix { inherit pname version src meta polkitPolicyOwners; }
|
||||
in
|
||||
if stdenv.isDarwin then
|
||||
callPackage ./darwin.nix {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
src
|
||||
meta
|
||||
;
|
||||
}
|
||||
else
|
||||
callPackage ./linux.nix {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
src
|
||||
meta
|
||||
polkitPolicyOwners
|
||||
;
|
||||
}
|
||||
|
@ -1,55 +1,65 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, pname
|
||||
, version
|
||||
, src
|
||||
, meta
|
||||
, makeShellWrapper
|
||||
, wrapGAppsHook3
|
||||
, alsa-lib
|
||||
, at-spi2-atk
|
||||
, at-spi2-core
|
||||
, atk
|
||||
, cairo
|
||||
, cups
|
||||
, dbus
|
||||
, expat
|
||||
, gdk-pixbuf
|
||||
, glib
|
||||
, gtk3
|
||||
, libX11
|
||||
, libXcomposite
|
||||
, libXdamage
|
||||
, libXext
|
||||
, libXfixes
|
||||
, libXrandr
|
||||
, libdrm
|
||||
, libxcb
|
||||
, libxkbcommon
|
||||
, libxshmfence
|
||||
, libGL
|
||||
, libappindicator-gtk3
|
||||
, mesa
|
||||
, nspr
|
||||
, nss
|
||||
, pango
|
||||
, systemd
|
||||
, udev
|
||||
, xdg-utils
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
pname,
|
||||
version,
|
||||
src,
|
||||
meta,
|
||||
makeShellWrapper,
|
||||
wrapGAppsHook3,
|
||||
alsa-lib,
|
||||
at-spi2-atk,
|
||||
at-spi2-core,
|
||||
atk,
|
||||
cairo,
|
||||
cups,
|
||||
dbus,
|
||||
expat,
|
||||
gdk-pixbuf,
|
||||
glib,
|
||||
gtk3,
|
||||
libX11,
|
||||
libXcomposite,
|
||||
libXdamage,
|
||||
libXext,
|
||||
libXfixes,
|
||||
libXrandr,
|
||||
libdrm,
|
||||
libxcb,
|
||||
libxkbcommon,
|
||||
libxshmfence,
|
||||
libGL,
|
||||
libappindicator-gtk3,
|
||||
mesa,
|
||||
nspr,
|
||||
nss,
|
||||
pango,
|
||||
systemd,
|
||||
udev,
|
||||
xdg-utils,
|
||||
|
||||
# The 1Password polkit file requires a list of users for whom polkit
|
||||
# integrations should be enabled. This should be a list of strings that
|
||||
# correspond to usernames.
|
||||
, polkitPolicyOwners ? []
|
||||
polkitPolicyOwners ? [ ],
|
||||
}:
|
||||
let
|
||||
# Convert the polkitPolicyOwners variable to a polkit-compatible string for the polkit file.
|
||||
policyOwners = lib.concatStringsSep " " (map (user: "unix-user:${user}") polkitPolicyOwners);
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
inherit pname version src meta;
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
src
|
||||
meta
|
||||
;
|
||||
|
||||
nativeBuildInputs = [ makeShellWrapper wrapGAppsHook3 ];
|
||||
nativeBuildInputs = [
|
||||
makeShellWrapper
|
||||
wrapGAppsHook3
|
||||
];
|
||||
buildInputs = [ glib ];
|
||||
|
||||
dontConfigure = true;
|
||||
@ -58,37 +68,41 @@ in stdenv.mkDerivation {
|
||||
dontWrapGApps = true;
|
||||
|
||||
installPhase =
|
||||
let rpath = lib.makeLibraryPath [
|
||||
alsa-lib
|
||||
at-spi2-atk
|
||||
at-spi2-core
|
||||
atk
|
||||
cairo
|
||||
cups
|
||||
dbus
|
||||
expat
|
||||
gdk-pixbuf
|
||||
glib
|
||||
gtk3
|
||||
libX11
|
||||
libXcomposite
|
||||
libXdamage
|
||||
libXext
|
||||
libXfixes
|
||||
libXrandr
|
||||
libdrm
|
||||
libxcb
|
||||
libxkbcommon
|
||||
libxshmfence
|
||||
libGL
|
||||
libappindicator-gtk3
|
||||
mesa
|
||||
nspr
|
||||
nss
|
||||
pango
|
||||
systemd
|
||||
] + ":${stdenv.cc.cc.lib}/lib64";
|
||||
in ''
|
||||
let
|
||||
rpath =
|
||||
lib.makeLibraryPath [
|
||||
alsa-lib
|
||||
at-spi2-atk
|
||||
at-spi2-core
|
||||
atk
|
||||
cairo
|
||||
cups
|
||||
dbus
|
||||
expat
|
||||
gdk-pixbuf
|
||||
glib
|
||||
gtk3
|
||||
libX11
|
||||
libXcomposite
|
||||
libXdamage
|
||||
libXext
|
||||
libXfixes
|
||||
libXrandr
|
||||
libdrm
|
||||
libxcb
|
||||
libxkbcommon
|
||||
libxshmfence
|
||||
libGL
|
||||
libappindicator-gtk3
|
||||
mesa
|
||||
nspr
|
||||
nss
|
||||
pango
|
||||
systemd
|
||||
]
|
||||
+ ":${stdenv.cc.cc.lib}/lib64";
|
||||
in
|
||||
''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin $out/share/1password
|
||||
@ -99,12 +113,13 @@ in stdenv.mkDerivation {
|
||||
substituteInPlace $out/share/applications/${pname}.desktop \
|
||||
--replace 'Exec=/opt/1Password/${pname}' 'Exec=${pname}'
|
||||
|
||||
'' + (lib.optionalString (polkitPolicyOwners != [ ])
|
||||
''
|
||||
''
|
||||
+ (lib.optionalString (polkitPolicyOwners != [ ]) ''
|
||||
# Polkit file
|
||||
mkdir -p $out/share/polkit-1/actions
|
||||
substitute com.1password.1Password.policy.tpl $out/share/polkit-1/actions/com.1password.1Password.policy --replace "\''${POLICY_OWNERS}" "${policyOwners}"
|
||||
'') + ''
|
||||
'')
|
||||
+ ''
|
||||
|
||||
# Icons
|
||||
cp -a resources/icons $out/share
|
||||
|
Loading…
Reference in New Issue
Block a user