diff --git a/x11/autorandr/Makefile b/x11/autorandr/Makefile index a52479a478a9..e0f955d18d88 100644 --- a/x11/autorandr/Makefile +++ b/x11/autorandr/Makefile @@ -1,56 +1,54 @@ PORTNAME= autorandr -DISTVERSION= 1.12.1 -PORTREVISION= 1 +DISTVERSION= 1.15 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 WWW= https://github.com/phillipberndt/autorandr LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/gpl-3.0.txt BUILD_DEPENDS= gsed:textproc/gsed RUN_DEPENDS= xrandr:x11/xrandr -USES= gmake pkgconfig python:3.10 shebangfix xorg +USES= gmake pkgconfig python shebangfix xorg # Use GitHub instead of MASTER_SITES=PYPI 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 +CFLAGS+= -DAUTORANDR_PATH=${PREFIX}/bin/autorandr + # 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 index f0accfab318b..e91ca36c7a80 100644 --- a/x11/autorandr/distinfo +++ b/x11/autorandr/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1647355348 -SHA256 (phillipberndt-autorandr-1.12.1_GH0.tar.gz) = 2fa2fa6e76a208dc6e2f3a5c743aef14b8b3fd0ed18132e25f79cde3a00b0309 -SIZE (phillipberndt-autorandr-1.12.1_GH0.tar.gz) = 45550 +TIMESTAMP = 1761161416 +SHA256 (phillipberndt-autorandr-1.15_GH0.tar.gz) = 1579b6b4d44669a0db22268524ea512f60da02eeecffddf81f7327aaf56485f5 +SIZE (phillipberndt-autorandr-1.15_GH0.tar.gz) = 49352 SHA256 (2bc71d562765e2023b26a31c485769612e3eb91e.patch) = e3e7335d2cd2aebe9fe8b633f570bbd22ecf0b82ada392ee5c8da1a2e41f6b34 SIZE (2bc71d562765e2023b26a31c485769612e3eb91e.patch) = 3801 diff --git a/x11/autorandr/files/patch-autorandr.py b/x11/autorandr/files/patch-autorandr.py index c5b6286c6762..716ce45e37c6 100644 --- a/x11/autorandr/files/patch-autorandr.py +++ b/x11/autorandr/files/patch-autorandr.py @@ -1,38 +1,38 @@ ---- autorandr.py.orig 2021-12-22 12:28:03 UTC +--- autorandr.py.orig 2024-03-03 12:37:50 UTC +++ autorandr.py -@@ -121,6 +121,8 @@ Usage: autorandr [options] +@@ -150,6 +150,8 @@ def is_closed_lid(output): 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 +@@ -1212,7 +1214,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) +@@ -1299,6 +1301,8 @@ def dispatch_call_to_sessions(argv): + if 'AUTORANDR_UID_MIN' in os.environ: + uid_min = int(os.environ['AUTORANDR_UID_MIN']) + 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): +@@ -1453,7 +1457,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 deleted file mode 100644 index a759cdaef292..000000000000 --- a/x11/autorandr/files/patch-contrib_autorandr__launcher_autorandr__launcher.c +++ /dev/null @@ -1,11 +0,0 @@ ---- 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 {