Re: net/swirc (3.3.5): 'WANTLIB' + 'CONFIGURE_ENV'

2022-07-30 Thread Omar Polo
Markus Uhlin  wrote:
> ok markus@
> :-)

committed with the REVISION bump i forgot in the diff :)



Re: net/swirc (3.3.5): 'WANTLIB' + 'CONFIGURE_ENV'

2022-07-30 Thread Markus Uhlin
ok markus@
:-)

On Sat, Jul 30, 2022 at 11:03:48AM +0200, Omar Polo wrote:
> Markus Uhlin  wrote:
> > Hi ports@
> > 
> > Starting from version 3.3.5 libiconv can be used so I added 'iconv' to
> > 'WANTLIB'.
> > 
> > Further in order for the configure script to find/recognize support
> > for libiconv and libintl setting 'CONFIGURE_ENV' seems to be
> > necessary.
> > 
> > I attach a diff.
> 
> your diff works for me, the configure manages to correctly pick up
> libiconv and use it.  However, while testing this i've noticed that:
> 
>  1. the build doesn't show the commands being executed and
>  2. the build ignores our CFLAGS
> 
> diff below builds on top of yours and fixes the these points too, ok?
> 
> Index: Makefile
> ===
> RCS file: /home/cvs/ports/net/swirc/Makefile,v
> retrieving revision 1.17
> diff -u -p -r1.17 Makefile
> --- Makefile  29 Jul 2022 16:44:06 -  1.17
> +++ Makefile  30 Jul 2022 08:55:51 -
> @@ -9,16 +9,26 @@ MAINTAINER =Markus Uhlin   PERMIT_PACKAGE = Yes
>  
>  # uses pledge()
> -WANTLIB =${COMPILER_LIBCXX} c crypto curl curses idn intl m 
> panel pthread ssl
> +WANTLIB =${COMPILER_LIBCXX} c crypto curl curses iconv idn intl \
> + m panel pthread ssl
>  
>  MASTER_SITES =   https://www.nifty-networks.net/swirc/releases/
>  EXTRACT_SUFX =   .tgz
> +
> +# C++17
>  COMPILER =   base-clang ports-gcc
> +
>  BUILD_DEPENDS =  devel/gettext,-tools
>  LIB_DEPENDS =devel/gettext,-runtime \
>   devel/libidn \
>   net/curl
> +
> +CFLAGS +=-I${LOCALBASE}/include
> +LDFLAGS +=   -L${LOCALBASE}/lib
> +
>  CONFIGURE_STYLE =simple
> +CONFIGURE_ENV += CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
> + LDFLAGS="${LDFLAGS}"
>  
>  TEST_DEPENDS =   devel/cmocka
>  TEST_TARGET =check
> @@ -27,5 +37,8 @@ MAKE_FLAGS =DEST_CONFMAN=${WRKINST}${P
>   DEST_MANUAL=${WRKINST}${PREFIX}/man/man1 \
>   INSTALL_DEPS=swirc src/swirc.1 swirc.conf.5 \
>   PREFIX="${PREFIX}" CC="${CC}" CXX="${CXX}"
> +
> +# show the commands being executed
> +MAKE_FLAGS +=E=@true Q=''
>  
>  .include 
> Index: patches/patch-posixshell_os_BSD_sh
> ===
> RCS file: patches/patch-posixshell_os_BSD_sh
> diff -N patches/patch-posixshell_os_BSD_sh
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ patches/patch-posixshell_os_BSD_sh30 Jul 2022 08:57:35 -
> @@ -0,0 +1,22 @@
> +propagate cflags and neuter hardcoded optimizations
> +
> +Index: posixshell/os_BSD.sh
> +--- posixshell/os_BSD.sh.orig
>  posixshell/os_BSD.sh
> +@@ -9,13 +9,11 @@ SHARED_FLAGS=-DBSD=1\\
> + -DUNIX=1\\
> + -D_XOPEN_SOURCE_EXTENDED=1\\
> + -I/usr/local/include\\
> +--O2\\
> +--Wall\\
> +--pipe
> ++-Wall
> + CC=cc
> +-CFLAGS=\$(SHARED_FLAGS) -std=c17
> ++CFLAGS=\$(SHARED_FLAGS) -std=c17 ${CFLAGS}
> + CXX=c++
> +-CXXFLAGS=\$(SHARED_FLAGS) -std=c++17
> ++CXXFLAGS=\$(SHARED_FLAGS) -std=c++17 ${CXXFLAGS}
> + LDFLAGS=-L/usr/local/lib
> + LDLIBS=-lcrypto\\
> + -lcurl\\
> 



Re: net/swirc (3.3.5): 'WANTLIB' + 'CONFIGURE_ENV'

2022-07-30 Thread Omar Polo
Markus Uhlin  wrote:
> Hi ports@
> 
> Starting from version 3.3.5 libiconv can be used so I added 'iconv' to
> 'WANTLIB'.
> 
> Further in order for the configure script to find/recognize support
> for libiconv and libintl setting 'CONFIGURE_ENV' seems to be
> necessary.
> 
> I attach a diff.

your diff works for me, the configure manages to correctly pick up
libiconv and use it.  However, while testing this i've noticed that:

 1. the build doesn't show the commands being executed and
 2. the build ignores our CFLAGS

diff below builds on top of yours and fixes the these points too, ok?

Index: Makefile
===
RCS file: /home/cvs/ports/net/swirc/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- Makefile29 Jul 2022 16:44:06 -  1.17
+++ Makefile30 Jul 2022 08:55:51 -
@@ -9,16 +9,26 @@ MAINTAINER =  Markus Uhlin https://www.nifty-networks.net/swirc/releases/
 EXTRACT_SUFX = .tgz
+
+# C++17
 COMPILER = base-clang ports-gcc
+
 BUILD_DEPENDS =devel/gettext,-tools
 LIB_DEPENDS =  devel/gettext,-runtime \
devel/libidn \
net/curl
+
+CFLAGS +=  -I${LOCALBASE}/include
+LDFLAGS += -L${LOCALBASE}/lib
+
 CONFIGURE_STYLE =  simple
+CONFIGURE_ENV +=   CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
+   LDFLAGS="${LDFLAGS}"
 
 TEST_DEPENDS = devel/cmocka
 TEST_TARGET =  check
@@ -27,5 +37,8 @@ MAKE_FLAGS =  DEST_CONFMAN=${WRKINST}${P
DEST_MANUAL=${WRKINST}${PREFIX}/man/man1 \
INSTALL_DEPS=swirc src/swirc.1 swirc.conf.5 \
PREFIX="${PREFIX}" CC="${CC}" CXX="${CXX}"
+
+# show the commands being executed
+MAKE_FLAGS +=  E=@true Q=''
 
 .include 
Index: patches/patch-posixshell_os_BSD_sh
===
RCS file: patches/patch-posixshell_os_BSD_sh
diff -N patches/patch-posixshell_os_BSD_sh
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-posixshell_os_BSD_sh  30 Jul 2022 08:57:35 -
@@ -0,0 +1,22 @@
+propagate cflags and neuter hardcoded optimizations
+
+Index: posixshell/os_BSD.sh
+--- posixshell/os_BSD.sh.orig
 posixshell/os_BSD.sh
+@@ -9,13 +9,11 @@ SHARED_FLAGS=-DBSD=1\\
+   -DUNIX=1\\
+   -D_XOPEN_SOURCE_EXTENDED=1\\
+   -I/usr/local/include\\
+-  -O2\\
+-  -Wall\\
+-  -pipe
++  -Wall
+ CC=cc
+-CFLAGS=\$(SHARED_FLAGS) -std=c17
++CFLAGS=\$(SHARED_FLAGS) -std=c17 ${CFLAGS}
+ CXX=c++
+-CXXFLAGS=\$(SHARED_FLAGS) -std=c++17
++CXXFLAGS=\$(SHARED_FLAGS) -std=c++17 ${CXXFLAGS}
+ LDFLAGS=-L/usr/local/lib
+ LDLIBS=-lcrypto\\
+   -lcurl\\



net/swirc (3.3.5): 'WANTLIB' + 'CONFIGURE_ENV'

2022-07-29 Thread Markus Uhlin
Hi ports@

Starting from version 3.3.5 libiconv can be used so I added 'iconv' to
'WANTLIB'.

Further in order for the configure script to find/recognize support
for libiconv and libintl setting 'CONFIGURE_ENV' seems to be
necessary.

I attach a diff.

Markus
Index: Makefile
===
RCS file: /cvs/ports/net/swirc/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- Makefile29 Jul 2022 16:44:06 -  1.17
+++ Makefile29 Jul 2022 22:04:11 -
@@ -9,7 +9,8 @@ MAINTAINER =Markus Uhlin https://www.nifty-networks.net/swirc/releases/
 EXTRACT_SUFX = .tgz
@@ -18,6 +19,10 @@ BUILD_DEPENDS =  devel/gettext,-tools
 LIB_DEPENDS =  devel/gettext,-runtime \
devel/libidn \
net/curl
+
+CONFIGURE_ENV +=   CFLAGS="-I${LOCALBASE}/include" \
+   CXXFLAGS="-I${LOCALBASE}/include" \
+   LDFLAGS="-L${LOCALBASE}/lib"
 CONFIGURE_STYLE =  simple
 
 TEST_DEPENDS = devel/cmocka