From nobody Sat Feb 24 00:50:38 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ThSwb07mMz5Bccq; Sat, 24 Feb 2024 00:50:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ThSwZ5bqsz4Tk3; Sat, 24 Feb 2024 00:50:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708735838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=826w5VunPyhFKi0VeXnvzFfoDSlyLRjyNDk0DGR9UgU=; b=ragiZgeHYjfNQJAqaPua1BYV/67n9KXGLu0MChmnxnfvySNLpSNP1DfN2UxPwE7i8qx9Tm LpPfsdPn4sgAgBjjNc5OeXMYEbNtCLvC8MeyIzXpcMfLIqzqf8ZB8KciwyzAVtj0szDkun pHnR7SruM5SeXBBmqUUNB3Snm1GcBrro96B5/sufBgnzkpc7VIt2hAAk/OXnr+nlAL7Iie v+nXWMxvtBpExUqnlDcwPsH//PfI0fymkfCmxbmXEDfIFURcNoBgz6cHZqBmeikwtU6DAo 7cBZVcDknu991JQOdKx+hO+kOIAOkXKDSmu4zg6QnkxSyAdNYuZifw0qY91obg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708735838; a=rsa-sha256; cv=none; b=PmzSnVdcXgeOpxDwmljACE0rkSyaoPZS4Owi99emjLQQz56cG27nJEEY0leWgVzXFKQqwL Y8UDQF0DVx75plp+dODilr1EWTSZbKO8J37DnRVkaXkGK9at9ts4IKVM2gZZhROpI2bap/ IHenfaLyIVeqkyo+4+H6kGbiPv/ZmOgAqlo4HMsY8DfbB1MitkTfG3Q2NNmi8++YqdpN24 iOnw7PppkUWTs0Pw8Elbw9T+fg9wgfkfFGWtY0/KOvkeoqyDo6ZHVH3fShXLut7ZBHjAn6 gFxpAJwP1aEyT1O7iqGOv0ftpT7Yf9tnKp1Hrto1t7UbTLIKM1edknnh/N9CSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708735838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=826w5VunPyhFKi0VeXnvzFfoDSlyLRjyNDk0DGR9UgU=; b=bcObHIVIn0ByueENX9poO5pMxTXYRRQl1WVPJusfzix9kwaJeT99FBPsrIUScjJPXXeyUX 2+XNFyCDfFxye+1y2yVV3oNtzdiLxekmp8QBSO5rtjaioWBhWsifX4jO9uk+l/HOIDRRwY EVxKTSVtwMuRMP/fC53OM9fqeoGLcbUx6xybm6fL80DkKfodUqQYf6BHf8LxsGKLr0+lU0 xSuApxKYUoO51NZj+qcMnUITlWPazLysoHgAGyDQJqhDC+tFHomBslj03K0N4HFUvcPf17 Aw9LTM6OlOi4A1PEmjAyIDpU8fAs8+W+v+LpqByWevh2+CpLxJ9MFZhG+h75sA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ThSwZ4NC3zfBv; Sat, 24 Feb 2024 00:50:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41O0ocmq022725; Sat, 24 Feb 2024 00:50:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41O0ocJX022722; Sat, 24 Feb 2024 00:50:38 GMT (envelope-from git) Date: Sat, 24 Feb 2024 00:50:38 GMT Message-Id: <202402240050.41O0ocJX022722@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jan Beich Subject: git: f6d34ea28841 - main - x11/hyprlock: add new port List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jbeich X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6d34ea28841e750ee5321787838ee1e21e95bba Auto-Submitted: auto-generated The branch main has been updated by jbeich: URL: https://cgit.FreeBSD.org/ports/commit/?id=f6d34ea28841e750ee5321787838ee1e21e95bba commit f6d34ea28841e750ee5321787838ee1e21e95bba Author: Jan Beich AuthorDate: 2024-02-23 17:12:52 +0000 Commit: Jan Beich CommitDate: 2024-02-24 00:49:59 +0000 x11/hyprlock: add new port Hyprland's simple, yet multi-threaded and GPU-accelerated screen locking utility. Features: - uses the secure ext-session-lock protocol - full support for fractional-scale - fully GPU accelerated - multi-threaded resource acquisition for no hitches https://github.com/hyprwm/hyprlock --- x11/Makefile | 1 + x11/hyprlock/Makefile | 67 ++++++++++++++++++++++++++++++++++++++++++++ x11/hyprlock/distinfo | 5 ++++ x11/hyprlock/files/patch-pam | 21 ++++++++++++++ x11/hyprlock/pkg-descr | 8 ++++++ 5 files changed, 102 insertions(+) diff --git a/x11/Makefile b/x11/Makefile index 2318ff802b6f..33ed03c7d1d5 100644 --- a/x11/Makefile +++ b/x11/Makefile @@ -123,6 +123,7 @@ SUBDIR += hsetroot SUBDIR += hybrid-bar SUBDIR += hypridle + SUBDIR += hyprlock SUBDIR += hyprpaper SUBDIR += hyprpicker SUBDIR += i3bar-river diff --git a/x11/hyprlock/Makefile b/x11/hyprlock/Makefile new file mode 100644 index 000000000000..4e76c8614dd0 --- /dev/null +++ b/x11/hyprlock/Makefile @@ -0,0 +1,67 @@ +PORTNAME= hyprlock +PORTVERSION= s20240223 +CATEGORIES= x11 wayland + +MAINTAINER= jbeich@FreeBSD.org +COMMENT= Hyprland's GPU-accelerated screen locking utility #' +WWW= https://github.com/hyprwm/hyprlock + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= wayland-protocols>0:graphics/wayland-protocols +LIB_DEPENDS= libhyprlang.so:devel/hyprlang \ + libdrm.so:graphics/libdrm \ + libwayland-client.so:graphics/wayland \ + libxkbcommon.so:x11/libxkbcommon +RUN_DEPENDS= unix-selfauth-helper>0:security/unix-selfauth-helper + +USES= compiler:c++11-lib cmake gl gnome pkgconfig +USE_GITHUB= yes +USE_GL= egl gbm +USE_GNOME= cairo pango +GH_ACCOUNT= hyprwm +GH_TAGNAME= 8969351 +LDFLAGS+= -Wl,--as-needed # pango deps +PLIST_FILES= bin/${PORTNAME} \ + etc/pam.d/${PORTNAME} + +# XXX Drop after FreeBSD 14.0 EOL around 2025-03-01 +.if exists(/usr/lib/libc++.so) && !exists(/usr/include/c++/v1/__format/write_escaped.h) +CXXFLAGS+= -fexperimental-library +.endif + +# XXX Drop after FreeBSD 13.3 EOL around 2025-07-01 +.if exists(/usr/lib/libc++.so) && !exists(/usr/include/c++/v1/__chrono/time_zone.h) +LIB_DEPENDS+= libdate-tz.so:devel/date +USES+= localbase:ldflags +.endif + +post-install: + ${INSTALL_DATA} ${WRKSRC}/pam/${PORTNAME} \ + ${STAGEDIR}${PREFIX}/etc/pam.d/${PORTNAME} + +# XXX Drop after FreeBSD 13.2 EOL around 2024-05-01 (don't forget distinfo) +.if ${CXX} == c++ && exists(/usr/lib/libc++.so) +.if !exists(/usr/include/c++/v1/expected) || make(makesum) || make(fetch) +USES+= llvm:min=16,build,export +PATH:= ${LLVM_PREFIX}/bin:${PATH} # XXX _CMAKE_TOOLCHAIN_SUFFIX vs. devel/llvm* +CONFIGURE_ENV+= CC="${CC}" CXX="${CXX}" CPP="${CPP}" + +# XXX Move into separate port and standardize via USES +GH_TUPLE+= llvm:llvm-project:llvmorg-16.0.1:libcxx +CXXFLAGS+= -nostdinc++ -isystem${WRKDIR}/libcxx_prefix/include/c++/v1 +# Don't link against new libc++ as it's not necessary +#LDFLAGS+= -nostdlib++ -L${WRKDIR}/libcxx_prefix/lib -l:libc++.a -lcxxrt + +pre-configure: bundled-libcxx +bundled-libcxx: + @${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} \ + -DLIBCXX_INCLUDE_BENCHMARKS:BOOL=OFF \ + -DCMAKE_INSTALL_PREFIX:PATH=${WRKDIR}/libcxx_prefix \ + -B ${WRKDIR}/libcxx_build -S ${WRKSRC_libcxx}/libcxx + @${DO_MAKE_BUILD:NDESTDIR*} install -C ${WRKDIR}/libcxx_build +.endif +.endif # exists(/usr/lib/libc++.so) + +.include diff --git a/x11/hyprlock/distinfo b/x11/hyprlock/distinfo new file mode 100644 index 000000000000..4a6e36a1b566 --- /dev/null +++ b/x11/hyprlock/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1708723748 +SHA256 (hyprwm-hyprlock-s20240223-8969351_GH0.tar.gz) = c30cefee520fa06f6f955b5f65fb8ba117a7d32faf8ecf860176b1654a6afabe +SIZE (hyprwm-hyprlock-s20240223-8969351_GH0.tar.gz) = 49265 +SHA256 (llvm-llvm-project-llvmorg-16.0.1_GH0.tar.gz) = b5a9ff1793b1e2d388a3819bf35797002b1d2e40bb35a10c65605e0ea1435271 +SIZE (llvm-llvm-project-llvmorg-16.0.1_GH0.tar.gz) = 179289803 diff --git a/x11/hyprlock/files/patch-pam b/x11/hyprlock/files/patch-pam new file mode 100644 index 000000000000..044b0af3a847 --- /dev/null +++ b/x11/hyprlock/files/patch-pam @@ -0,0 +1,21 @@ +"su" has "auth sufficient pam_self.so" but a screen locker is +supposed to ask for password regardless. + +pam_unix(8) requires root priveleges to access master.passwd(5), +so try authenticating via setuid helper first. + +--- pam/hyprlock.orig 1970-01-01 00:00:00 UTC ++++ pam/hyprlock +@@ -0,0 +1 @@ ++auth include unix-selfauth +--- src/core/Password.cpp.orig 2024-02-23 21:29:08 UTC ++++ src/core/Password.cpp +@@ -30,7 +30,7 @@ std::shared_ptr CPassw + const pam_conv localConv = {conv, NULL}; + pam_handle_t* handle = NULL; + +- int ret = pam_start("su", getlogin(), &localConv, &handle); ++ int ret = pam_start("hyprlock", getlogin(), &localConv, &handle); + + if (ret != PAM_SUCCESS) { + result->success = false; diff --git a/x11/hyprlock/pkg-descr b/x11/hyprlock/pkg-descr new file mode 100644 index 000000000000..c84e12082d3d --- /dev/null +++ b/x11/hyprlock/pkg-descr @@ -0,0 +1,8 @@ +Hyprland's simple, yet multi-threaded and GPU-accelerated screen +locking utility. + +Features: + - uses the secure ext-session-lock protocol + - full support for fractional-scale + - fully GPU accelerated + - multi-threaded resource acquisition for no hitches