Skip to content

Commit

Permalink
app-misc/wcd: version bump to 6.0.4, fix clang16 build
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/878585
Signed-off-by: Pascal Jäger <[email protected]>
Closes: gentoo#28201
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
Schievel1 authored and thesamesam committed Nov 15, 2022
1 parent a089700 commit e135b5b
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 0 deletions.
1 change: 1 addition & 0 deletions app-misc/wcd/Manifest
Original file line number Diff line number Diff line change
@@ -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
103 changes: 103 additions & 0 deletions app-misc/wcd/files/wcd-6.0.4-gentoo.patch
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions app-misc/wcd/wcd-6.0.4.ebuild
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit e135b5b

Please sign in to comment.