Skip to content

Commit

Permalink
app-editors/aee: Fix call to undeclared function wprintf
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/894372
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
  • Loading branch information
listout committed Jun 29, 2023
1 parent 909a432 commit 40199eb
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
67 changes: 67 additions & 0 deletions app-editors/aee/aee-2.2.21-r1.ebuild
@@ -0,0 +1,67 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="7"

inherit toolchain-funcs

DESCRIPTION="An easy to use text editor"
#HOMEPAGE="http://mahon.cwx.net/ http://www.users.uswest.net/~hmahon/"
HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
SRC_URI="mirror://gentoo/${P}.tar.gz"

LICENSE="Artistic"
SLOT="0"
KEYWORDS="~amd64 ~riscv ~x86 ~amd64-linux"
IUSE="X"

RDEPEND="X? ( x11-libs/libX11 )"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"

PATCHES=(
"${FILESDIR}"/${PN}-ae-location.patch
"${FILESDIR}"/${PN}-Wformat-security.patch
"${FILESDIR}"/${PN}-gcc-10.patch
"${FILESDIR}"/${PN}-clang-16-build.patch
)
DOCS=( Changes README.${PN} ${PN}.i18n.guide ${PN}.msg )

src_prepare() {
sed -i \
-e "s/make -/\$(MAKE) -/g" \
-e "/^buildaee/s/$/ localaee/" \
-e "/^buildxae/s/$/ localxae/" \
Makefile

sed -i \
-e "s/\([\t ]\)cc /\1\\\\\$(CC) /" \
-e "/CFLAGS =/s/\" >/ \\\\\$(LDFLAGS)\" >/" \
-e "/other_cflag/s/ \${strip_option}//" \
-e "s/-lcurses/$($(tc-getPKG_CONFIG) --libs ncurses)/" \
create.mk.{aee,xae}

default
}

src_compile() {
local target="aee"
use X && target="both"

emake CC="$(tc-getCC)" ${target}
}

src_install() {
dobin ${PN}
dosym ${PN} /usr/bin/rae
doman ${PN}.1
einstalldocs

insinto /usr/share/${PN}
doins help.ae

if use X; then
dobin xae
dosym xae /usr/bin/rxae
fi
}
40 changes: 40 additions & 0 deletions app-editors/aee/files/aee-clang-16-build.patch
@@ -0,0 +1,40 @@
Bug: https://bugs.gentoo.org/894372
--- a/aee.c
+++ b/aee.c
@@ -1543,7 +1543,7 @@ struct bufr *buf_alloc() /* allocate space for buffers */
temp_buf->main_buffer = FALSE;
temp_buf->edit_buffer = FALSE;
temp_buf->dos_file = FALSE;
- temp_buf->journ_fd = NULL;
+ temp_buf->journ_fd = 0;
return (temp_buf);
}

--- a/journal.c
+++ b/journal.c
@@ -72,6 +72,7 @@ char *jrn_vers_str = "@(#) journal.c $Revision: 1.41 $
#include "aee.h"

#include <time.h>
+#include <wchar.h>

/*
| writes the contents of the line, updates the value stored in
@@ -310,7 +311,7 @@ char *file_name;
| Unable to open journal file.
*/

- buffer->journ_fd = NULL;
+ buffer->journ_fd = 0;
return(1);
}

@@ -860,7 +861,7 @@ struct bufr *buffer;
{
wprintw(com_win, cant_opn_rcvr_fil_msg);
buffer->journalling = FALSE;
- buffer->journ_fd = NULL;
+ buffer->journ_fd = 0;
return;
}

0 comments on commit 40199eb

Please sign in to comment.