commit:     e135b5b7d6f3ad004ad9bf98a34924ac91f99f4d
Author:     Pascal Jäger <pascal.jaeger <AT> leimstift <DOT> de>
AuthorDate: Wed Nov  9 14:05:17 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Nov 15 01:46:08 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e135b5b7

app-misc/wcd: version bump to 6.0.4, fix clang16 build

Closes: https://bugs.gentoo.org/878585
Signed-off-by: Pascal Jäger <pascal.jaeger <AT> leimstift.de>
Closes: https://github.com/gentoo/gentoo/pull/28201
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-misc/wcd/Manifest                     |   1 +
 app-misc/wcd/files/wcd-6.0.4-gentoo.patch | 103 ++++++++++++++++++++++++++++++
 app-misc/wcd/wcd-6.0.4.ebuild             |  49 ++++++++++++++
 3 files changed, 153 insertions(+)

diff --git a/app-misc/wcd/Manifest b/app-misc/wcd/Manifest
index 65c4da15769e..d6a74e918884 100644
--- a/app-misc/wcd/Manifest
+++ b/app-misc/wcd/Manifest
@@ -1 +1,2 @@
 DIST wcd-6.0.3.tar.gz 813763 BLAKE2B 
2e215c427914705213590d7c5182bebf39becbf24238bd71c5fdd12f7e63894b2ad571793f6d25833edd3f7cd4f3acbb07bbc821880c22d7a5d4f373cd972055
 SHA512 
b48a6f8a196725b4b570701813cf8a96e13e4fd6289b6c779218acc20ea1ea841e5f8648f717bb389976b715b95856e91bad3ffb20f8d80961d75eae8eacfbe8
+DIST wcd-6.0.4.tar.gz 935815 BLAKE2B 
00ec281890fe363258e0c847460ad9067f1c14409e64dfde239340ecf4f711af2047a8a1da226d4d17797e2b7452a4cd5aa65a0fcedcc2c172378d35a18a4a20
 SHA512 
afec27c0ca4cf7c7d24399f1f23c69ee765d57b449179696be5da82bcd6b146156254d9d1264e9c1f4905d5c117c7ac935a372aea25fa539b76c9bc866640daa

