2022-11-27 09:42:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, zip
|
|
|
|
, gettext
|
|
|
|
, perl
|
2023-01-11 07:51:40 +00:00
|
|
|
, wxGTK32
|
2022-11-27 09:42:12 +00:00
|
|
|
, libXext
|
|
|
|
, libXi
|
|
|
|
, libXt
|
|
|
|
, libXtst
|
|
|
|
, xercesc
|
|
|
|
, qrencode
|
|
|
|
, libuuid
|
|
|
|
, libyubikey
|
|
|
|
, yubikey-personalization
|
|
|
|
, curl
|
|
|
|
, openssl
|
|
|
|
, file
|
2023-01-20 10:41:00 +00:00
|
|
|
, darwin
|
2022-11-27 09:42:12 +00:00
|
|
|
, gitUpdater
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
let
|
|
|
|
inherit (darwin.apple_sdk.frameworks) Cocoa;
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pwsafe";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.18.0"; # do NOT update to 3.x Windows releases
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2020-11-03 02:18:15 +00:00
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-2n3JJ/DPhJpNOyviYpqQQl83IAZnmnH5w7b/pOGU8K8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
nativeBuildInputs = [
|
2022-11-27 09:42:12 +00:00
|
|
|
cmake
|
|
|
|
gettext
|
|
|
|
perl
|
|
|
|
pkg-config
|
2024-07-31 10:19:44 +00:00
|
|
|
wxGTK32
|
2022-11-27 09:42:12 +00:00
|
|
|
zip
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2022-11-27 09:42:12 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2023-01-11 07:51:40 +00:00
|
|
|
wxGTK32
|
2022-11-27 09:42:12 +00:00
|
|
|
curl
|
|
|
|
qrencode
|
|
|
|
openssl
|
|
|
|
xercesc
|
2023-01-20 10:41:00 +00:00
|
|
|
file
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
libXext
|
|
|
|
libXi
|
|
|
|
libXt
|
|
|
|
libXtst
|
|
|
|
libuuid
|
2022-11-27 09:42:12 +00:00
|
|
|
libyubikey
|
|
|
|
yubikey-personalization
|
2023-01-20 10:41:00 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
Cocoa
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DNO_GTEST=ON"
|
|
|
|
"-DCMAKE_CXX_FLAGS=-I${yubikey-personalization}/include/ykpers-1"
|
2023-01-20 10:41:00 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DNO_YUBI=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Fix perl scripts used during the build.
|
2021-12-26 17:43:05 +00:00
|
|
|
for f in $(find . -type f -name '*.pl') ; do
|
2020-04-24 23:36:52 +00:00
|
|
|
patchShebangs $f
|
|
|
|
done
|
|
|
|
|
|
|
|
# Fix hard coded paths.
|
2022-01-13 20:06:32 +00:00
|
|
|
for f in $(grep -Rl /usr/share/ src install/desktop) ; do
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace $f --replace /usr/share/ $out/share/
|
|
|
|
done
|
|
|
|
|
|
|
|
# Fix hard coded zip path.
|
|
|
|
substituteInPlace help/Makefile.linux --replace /usr/bin/zip ${zip}/bin/zip
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
for f in $(grep -Rl /usr/bin/ .) ; do
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace $f --replace /usr/bin/ ""
|
|
|
|
done
|
2023-01-20 10:41:00 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace src/ui/cli/CMakeLists.txt --replace "uuid" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installFlags = [ "PREFIX=${placeholder "out"}" ];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
passthru.updateScript = gitUpdater {
|
2024-07-01 15:47:52 +00:00
|
|
|
allowedVersions = "^1\\.";
|
2022-09-09 14:08:57 +00:00
|
|
|
url = src.gitRepoUrl;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Password database utility";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
Password Safe is a password database utility. Like many other
|
|
|
|
such products, commercial and otherwise, it stores your
|
|
|
|
passwords in an encrypted file, allowing you to remember only
|
|
|
|
one password (the "safe combination"), instead of all the
|
|
|
|
username/password combinations that you use.
|
|
|
|
'';
|
|
|
|
homepage = "https://pwsafe.org/";
|
|
|
|
maintainers = with maintainers; [ c0bw3b pjones ];
|
2023-01-20 10:41:00 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.artistic2;
|
|
|
|
};
|
|
|
|
}
|