From f2b6434843c418ecd4b4f19912d287d8518e2efd Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sun, 8 Jan 2023 22:28:48 +0100 Subject: [PATCH] pwsafe: add darwin support --- pkgs/applications/misc/pwsafe/default.nix | 27 +++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/misc/pwsafe/default.nix b/pkgs/applications/misc/pwsafe/default.nix index b1ce92086c6..25b69cf1561 100644 --- a/pkgs/applications/misc/pwsafe/default.nix +++ b/pkgs/applications/misc/pwsafe/default.nix @@ -19,9 +19,13 @@ , curl , openssl , file +, darwin , gitUpdater }: +let + inherit (darwin.apple_sdk.frameworks) Cocoa; +in stdenv.mkDerivation rec { pname = "pwsafe"; version = "1.16.0"; # do NOT update to 3.x Windows releases @@ -33,6 +37,8 @@ stdenv.mkDerivation rec { hash = "sha256-5/TOg+hiy22vlPJHheE638abhS3B5Jrul0Umgwu+gi0="; }; + strictDeps = true; + nativeBuildInputs = [ cmake gettext @@ -42,24 +48,29 @@ stdenv.mkDerivation rec { ]; buildInputs = [ + wxGTK32 + curl + qrencode + openssl + xercesc + file + ] ++ lib.optionals stdenv.isLinux [ libXext libXi libXt libXtst - wxGTK32 - curl - qrencode libuuid - openssl - xercesc libyubikey yubikey-personalization - file + ] ++ lib.optionals stdenv.isDarwin [ + Cocoa ]; cmakeFlags = [ "-DNO_GTEST=ON" "-DCMAKE_CXX_FLAGS=-I${yubikey-personalization}/include/ykpers-1" + ] ++ lib.optionals stdenv.isDarwin [ + "-DNO_YUBI=ON" ]; postPatch = '' @@ -79,6 +90,8 @@ stdenv.mkDerivation rec { for f in $(grep -Rl /usr/bin/ .) ; do substituteInPlace $f --replace /usr/bin/ "" done + '' + lib.optionalString stdenv.isDarwin '' + substituteInPlace src/ui/cli/CMakeLists.txt --replace "uuid" "" ''; installFlags = [ "PREFIX=${placeholder "out"}" ]; @@ -99,7 +112,7 @@ stdenv.mkDerivation rec { ''; homepage = "https://pwsafe.org/"; maintainers = with maintainers; [ c0bw3b pjones ]; - platforms = platforms.linux; + platforms = platforms.unix; license = licenses.artistic2; }; }