diff --git a/app-misc/wcd/files/wcd-6.0.4-gentoo.patch 
b/app-misc/wcd/files/wcd-6.0.4-gentoo.patch
new file mode 100644
index 000000000000..80fa5dc83ec4
--- /dev/null
+++ b/app-misc/wcd/files/wcd-6.0.4-gentoo.patch
@@ -0,0 +1,103 @@
+Patches build system.
+
+* Gentoo does not want pre-stripped files.
+* We do not want .exe files as the output
+* Gentoo packages curses, ncurses and ncursesw separately.
+  Therefore we need to get curses from pkg-config and include the correct path.
+
+
+Bug: https://bugs.gentoo.org/878585
+
+Signed-off-by: Pascal Jäger <[email protected]>
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -45,12 +45,12 @@
+
+ CC              ?= gcc
+ STATIC          =
+-STRIP           = strip
++STRIP           =
+
+ ENABLE_NLS = 1
+
+ PACKAGE         = wcd
+-EXT             = .exe
++EXT             =
+ PROGRAM         = $(PACKAGE)$(EXT)
+ BIN             = $(PROGRAM)
+
+@@ -328,9 +328,9 @@
+ # possible values: ncurses, curses, pdcurses, pdcursesw or <empty>
+
+ ifdef UCS
+-        CURSES = ncursesw
++        CURSES = $(shell ${PKG_CONFIG} --libs ncursesw)
+ else
+-        CURSES = ncurses
++        CURSES = $(shell ${PKG_CONFIG} --libs ncurses)
+ endif
+
+
+@@ -360,7 +360,7 @@
+
+ ifneq (,$(CURSES))
+         DEFS_CURSES = -DWCD_USECURSES
+-        LIB_CURSES  = -l$(CURSES)
++        LIB_CURSES  = $(CURSES)
+ ifeq (os/2,$(OS))
+         LIB_CURSES  += -ltinfo
+ endif
+@@ -458,15 +458,15 @@
+
+ LDFLAGS_USER   =
+ LDFLAGS ?=
+-LDFLAGS += $(RPM_LD_FLAGS) \
++LIBS   = $(RPM_LD_FLAGS) \
+            $(LDFLAGS_EXTRA) \
+            $(NLFLAG) \
+            $(LDFLAG_STATIC) \
+            $(LDFLAGS_USER)
+
+-LIBS = $(LIB_CURSES) \
+-       $(LIB_UNISTRING) \
+-       $(LIBS_EXTRA)
++LIBS += $(LIB_CURSES) \
++        $(LIB_UNISTRING) \
++        $(LIBS_EXTRA)
+
+ DEFS_USER   =
+ DEFS            = $(DEF_UNIX) $(DEFS_CURSES) $(EXTRA_DEFS) $(DEFS_USER)
+@@ -523,7 +523,7 @@
+
+ $(BIN): $(OBJS1)
+       $(MAKE) status
+-      $(CC) $(OBJS1) $(LDFLAGS) $(LIBS) -o $@
++      $(CC) $(LDFLAGS) $(OBJS1) -o $@ $(LIBS)
+
+ %.o: %.c
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(DEFS) -c $< -o $@
+diff --git a/src/Makefile b/src/Makefile
+index fc317de..c5cff96 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -359,7 +359,7 @@ endif
+ endif
+ 
+ ifneq (,$(CURSES))
+-        DEFS_CURSES = -DWCD_USECURSES
++        DEFS_CURSES = -DWCD_USECURSES $(shell ${PKG_CONFIG} 
--cflags-only-other ncursesw)
+         LIB_CURSES  = $(CURSES)
+ ifeq (os/2,$(OS))
+         LIB_CURSES  += -ltinfo
+@@ -384,9 +384,7 @@ endif
+ # Each ncurses variant has its own include directory
+ # ncurses (normal)/ncursesw (wide char)/ncursest (threads)
+ ifeq ($(findstring ncurses,$(CURSES)),ncurses)
+-ifneq ($(wildcard $(INCPREFIX)/include/$(CURSES)/curses.h),)
+-        INCFLAGS = -I$(INCPREFIX)/include/$(CURSES) -I$(INCPREFIX)/include
+-endif
++                              INCFLAGS = $(shell ${PKG_CONFIG} 
--cflags-only-I ncursesw)
+ ifeq ($(NCURSES_DEBUG), 1)
+         LIB_CURSES  = -l$(CURSES)_g
+ endif

diff --git a/app-misc/wcd/wcd-6.0.4.ebuild b/app-misc/wcd/wcd-6.0.4.ebuild
new file mode 100644
index 000000000000..39d96c97f6f1
--- /dev/null
+++ b/app-misc/wcd/wcd-6.0.4.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Wherever Change Directory"
+HOMEPAGE="http://waterlan.home.xs4all.nl/#WCD_ANCHOR";
+SRC_URI="http://waterlan.home.xs4all.nl/${PN}/${P}.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
+IUSE="nls unicode"
+
+RDEPEND="
+       sys-libs/ncurses:=[unicode(+)?]
+       unicode? ( dev-libs/libunistring:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       app-text/ghostscript-gpl
+       virtual/pkgconfig
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-6.0.4-gentoo.patch
+       "${FILESDIR}"/${PN}-6.0.3-doc-path.patch
+)
+
+src_prepare() {
+       default
+       tc-export CC PKG_CONFIG
+}
+
+src_compile() {
+       cd src || die
+       local mycompile="LFS=1"
+       use nls || mycompile+=" ENABLE_NLS="
+       use unicode && mycompile+=" UCS=1 UNINORM=1"
+       emake ${mycompile}
+}
+
+src_install() {
+       cd src || die
+       local DOCS=( ../README.txt )
+       default
+       emake DESTDIR="${ED}" DOTWCD=1 install-profile sysconfdir="/etc"
+}

Reply via email to