pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bsddialog: fix the build on macOS



Module Name:	pkgsrc-wip
Committed By:	Pierre Pronchery <khorben%defora.org@localhost>
Pushed By:	khorben
Date:		Thu Dec 5 01:19:07 2024 +0100
Changeset:	1ba90cfc608c0b34572df1b08fb0a7fa0734d296

Modified Files:
	bsddialog/Makefile
	bsddialog/distinfo
	bsddialog/patches/patch-lib_Makefile
	bsddialog/patches/patch-utility_Makefile
	bsddialog/patches/patch-utility_util__builders.c

Log Message:
bsddialog: fix the build on macOS

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1ba90cfc608c0b34572df1b08fb0a7fa0734d296

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 bsddialog/Makefile                               | 18 ++++++++++++++++++
 bsddialog/distinfo                               |  6 +++---
 bsddialog/patches/patch-lib_Makefile             | 19 +++++++++++++++----
 bsddialog/patches/patch-utility_Makefile         |  8 ++++----
 bsddialog/patches/patch-utility_util__builders.c |  2 +-
 5 files changed, 41 insertions(+), 12 deletions(-)

diffs:
diff --git a/bsddialog/Makefile b/bsddialog/Makefile
index fcd194976e..aebfd5189f 100644
--- a/bsddialog/Makefile
+++ b/bsddialog/Makefile
@@ -17,9 +17,27 @@ WRKSRC=		${WRKDIR}/bsddialog-${GITLAB_TAG}
 
 USE_CURSES=	wide
 
+.include "../../mk/bsd.prefs.mk"
+
+.if ${SHLIB_TYPE} == "dylib"
+SOEXT=		dylib
+LDFLAGS+=	-Wl,-install_name,${PREFIX}/lib/libbsddialog.${BSDDIALOG_VERSION}.${SOEXT}
+.else
+SOEXT=		so
+.endif
+
 MAKE_FLAGS+=	DESTDIR=${DESTDIR}
 MAKE_FLAGS+=	PREFIX=${PREFIX}
+MAKE_FLAGS+=	SOEXT=${SOEXT}
 AUTO_MKDIRS=	yes
 
+.if ${SHLIB_TYPE} == "dylib"
+post-install:
+	${LN} -sf libbsddialog.${BSDDIALOG_VERSION}.${SOEXT} \
+		${DESTDIR}${PREFIX}/lib/libbsddialog.${SOEXT}
+	${MV} ${DESTDIR}${PREFIX}/lib/libbsddialog.${SOEXT}.${BSDDIALOG_VERSION} \
+		${DESTDIR}${PREFIX}/lib/libbsddialog.${BSDDIALOG_VERSION}.${SOEXT}
+.endif
+
 .include "../../mk/curses.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/bsddialog/distinfo b/bsddialog/distinfo
index b3dd373412..1e18ccc030 100644
--- a/bsddialog/distinfo
+++ b/bsddialog/distinfo
@@ -4,6 +4,6 @@ BLAKE2s (bsddialog-1.0.4.tar.gz) = 44fe9cf0b05a2ea3a003093debb77a6ad890774ce98fd
 SHA512 (bsddialog-1.0.4.tar.gz) = 317ee8c7f69e7e24cc70b0e701c25b17b744aa606cb60ca9a67d756856a253a0fee231f05b55b187400c2f98cfbc464640f75457513cbeebb17aea3dd9057772
 Size (bsddialog-1.0.4.tar.gz) = 87327 bytes
 SHA1 (patch-lib_GNUmakefile) = 5e97c44570ea93a6f476920b6404432128d0952c
-SHA1 (patch-lib_Makefile) = d8a425fe756d15bab356c09856a44270637b36e0
-SHA1 (patch-utility_Makefile) = 08247e044594740830c8c418a3e54d31dd7b44d5
-SHA1 (patch-utility_util__builders.c) = 166e97b4eef7f02e1305a84b7efbaae84505596a
+SHA1 (patch-lib_Makefile) = fdb72d546afeca668bd3cdc5fce7caf5e30d8b12
+SHA1 (patch-utility_Makefile) = 8d2c027720f90dcd7ab5c7c7e760c1f2bdf36125
+SHA1 (patch-utility_util__builders.c) = 40e8ff0aec35aa2452069c0572d9c2bcaef971d4
diff --git a/bsddialog/patches/patch-lib_Makefile b/bsddialog/patches/patch-lib_Makefile
index 128b35aca8..879c3a1403 100644
--- a/bsddialog/patches/patch-lib_Makefile
+++ b/bsddialog/patches/patch-lib_Makefile
@@ -1,12 +1,23 @@
 $NetBSD$
 
