pwsafe: add darwin support

This commit is contained in:
Weijia Wang 2023-01-08 22:28:48 +01:00
parent 85be954926
commit f2b6434843

View file

@ -19,9 +19,13 @@
, curl , curl
, openssl , openssl
, file , file
, darwin
, gitUpdater , gitUpdater
}: }:
let
inherit (darwin.apple_sdk.frameworks) Cocoa;
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "pwsafe"; pname = "pwsafe";
version = "1.16.0"; # do NOT update to 3.x Windows releases 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="; hash = "sha256-5/TOg+hiy22vlPJHheE638abhS3B5Jrul0Umgwu+gi0=";
}; };
strictDeps = true;
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
gettext gettext
@ -42,24 +48,29 @@ stdenv.mkDerivation rec {
]; ];
buildInputs = [ buildInputs = [
wxGTK32
curl
qrencode
openssl
xercesc
file
] ++ lib.optionals stdenv.isLinux [
libXext libXext
libXi libXi
libXt libXt
libXtst libXtst
wxGTK32
curl
qrencode
libuuid libuuid
openssl
xercesc
libyubikey libyubikey
yubikey-personalization yubikey-personalization
file ] ++ lib.optionals stdenv.isDarwin [
Cocoa
]; ];
cmakeFlags = [ cmakeFlags = [
"-DNO_GTEST=ON" "-DNO_GTEST=ON"
"-DCMAKE_CXX_FLAGS=-I${yubikey-personalization}/include/ykpers-1" "-DCMAKE_CXX_FLAGS=-I${yubikey-personalization}/include/ykpers-1"
] ++ lib.optionals stdenv.isDarwin [
"-DNO_YUBI=ON"
]; ];
postPatch = '' postPatch = ''
@ -79,6 +90,8 @@ stdenv.mkDerivation rec {
for f in $(grep -Rl /usr/bin/ .) ; do for f in $(grep -Rl /usr/bin/ .) ; do
substituteInPlace $f --replace /usr/bin/ "" substituteInPlace $f --replace /usr/bin/ ""
done done
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace src/ui/cli/CMakeLists.txt --replace "uuid" ""
''; '';
installFlags = [ "PREFIX=${placeholder "out"}" ]; installFlags = [ "PREFIX=${placeholder "out"}" ];
@ -99,7 +112,7 @@ stdenv.mkDerivation rec {
''; '';
homepage = "https://pwsafe.org/"; homepage = "https://pwsafe.org/";
maintainers = with maintainers; [ c0bw3b pjones ]; maintainers = with maintainers; [ c0bw3b pjones ];
platforms = platforms.linux; platforms = platforms.unix;
license = licenses.artistic2; license = licenses.artistic2;
}; };
} }