From nobody Tue Mar 15 15:35:12 2022 X-Original-To: dev-commits-ports-all@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 026931A1DAAB; Tue, 15 Mar 2022 15:35:13 +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 4KHyCN6bGnz4gDX; Tue, 15 Mar 2022 15:35:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647358512; 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=bZweMNDu/b5tdKTjnyOsmG5EmaAq8kX2hCiGdzWKWdY=; b=IkvBlgINpAqUYDJNJytkHGETSORnEcB3crqR4PTA7FGhasyxYDKviM2a0ehdSarPjgYkVM gWf9qV9BV6p9BCzQYH/s8Kcfb2SP5xx42Gv/3ZvF54+p2dY7/AA9iDAdTVMSPbzB9HvxsU cAHiKYj0lUbC5AFbQeQsQPyK2m2yxd1pAh5KFIk1TIoszFGXjMP3MoYNorntJDXcvJUmJH gJm0ofcnRd2TmUf9vHcMp7W/vYP4CsVnw5M5Nxk1CdIygh24oB+Ir64aUd31PDxj5M/sS5 B4zySj7D3TkxIjXmhRKJWAMdgKl3CaDFyGVRfCMv2AjdQsWTy+wL51i9b2oe/A== 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 C249F24529; Tue, 15 Mar 2022 15:35:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22FFZCtI057283; Tue, 15 Mar 2022 15:35:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22FFZCww057282; Tue, 15 Mar 2022 15:35:12 GMT (envelope-from git) Date: Tue, 15 Mar 2022 15:35:12 GMT Message-Id: <202203151535.22FFZCww057282@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 1d91011b3e54 - main - x11/autorandr: Add a new port List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d91011b3e5444955ec85b0143e211886035b9e7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647358512; 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=bZweMNDu/b5tdKTjnyOsmG5EmaAq8kX2hCiGdzWKWdY=; b=jMkE4Apdt1+pKd2Refj5ZQRSqt+MHXBa03yRB7DBYxilDAofcz0rUqOrZWt3mnNUynRjvt 9J237/ivYWZJ14kL6XUYon75VJGZQdPDuPjqCgbeH0wzvp9CFkofAtPc6zlPpncB/NjcI3 yPTR/B1a+WsxvfRef6qAbLhznvb42gWRKyb49j0oZ2ejr4eAjKAz6Naf8eSOqOVKw+nthv rAyxwGnouLTVHblFF0EQBBFC5xK5bYgQzaMCxPI5CxD8wqxZL7hB2o2zp0/cAEZSMLBUZd +Ws8aypHiqjKcnhKrWOft/7PxtHIKEqOPUdWuWVos1/mRini3ZxPh+DcWq4/IQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647358512; a=rsa-sha256; cv=none; b=BQWshL9iKGUaMPSEuLeHwfnK0W6P9gmEZ8kR0/i0E8GdWFm93Lj8NmAixAlPOOfD2bju5u 7Ztzi5us9b3zcJAlMGFb8uUu6x1zAdBQd5gsgn3L+wGy4Mptxyd6mHdmfBjqSvQ68+VDA7 /vv5IjUC33V7IoTaungnzlt8fOf4QDGJ0NYcSBkq2EIvp7a0FgXsNqjLEmA3Dk5HHCiFY0 I0U8rSFvwrpJE6XoaAEj1tB34T2HxZ1jAyzv4YWArzbo5neyo5A7WS1KKS4f3JInyux039 u05uiaMe4k41SuRVaBv8plQr4giIUb0wNODYcRdI0Unv9sFDysts3nUEWXzRWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/ports/commit/?id=1d91011b3e5444955ec85b0143e211886035b9e7 commit 1d91011b3e5444955ec85b0143e211886035b9e7 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2022-03-15 15:31:37 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2022-03-15 15:34:38 +0000 x11/autorandr: Add a new port Autorandr allows for auto-detecting displays and configuring them with xrandr. Although autorandr is present in the PyPI repositories, I decided to not prefix this package with py*- as no other package managers do that. Autorandr should be considered an end-user application. WWW: https://github.com/phillipberndt/autorandr --- x11/Makefile | 1 + x11/autorandr/Makefile | 54 ++++++++++++++++++++++ x11/autorandr/distinfo | 5 ++ x11/autorandr/files/patch-autorandr.py | 38 +++++++++++++++ ...ntrib_autorandr__launcher_autorandr__launcher.c | 11 +++++ x11/autorandr/pkg-descr | 4 ++ 6 files changed, 113 insertions(+) diff --git a/x11/Makefile b/x11/Makefile index 3bbde49a3128..63ffd644bbc9 100644 --- a/x11/Makefile +++ b/x11/Makefile @@ -17,6 +17,7 @@ SUBDIR += arandr SUBDIR += arcan-trayicon SUBDIR += aterm + SUBDIR += autorandr SUBDIR += babl SUBDIR += bbappconf SUBDIR += bbdock diff --git a/x11/autorandr/Makefile b/x11/autorandr/Makefile new file mode 100644 index 000000000000..32eb004d67fb --- /dev/null +++ b/x11/autorandr/Makefile @@ -0,0 +1,54 @@ +PORTNAME= autorandr +DISTVERSION= 1.12.1 +CATEGORIES= x11 +PATCH_SITES= https://github.com/phillipberndt/autorandr/commit/ +PATCHFILES= 2bc71d562765e2023b26a31c485769612e3eb91e.patch:-p1 # PR 282 + +MAINTAINER= 0mp@FreeBSD.org +COMMENT= Auto-detect displays and configure them with xrandr + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/gpl-3.0.txt + +BUILD_DEPENDS= gsed:textproc/gsed +RUN_DEPENDS= xrandr:x11/xrandr + +USES= gmake pkgconfig python:3.3-3.10 shebangfix xorg +# Use GitHub instead of MASTER_SITES=CHEESESHOP to get additional files like +# the manual page and the license. +USE_GITHUB= yes +GH_ACCOUNT= phillipberndt +USE_PYTHON= autoplist concurrent distutils +USE_XORG= xcb + +MAKE_ARGS= BASH_COMPLETIONS_DIR=${PREFIX}/share/bash-completion/completions \ + PREFIX=${PREFIX} \ + XDG_AUTOSTART_DIR=${PREFIX}/etc/xdg/autostart +BINARY_ALIAS= sed=gsed + +PLIST_FILES= bin/${PORTNAME}-launcher \ + etc/xdg/autostart/autorandr-launcher.desktop \ + share/bash-completion/completions/autorandr \ + share/man/man1/${PORTNAME}.1.gz + +_EXTRA_BUILD_TARGETS= contrib/autorandr_launcher/autorandr-launcher +_EXTRA_INSTALL_TARGETS= install_bash_completion install_launcher \ + install_manpage + +# Regenerate the patches with: +# make clean extract do-patch PATCHFILES= +post-patch: + ${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|g' \ + ${WRKSRC}/${PORTNAME}.py \ + ${WRKSRC}/contrib/autorandr_launcher/autorandr_launcher.c + +post-build: + ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_WRKSRC} ${MAKE_ARGS} \ + ${_EXTRA_BUILD_TARGETS} + +post-install: + ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${INSTALL_WRKSRC} ${MAKE_ARGS} \ + ${_EXTRA_INSTALL_TARGETS} + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}-launcher + +.include diff --git a/x11/autorandr/distinfo b/x11/autorandr/distinfo new file mode 100644 index 000000000000..f0accfab318b --- /dev/null +++ b/x11/autorandr/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1647355348 +SHA256 (phillipberndt-autorandr-1.12.1_GH0.tar.gz) = 2fa2fa6e76a208dc6e2f3a5c743aef14b8b3fd0ed18132e25f79cde3a00b0309 +SIZE (phillipberndt-autorandr-1.12.1_GH0.tar.gz) = 45550 +SHA256 (2bc71d562765e2023b26a31c485769612e3eb91e.patch) = e3e7335d2cd2aebe9fe8b633f570bbd22ecf0b82ada392ee5c8da1a2e41f6b34 +SIZE (2bc71d562765e2023b26a31c485769612e3eb91e.patch) = 3801 diff --git a/x11/autorandr/files/patch-autorandr.py b/x11/autorandr/files/patch-autorandr.py new file mode 100644 index 000000000000..c5b6286c6762 --- /dev/null +++ b/x11/autorandr/files/patch-autorandr.py @@ -0,0 +1,38 @@ +--- autorandr.py.orig 2021-12-22 12:28:03 UTC ++++ autorandr.py +@@ -121,6 +121,8 @@ Usage: autorandr [options] + def is_closed_lid(output): + if not re.match(r'(eDP(-?[0-9]\+)*|LVDS(-?[0-9]\+)*)', output): + return False ++ print("Checking for a closed lid via /proc is not supported on FreeBSD.", file=sys.stderr) ++ return False + lids = glob.glob("/proc/acpi/button/lid/*/state") + if len(lids) == 1: + state_file = lids[0] +@@ -1114,7 +1116,7 @@ def exec_scripts(profile_path, script_name, meta_infor + if profile_path: + candidate_directories.append(profile_path) + candidate_directories.append(user_profile_path) +- for config_dir in os.environ.get("XDG_CONFIG_DIRS", "/etc/xdg").split(":"): ++ for config_dir in os.environ.get("XDG_CONFIG_DIRS", "%%PREFIX%%/etc/xdg").split(":"): + candidate_directories.append(os.path.join(config_dir, "autorandr")) + + for folder in candidate_directories: +@@ -1191,6 +1193,8 @@ def dispatch_call_to_sessions(argv): + sys.exit(1) + os.waitpid(child_pid, 0) + ++ print("/proc is not supported on FreeBSD; aborting.", file=sys.stderr) ++ sys.exit(1) + for directory in os.listdir("/proc"): + directory = os.path.join("/proc/", directory) + if not os.path.isdir(directory): +@@ -1321,7 +1325,7 @@ def main(argv): + try: + # Load profiles from each XDG config directory + # The XDG spec says that earlier entries should take precedence, so reverse the order +- for directory in reversed(os.environ.get("XDG_CONFIG_DIRS", "/etc/xdg").split(":")): ++ for directory in reversed(os.environ.get("XDG_CONFIG_DIRS", "%%PREFIX%%/etc/xdg").split(":")): + system_profile_path = os.path.join(directory, "autorandr") + if os.path.isdir(system_profile_path): + profiles.update(load_profiles(system_profile_path)) diff --git a/x11/autorandr/files/patch-contrib_autorandr__launcher_autorandr__launcher.c b/x11/autorandr/files/patch-contrib_autorandr__launcher_autorandr__launcher.c new file mode 100644 index 000000000000..a759cdaef292 --- /dev/null +++ b/x11/autorandr/files/patch-contrib_autorandr__launcher_autorandr__launcher.c @@ -0,0 +1,11 @@ +--- contrib/autorandr_launcher/autorandr_launcher.c.orig 2022-03-15 15:02:37 UTC ++++ contrib/autorandr_launcher/autorandr_launcher.c +@@ -38,7 +38,7 @@ static int ar_launch() + pid_t pid = fork(); + if (pid == 0) { + static char *argv[] = +- { "/usr/bin/autorandr", "--change", "--default", "default", NULL }; ++ { "%%PREFIX%%/bin/autorandr", "--change", "--default", "default", NULL }; + execve(argv[0], argv, environ); + exit(127); + } else { diff --git a/x11/autorandr/pkg-descr b/x11/autorandr/pkg-descr new file mode 100644 index 000000000000..99ff4377c0b9 --- /dev/null +++ b/x11/autorandr/pkg-descr @@ -0,0 +1,4 @@ +Automatically select an xrandr display configuration based on connected +devices. + +WWW: https://github.com/phillipberndt/autorandr