Merge pull request #176203 from midchildan/update/pinentry-mac

pinentry-mac: 0.9.4 -> 1.1.1.1
This commit is contained in:
Bernardo Meurer 2022-08-25 10:37:50 -03:00 committed by GitHub
commit 2c9fb7abc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 68 additions and 16 deletions

View file

@ -60,6 +60,13 @@ indent_size = unset
[*.md]
trim_trailing_whitespace = unset
# binaries
[*.nib]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
charset = unset
[eggs.nix]
trim_trailing_whitespace = unset

View file

@ -1,32 +1,78 @@
{ lib, stdenv, fetchFromGitHub, xcbuildHook, libiconv, ncurses, Cocoa }:
{ lib
, stdenv
, fetchFromGitHub
, autoreconfHook
, libassuan
, libgpg-error
, libiconv
, texinfo
, common-updater-scripts
, writers
, Cocoa
}:
stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "pinentry-mac";
version = "0.9.4";
# NOTE: Don't update manually. Use passthru.updateScript on a Mac with XCode
# installed.
version = "1.1.1.1";
src = fetchFromGitHub {
owner = "matthewbauer";
repo = "pinentry-mac";
rev = "6dfef256c8ea32d642fea847f27d800f024cf51e";
sha256 = "0g75302697gqcxyf2hyqzvcbd5pyss1bl2xvfd40wqav7dlyvj83";
owner = "GPGTools";
repo = "pinentry";
rev = "v${version}";
sha256 = "sha256-QnDuqFrI/U7aZ5WcOCp5vLE+w59LVvDGOFNQy9fSy70=";
};
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ libiconv ncurses Cocoa ];
preBuild = ''
# Only build for what we care about (also allows arm64)
substituteInPlace pinentry-mac.xcodeproj/project.pbxproj \
--replace "i386 x86_64 ppc" "${stdenv.targetPlatform.darwinArch}"
# use pregenerated nib files because generating them requires XCode
postPatch = ''
cp -r ${./mac/Main.nib} macosx/Main.nib
cp -r ${./mac/Pinentry.nib} macosx/Pinentry.nib
chmod -R u+w macosx/*.nib
'';
nativeBuildInputs = [ autoreconfHook texinfo ];
buildInputs = [ libassuan libgpg-error libiconv Cocoa ];
configureFlags = [ "--enable-maintainer-mode" "--disable-ncurses" ];
installPhase = ''
mkdir -p $out/Applications
mv Products/Release/pinentry-mac.app $out/Applications
mv macosx/pinentry-mac.app $out/Applications
'';
enableParallelBuilding = true;
passthru = {
binaryPath = "Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac";
updateScript = writers.writeBash "update-pinentry-mac" ''
set -euxo pipefail
main() {
tag="$(queryLatestTag)"
ver="$(expr "$tag" : 'v\(.*\)')"
${common-updater-scripts}/bin/update-source-version pinentry_mac "$ver"
cd ${lib.escapeShellArg ./.}
rm -rf mac
mkdir mac
srcDir="$(nix-build ../../../.. --no-out-link -A pinentry_mac.src)"
for path in "$srcDir"/macosx/*.xib; do
filename="''${path##*/}"
/usr/bin/ibtool --compile "mac/''${filename%.*}.nib" "$path"
done
}
queryLatestTag() {
curl -sS https://api.github.com/repos/GPGTools/pinentry/tags \
| jq -r '.[] | .name' | sort --version-sort | tail -1
}
main
'';
};
meta = {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -9830,7 +9830,6 @@ with pkgs;
pinentry_mac = callPackage ../tools/security/pinentry/mac.nix {
inherit (darwin.apple_sdk.frameworks) Cocoa;
xcbuildHook = if stdenv.targetPlatform.isAarch64 then xcbuildHook else xcbuild6Hook;
};
pinentry-bemenu = callPackage ../tools/security/pinentry-bemenu { };