diff --git a/security/putty/Makefile b/security/putty/Makefile index 80b4f84f2d28..2e4ae7a5cb5a 100644 --- a/security/putty/Makefile +++ b/security/putty/Makefile @@ -1,112 +1,111 @@ PORTNAME= putty PORTVERSION= 0.78~pre20220919 -DISTNAME= ${PORTNAME}-${PORTVERSION}.fda41e1 +DISTVERSIONSUFFIX= .fda41e1 PORTREVISION= 0 CATEGORIES= security #MASTER_SITES= http://the.earth.li/~sgtatham/putty/${PORTVERSION}/ \ # ftp://ftp.chiark.greenend.org.uk/users/sgtatham/putty-latest/ MASTER_SITES= https://tartarus.org/~simon/putty-prerel-snapshots/ \ LOCAL/mandree/ EXTRA_PATCHES+= ${FILESDIR}/0001-setpgrp-cmake-check-use-if-not-if-defined.patch EXTRA_PATCHES+= ${FILESDIR}/0002-Use-GTK_LDFLAGS-when-testing-for-Pango.patch +EXTRA_PATCHES+= ${FILESDIR}/0001-Stop-trying-to-include-X11-headers-in-non-GTK-builds.patch PATCH_STRIP= -p1 MAINTAINER= mandree@FreeBSD.org COMMENT= Secure shell and telnet client including xterm emulator WWW= https://www.chiark.greenend.org.uk/~sgtatham/putty/ # test plan: test ALL 4 GSSAPI_* options, GTK3 yes/no, WITH_DEBUG=yes build. LICENSE= MIT LICENSE_FILE= ${PATCH_WRKSRC}/LICENCE USES= cmake cpe perl5 pkgconfig USE_PERL5= build CONFLICTS_INSTALL?= pssh* putty-nogtk* PLIST_FILES= bin/pageant \ bin/plink \ bin/pscp \ bin/psftp \ bin/psusan \ bin/puttygen \ share/man/man1/pageant.1.gz \ share/man/man1/plink.1.gz \ share/man/man1/pscp.1.gz \ share/man/man1/psftp.1.gz \ share/man/man1/psusan.1.gz \ share/man/man1/puttygen.1.gz OPTIONS_DEFINE= GTK3 OPTIONS_DEFAULT= GSSAPI_BASE GTK3 OPTIONS_SINGLE= GSSAPI_SELECT OPTIONS_SINGLE_GSSAPI_SELECT= GSSAPI_BASE \ GSSAPI_HEIMDAL \ GSSAPI_MIT \ GSSAPI_NONE .include LDFLAGS+= -Wl,--as-needed # XXX FIXME this is simplified on these assumptions: # - we only support GTK3 in FreeBSD # (Putty would support EOL GTK2 and GTK1 as well) # - Putty 0.77 cannot have X11 without the gdk/gdkx.h header i. e. GTK. .if ${PORT_OPTIONS:MGTK3} && !defined(WITHOUT_X11) USES+= xorg USE_XORG= x11 USES+= gnome USE_GNOME= cairo gdkpixbuf2 gtk30 CMAKE_ARGS+= -DPUTTY_GTK_VERSION:STRING=3 PLIST_FILES+= bin/pterm \ bin/putty \ share/man/man1/pterm.1.gz \ share/man/man1/putty.1.gz \ share/pixmaps/putty.ico DESKTOP_ENTRIES= "PuTTY" \ "${COMMENT}" \ "${PREFIX}/share/pixmaps/${PORTNAME}.ico" \ "${PORTNAME}" \ "" \ false .else -# hack alert: PuTTY, as of 864b4c, masks the definition of NOT_X_WINDOWS -# under GTK_FOUND; which it defeats. Pass it down explicitly. -CMAKE_ARGS+= -DPUTTY_GTK_VERSION:STRING=NONE -DNOT_X_WINDOWS:BOOL=TRUE +CMAKE_ARGS+= -DPUTTY_GTK_VERSION:STRING=NONE .endif .if ${PORT_OPTIONS:MGSSAPI_BASE} # Heimdal-like in base system USES+= gssapi:base,flags CMAKE_ARGS+= -DPUTTY_GSSAPI:STRING=STATIC -DKRB5_CONFIG:PATH=${KRB5CONFIG} .elif ${PORT_OPTIONS:MGSSAPI_HEIMDAL} USES+= gssapi:heimdal,flags CMAKE_ARGS+= -DPUTTY_GSSAPI:STRING=STATIC -DKRB5_CONFIG:PATH=${KRB5CONFIG} .elif ${PORT_OPTIONS:MGSSAPI_MIT} USES+= gssapi:mit,flags CMAKE_ARGS+= -DPUTTY_GSSAPI:STRING=STATIC -DKRB5_CONFIG:PATH=${KRB5CONFIG} .else CMAKE_ARGS+= -DPUTTY_GSSAPI:STRING=OFF .endif post-patch: # we don't want to inherit FreeBSD commits # as PUTTY Git commit revisions, # so pretend we do not have Git: ${REINPLACE_CMD} '/FindGit/d' \ ${WRKSRC}/cmake/setup.cmake \ ${WRKSRC}/doc/CMakeLists.txt # nuke pkg-config detection of GSSAPI/Kerberos libs, # it interferes with FreeBSD's krb5-config approach ${REINPLACE_CMD} '/pkg_check_modules(KRB5 krb5-gssapi)/d' \ ${WRKSRC}/cmake/platforms/unix.cmake post-install: .if ${PORT_OPTIONS:MGTK3} @${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${INSTALL_DATA} ${WRKSRC}/windows/putty.ico \ ${STAGEDIR}${PREFIX}/share/pixmaps/ .endif .include diff --git a/security/putty/files/0001-Stop-trying-to-include-X11-headers-in-non-GTK-builds.patch b/security/putty/files/0001-Stop-trying-to-include-X11-headers-in-non-GTK-builds.patch new file mode 100644 index 000000000000..58ddf65280f4 --- /dev/null +++ b/security/putty/files/0001-Stop-trying-to-include-X11-headers-in-non-GTK-builds.patch @@ -0,0 +1,31 @@ +From 9fcfd679b49a015e95f70b3f0380243e0db8b035 Mon Sep 17 00:00:00 2001 +From: Simon Tatham +Date: Mon, 19 Sep 2022 20:21:01 +0100 +Subject: [PATCH] Stop trying to include X11 headers in non-GTK builds. + +In commit 732ec31a17a7fea I made the check for libX11 conditional on +GTK - but I forgot that if we're building without GTK, I should +_define_ NOT_X_WINDOWS, rather than leaving it undefined. As a result, +the build would fail on files like unix/utils/x11_ignore_error.c. +--- + cmake/platforms/unix.cmake | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/cmake/platforms/unix.cmake b/cmake/platforms/unix.cmake +index 98474485..4d056d0a 100644 +--- a/cmake/platforms/unix.cmake ++++ b/cmake/platforms/unix.cmake +@@ -96,6 +96,10 @@ if(GTK_FOUND) + endif() + endfunction() + check_x11() ++else() ++ # If we didn't even have GTK, behave as if X11 is not available. ++ # (There's nothing useful we could do with it even if there was.) ++ set(NOT_X_WINDOWS ON) + endif() + + include_directories(${CMAKE_SOURCE_DIR}/charset ${GTK_INCLUDE_DIRS} ${X11_INCLUDE_DIR}) +-- +2.37.3 +