mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
x11-wm/notion: Fix passing of incompatible pointer type
TODO: According to developer/s, frame->mplex->win would be a more type-safe way to achieve the same, but then it becomes less clear whether this is an 'is' or a 'has' relationship. Closes: https://bugs.gentoo.org/919249 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/36498 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
49
x11-wm/notion/files/notion-4.0.2-gcc14-build-fix.patch
Normal file
49
x11-wm/notion/files/notion-4.0.2-gcc14-build-fix.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
https://github.com/raboof/notion/commit/3c81575d48b2fd1b851536e305961bb199ea36b5.patch
|
||||
From: Brahmajit Das <brahmajit.xyz@gmail.com>
|
||||
Date: Wed, 1 May 2024 11:35:59 +0530
|
||||
Subject: [PATCH] Fix build with GCC 14 and above
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Newer compilers such as GCC 14 ( and above ) have enabled a few compiler
|
||||
flags by default, -Wincompatible-pointer-types being one of them. Thus
|
||||
resulting in build errors such as:
|
||||
|
||||
frame.c: In function ‘frame_set_numbers_extl’:
|
||||
frame.c:799:32: error: passing argument 1 of ‘ioncore_grab_establish’ from incompatible pointer type [-Wincompatible-pointer-types]
|
||||
799 | ioncore_grab_establish(frame, numbers_grab_handler, NULL,
|
||||
| ^~~~~
|
||||
| |
|
||||
| WFrame * {aka struct WFrame_struct *}
|
||||
|
||||
For now a type casting can be used to supress the error, as changing the type
|
||||
of frame would require touching other parts of the codebase. This should be
|
||||
fine for now as WFrame is a WMPlex which is a WWindow.
|
||||
|
||||
TODO:
|
||||
According to developer/s, frame->mplex->win would be a more type-safe way to
|
||||
achieve the same, but then it becomes less clear whether this is an 'is' or a
|
||||
'has' relationship.
|
||||
|
||||
First reported on Gentoo Linux with GCC 14, for more details please
|
||||
reffer https://bugs.gentoo.org/919249
|
||||
|
||||
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
|
||||
---
|
||||
ioncore/frame.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ioncore/frame.c b/ioncore/frame.c
|
||||
index dbe0d107c..2f7663815 100644
|
||||
--- a/ioncore/frame.c
|
||||
+++ b/ioncore/frame.c
|
||||
@@ -796,7 +796,7 @@ bool frame_set_numbers_extl(WFrame *frame, const char *how)
|
||||
{
|
||||
if(how!=NULL && strcmp(how, "during_grab")==0){
|
||||
bool new_state = frame_set_numbers(frame, SETPARAM_SET);
|
||||
- ioncore_grab_establish(frame, numbers_grab_handler, NULL,
|
||||
+ ioncore_grab_establish((WRegion *)frame, numbers_grab_handler, NULL,
|
||||
0, GRAB_DEFAULT_FLAGS&~GRAB_POINTER);
|
||||
return new_state;
|
||||
}
|
||||
97
x11-wm/notion/notion-4.0.2_p20220613-r1.ebuild
Normal file
97
x11-wm/notion/notion-4.0.2_p20220613-r1.ebuild
Normal file
@@ -0,0 +1,97 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
LUA_COMPAT=( lua5-4 )
|
||||
|
||||
inherit lua-single toolchain-funcs readme.gentoo-r1
|
||||
|
||||
DESCRIPTION="Notion is a tiling, tabbed window manager for the X window system"
|
||||
HOMEPAGE="https://notionwm.net/"
|
||||
|
||||
if [[ ${PV} == *9999 ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/raboof/${PN}.git"
|
||||
else
|
||||
inherit vcs-snapshot
|
||||
COMMIT="f161c1b4dbba1ac81d8e9c3d7e5e353058a4d7d1"
|
||||
SRC_URI="https://github.com/raboof/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
fi
|
||||
|
||||
LICENSE="LGPL-2.1"
|
||||
SLOT="0"
|
||||
IUSE="nls xinerama +xrandr"
|
||||
# needs slingshot,... not in tree
|
||||
RESTRICT="test"
|
||||
# mod_xrandr references mod_xinerama
|
||||
REQUIRED_USE="
|
||||
${LUA_REQUIRED_USE}
|
||||
xrandr? ( xinerama )"
|
||||
|
||||
RDEPEND="
|
||||
${LUA_DEPS}
|
||||
x11-libs/libSM
|
||||
x11-libs/libX11
|
||||
x11-libs/libXext
|
||||
nls? ( sys-devel/gettext )
|
||||
xinerama? ( x11-libs/libXinerama )
|
||||
xrandr? ( x11-libs/libXrandr )"
|
||||
DEPEND="${RDEPEND}"
|
||||
# luac is called at build time
|
||||
BDEPEND="
|
||||
${LUA_DEPS}
|
||||
virtual/pkgconfig"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-4.0.2-gcc14-build-fix.patch
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
tc-export AR CC PKG_CONFIG
|
||||
export INSTALL_STRIP=""
|
||||
|
||||
cat > system-local.mk <<- _EOF_ || die
|
||||
PREFIX=${EPREFIX}/usr
|
||||
DOCDIR=\$(PREFIX)/share/doc/${PF}
|
||||
ETCDIR=${EPREFIX}/etc/${PN}
|
||||
LIBDIR=\$(PREFIX)/$(get_libdir)
|
||||
VARDIR=${EPREFIX}/var/cache/${PN}
|
||||
LUA_MANUAL=1
|
||||
LUA=${LUA}
|
||||
LUAC=${BROOT}/usr/bin/${ELUA/lua/luac}
|
||||
LUA_LIBS=$(lua_get_LIBS)
|
||||
LUA_INCLUDES=$(lua_get_CFLAGS)
|
||||
$(usev !nls "DEFINES+=-DCF_NO_LOCALE -DCF_NO_GETTEXT")
|
||||
_EOF_
|
||||
|
||||
if ! use xinerama ; then
|
||||
sed -e 's/mod_xinerama//g' -i modulelist.mk || die
|
||||
fi
|
||||
|
||||
if ! use xrandr ; then
|
||||
sed -e 's/mod_xrandr//g' -i modulelist.mk || die
|
||||
sed -e '/mod_xrandr/d' -i etc/cfg_defaults.lua || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
default
|
||||
|
||||
exeinto /etc/X11/Sessions
|
||||
doexe "${FILESDIR}"/notion
|
||||
|
||||
insinto /usr/share/xsessions
|
||||
doins "${FILESDIR}"/notion.desktop
|
||||
|
||||
local DOC_CONTENTS="
|
||||
If you want notion to have an ability to view a file based on its
|
||||
guessed MIME type you should emerge app-misc/run-mailcap."
|
||||
readme.gentoo_create_doc
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
readme.gentoo_print_elog
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 1999-2022 Gentoo Authors
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
@@ -43,6 +43,10 @@ BDEPEND="
|
||||
${LUA_DEPS}
|
||||
virtual/pkgconfig"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-4.0.2-gcc14-build-fix.patch
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
tc-export AR CC PKG_CONFIG
|
||||
export INSTALL_STRIP=""
|
||||
|
||||
Reference in New Issue
Block a user