-Fix the build on NetBSD
+Fix the build on NetBSD and macOS
 
 Also install bsddialog_theme.h
 
 --- lib/Makefile.orig	2024-12-02 18:36:02.000000000 +0000
 +++ lib/Makefile
-@@ -15,11 +15,8 @@ PREFIX = /usr/local
+@@ -3,8 +3,9 @@
+ #
+ # Written in 2021 by Alfonso Sabato Siciliano
+ 
++SOEXT = so
+ LIBRARY = bsddialog
+-LIBRARY_SO = lib${LIBRARY:=.so}
++LIBRARY_SO = lib${LIBRARY:=.${SOEXT}}
+ LIBRARY_A = lib${LIBRARY:=.a}
+ HEADERS = bsddialog.h bsddialog_theme.h bsddialog_progressview.h
+ SOURCES = barbox.c datebox.c formbox.c libbsddialog.c lib_util.c \
+@@ -15,11 +16,8 @@ PREFIX = /usr/local
  .if defined(DEBUG)
  CFLAGS += -g
  .endif
@@ -20,7 +31,7 @@ Also install bsddialog_theme.h
  
  LN = ln -s -f
  RM = rm -f
-@@ -29,6 +26,7 @@ all: ${LIBRARY}
+@@ -29,6 +27,7 @@ all: ${LIBRARY}
  install: all
  	${INSTALL} -m 0644 bsddialog.h ${DESTDIR}${PREFIX}/include/bsddialog.h
  	${INSTALL} -m 0644 bsddialog_progressview.h ${DESTDIR}${PREFIX}/include/bsddialog_progressview.h
@@ -28,7 +39,7 @@ Also install bsddialog_theme.h
  	${INSTALL} -m 0644 ${LIBRARY_A} ${DESTDIR}${PREFIX}/lib/${LIBRARY_A}
  	${INSTALL} -m 0755 ${LIBRARY_SO}.${VERSION} ${DESTDIR}${PREFIX}/lib/${LIBRARY_SO}.${VERSION}
  	${LN} ${LIBRARY_SO}.${VERSION} ${DESTDIR}${PREFIX}/lib/${LIBRARY_SO}
-@@ -36,6 +34,7 @@ install: all
+@@ -36,6 +35,7 @@ install: all
  uninstall:
  	${RM} ${DESTDIR}${PREFIX}/include/bsddialog.h
  	${RM} ${DESTDIR}${PREFIX}/include/bsddialog_progressview.h
diff --git a/bsddialog/patches/patch-utility_Makefile b/bsddialog/patches/patch-utility_Makefile
index e5950ce0c3..98aed7fd59 100644
--- a/bsddialog/patches/patch-utility_Makefile
+++ b/bsddialog/patches/patch-utility_Makefile
@@ -1,18 +1,18 @@
 $NetBSD$
 
-Fix the build on NetBSD
+Fix the build on NetBSD and macOS
 
---- utility/Makefile.orig	2024-12-03 22:19:17.670467040 +0000
+--- utility/Makefile.orig	2024-12-02 18:36:02.000000000 +0000
 +++ utility/Makefile
 @@ -14,9 +14,9 @@ CFLAGS += -g
  CFLAGS += -I${LIBPATH} -std=gnu99 -Wall -Wextra -Werror
  
  .if defined(NORPATH)
 -LDFLAGS += -ltinfow -L${LIBPATH} -lbsddialog
-+LDFLAGS += -L${LIBPATH} -lbsddialog
++LDFLAGS += -L${LIBPATH} -lcurses -lbsddialog
  .else
 -LDFLAGS += -ltinfow -Wl,-rpath=${LIBPATH} -L${LIBPATH} -lbsddialog
-+LDFLAGS += -Wl,-rpath=${LIBPATH} -L${LIBPATH} -lbsddialog
++LDFLAGS += -Wl,-rpath=${LIBPATH} -L${LIBPATH} -lcurses -lbsddialog
  .endif
  
  INSTALL = install
diff --git a/bsddialog/patches/patch-utility_util__builders.c b/bsddialog/patches/patch-utility_util__builders.c
index 1af46e6852..4d2ad268c2 100644
--- a/bsddialog/patches/patch-utility_util__builders.c
+++ b/bsddialog/patches/patch-utility_util__builders.c
@@ -2,7 +2,7 @@ $NetBSD$
 
 Portability fix
 
---- utility/util_builders.c.orig	2024-12-03 23:51:29.672563271 +0000
+--- utility/util_builders.c.orig	2024-12-02 18:36:02.000000000 +0000
 +++ utility/util_builders.c
 @@ -82,7 +82,7 @@ int gauge_builder(BUILDER_ARGS)
  


Home | Main Index | Thread Index | Old Index