Ports with hardcoded "gcc", "g++"

classic Classic list List threaded Threaded
42 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Ports with hardcoded "gcc", "g++"

Christian Weisgerber
Ports are supposed to honor the CC and CXX variables.  (There are
some exceptions such as perl and imake ports that pick up a central
setting.)  They are not supposed to have hardcoded compiler names.
In particular they should not call "gcc" or "g++".  Alas, this has
never been strictly enfored, so numerous offenders have slipped in.

At least clang architectures will no longer have a /usr/bin/gcc or
/usr/bin/g++.

Fortunately, this is easy to test anywhere: just rm /usr/bin/gcc
and /usr/bin/g++.  You can hardlink them back afterwards.

Here is a first batch of ports that fail to build without "gcc" or
"g++" being present.  More will come to light eventually.  At the
moment, failing dependencies prevent about a third of the ports
tree from being built.

audio/goattracker
audio/mp3gain
biology/nutdb
chinese/crxvt
comms/colrdx
comms/owx
comms/zmtx-zmrx
converters/html2text
converters/lastools
converters/mimepp
devel/arm-none-eabi/gcc-linaro
devel/avr/gcc
devel/boost
devel/jsoncpp
devel/libutf
devel/premake4
devel/py-sip
devel/pysvn
devel/radare2/main
editors/tweak
emulators/sdlmame
emulators/sdlmess
games/blockrage
games/capitan-sevilla
games/einstein
games/gemdropx
games/icebreaker
games/netris
games/sdlpop
games/teeworlds
games/typespeed
graphics/s10sh
lang/ghc
lang/libv8
lang/mruby
lang/nim
lang/ocaml
lang/squeak/vm
mail/archiveopteryx
mail/bmf
math/aamath
math/libneural
math/libtommath
math/minisat
math/suitesparse
math/xspread
misc/figlet
misc/randtype
misc/xd
multimedia/avinfo
net/clog
net/ftpcopy
net/osrtspproxy
net/ssvnc
net/vncsnapshot
plan9/drawterm
plan9/plan9port
security/foremost
security/ipguard
security/p0f3
sysutils/incron
telephony/astmanproxy
textproc/heirloom-doctools
textproc/libxmlbird
textproc/pilot_makedoc
textproc/rman
textproc/wkhtmltopdf
www/cntlm
www/netsurf/netsurf-fb
www/phantomjs
www/swiggle
x11/goggles
x11/windowlab
x11/xmold

--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Antoine Jacoutot-7
On Sun, Feb 26, 2017 at 04:00:16PM +0100, Christian Weisgerber wrote:

> Ports are supposed to honor the CC and CXX variables.  (There are
> some exceptions such as perl and imake ports that pick up a central
> setting.)  They are not supposed to have hardcoded compiler names.
> In particular they should not call "gcc" or "g++".  Alas, this has
> never been strictly enfored, so numerous offenders have slipped in.
>
> At least clang architectures will no longer have a /usr/bin/gcc or
> /usr/bin/g++.
>
> Fortunately, this is easy to test anywhere: just rm /usr/bin/gcc
> and /usr/bin/g++.  You can hardlink them back afterwards.
>
> Here is a first batch of ports that fail to build without "gcc" or
> "g++" being present.  More will come to light eventually.  At the
> moment, failing dependencies prevent about a third of the ports
> tree from being built.

There's also Qt that hardcodes gcc and g++ IIRC (QMAKE_CC or something like
that in the default qmake.conf).

 

> audio/goattracker
> audio/mp3gain
> biology/nutdb
> chinese/crxvt
> comms/colrdx
> comms/owx
> comms/zmtx-zmrx
> converters/html2text
> converters/lastools
> converters/mimepp
> devel/arm-none-eabi/gcc-linaro
> devel/avr/gcc
> devel/boost
> devel/jsoncpp
> devel/libutf
> devel/premake4
> devel/py-sip
> devel/pysvn
> devel/radare2/main
> editors/tweak
> emulators/sdlmame
> emulators/sdlmess
> games/blockrage
> games/capitan-sevilla
> games/einstein
> games/gemdropx
> games/icebreaker
> games/netris
> games/sdlpop
> games/teeworlds
> games/typespeed
> graphics/s10sh
> lang/ghc
> lang/libv8
> lang/mruby
> lang/nim
> lang/ocaml
> lang/squeak/vm
> mail/archiveopteryx
> mail/bmf
> math/aamath
> math/libneural
> math/libtommath
> math/minisat
> math/suitesparse
> math/xspread
> misc/figlet
> misc/randtype
> misc/xd
> multimedia/avinfo
> net/clog
> net/ftpcopy
> net/osrtspproxy
> net/ssvnc
> net/vncsnapshot
> plan9/drawterm
> plan9/plan9port
> security/foremost
> security/ipguard
> security/p0f3
> sysutils/incron
> telephony/astmanproxy
> textproc/heirloom-doctools
> textproc/libxmlbird
> textproc/pilot_makedoc
> textproc/rman
> textproc/wkhtmltopdf
> www/cntlm
> www/netsurf/netsurf-fb
> www/phantomjs
> www/swiggle
> x11/goggles
> x11/windowlab
> x11/xmold
>
> --
> Christian "naddy" Weisgerber                          [hidden email]
>

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Stuart Henderson
In reply to this post by Christian Weisgerber
On 2017/02/26 16:00, Christian Weisgerber wrote:

> Ports are supposed to honor the CC and CXX variables.  (There are
> some exceptions such as perl and imake ports that pick up a central
> setting.)  They are not supposed to have hardcoded compiler names.
> In particular they should not call "gcc" or "g++".  Alas, this has
> never been strictly enfored, so numerous offenders have slipped in.
>
> At least clang architectures will no longer have a /usr/bin/gcc or
> /usr/bin/g++.
>
> Fortunately, this is easy to test anywhere: just rm /usr/bin/gcc
> and /usr/bin/g++.  You can hardlink them back afterwards.
>
> Here is a first batch of ports that fail to build without "gcc" or
> "g++" being present.  More will come to light eventually.  At the
> moment, failing dependencies prevent about a third of the ports
> tree from being built.

I've fixed a handful (mostly just adding CC="${CC}" and/or
CXX="${CXX}" to MAKE_FLAGS, though some needed more work)

> audio/mp3gain
> comms/zmtx-zmrx
> converters/html2text
> misc/figlet
> net/ssvnc
> net/vncsnapshot
> telephony/astmanproxy
> security/p0f3

...

These ones are most likely qmake-related

> devel/py-sip
> textproc/wkhtmltopdf
> www/phantomjs

..

> audio/goattracker
> biology/nutdb
> chinese/crxvt
> comms/colrdx
> comms/owx
> converters/lastools
> converters/mimepp
> devel/arm-none-eabi/gcc-linaro
> devel/avr/gcc
> devel/boost
> devel/jsoncpp
> devel/libutf
> devel/premake4
> devel/pysvn
> devel/radare2/main
> editors/tweak
> emulators/sdlmame
> emulators/sdlmess
> games/blockrage
> games/capitan-sevilla
> games/einstein
> games/gemdropx
> games/icebreaker
> games/netris
> games/sdlpop
> games/teeworlds
> games/typespeed
> graphics/s10sh
> lang/ghc
> lang/libv8
> lang/mruby
> lang/nim
> lang/ocaml
> lang/squeak/vm
> mail/archiveopteryx
> mail/bmf
> math/aamath
> math/libneural
> math/libtommath
> math/minisat
> math/suitesparse
> math/xspread
> misc/randtype
> misc/xd
> multimedia/avinfo
> net/clog
> net/ftpcopy
> net/osrtspproxy
> plan9/drawterm
> plan9/plan9port
> security/foremost
> security/ipguard
> sysutils/incron
> textproc/heirloom-doctools
> textproc/libxmlbird
> textproc/pilot_makedoc
> textproc/rman
> www/cntlm
> www/netsurf/netsurf-fb
> www/swiggle
> x11/goggles
> x11/windowlab
> x11/xmold
>
> --
> Christian "naddy" Weisgerber                          [hidden email]
>

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Jeremie Courreges-Anglas-2
Stuart Henderson <[hidden email]> writes:

> On 2017/02/26 16:00, Christian Weisgerber wrote:
>> Ports are supposed to honor the CC and CXX variables.  (There are
>> some exceptions such as perl and imake ports that pick up a central
>> setting.)  They are not supposed to have hardcoded compiler names.
>> In particular they should not call "gcc" or "g++".  Alas, this has
>> never been strictly enfored, so numerous offenders have slipped in.
>>
>> At least clang architectures will no longer have a /usr/bin/gcc or
>> /usr/bin/g++.
>>
>> Fortunately, this is easy to test anywhere: just rm /usr/bin/gcc
>> and /usr/bin/g++.  You can hardlink them back afterwards.
>>
>> Here is a first batch of ports that fail to build without "gcc" or
>> "g++" being present.  More will come to light eventually.  At the
>> moment, failing dependencies prevent about a third of the ports
>> tree from being built.
>
> I've fixed a handful (mostly just adding CC="${CC}" and/or
> CXX="${CXX}" to MAKE_FLAGS, though some needed more work)
>
>> audio/mp3gain
>> comms/zmtx-zmrx
>> converters/html2text
>> misc/figlet
>> net/ssvnc
>> net/vncsnapshot
>> telephony/astmanproxy
>> security/p0f3
>
> ...
>
> These ones are most likely qmake-related
>
>> devel/py-sip
>> textproc/wkhtmltopdf
>> www/phantomjs
>
> ..
>

Ports that should be fine now (fixed by various)

>> audio/goattracker
>> biology/nutdb
>> chinese/crxvt
>> comms/colrdx
>> comms/owx
>> converters/lastools
>> converters/mimepp

>> devel/jsoncpp
>> devel/libutf
>> devel/premake4
>> devel/pysvn
>> devel/radare2/main
>> editors/tweak

>> graphics/s10sh

>> mail/archiveopteryx
>> mail/bmf

>> math/aamath
>> math/libneural
>> math/libtommath
>> math/minisat
>> math/xspread

>> misc/randtype
>> misc/xd
>> multimedia/avinfo

>> net/osrtspproxy
>> plan9/drawterm

>> security/foremost
>> security/ipguard
>> sysutils/incron

>> textproc/rman

>> www/cntlm

>> x11/windowlab
>> x11/xmold


TODO
====

(There's a removal proposal pending for clog and pilot_makedoc.)

>> devel/arm-none-eabi/gcc-linaro
>> devel/avr/gcc
>> devel/boost

>> emulators/sdlmame
>> emulators/sdlmess
>> games/blockrage
>> games/capitan-sevilla
>> games/einstein
>> games/gemdropx
>> games/icebreaker
>> games/netris
>> games/sdlpop
>> games/teeworlds
>> games/typespeed

>> lang/ghc
>> lang/libv8
>> lang/mruby
>> lang/nim
>> lang/ocaml
>> lang/squeak/vm

>> math/suitesparse

XXX kill?
>> net/clog

>> net/ftpcopy

>> plan9/plan9port

>> textproc/heirloom-doctools
>> textproc/libxmlbird

XXX kill?
>> textproc/pilot_makedoc

>> www/netsurf/netsurf-fb
>> www/swiggle
>> x11/goggles

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Matthias Kilian
Hi,

On Mon, Feb 27, 2017 at 09:06:22PM +0100, Jeremie Courreges-Anglas wrote:
> TODO
> ====
[...]
> >> lang/ghc

This one is weird. It has "autodetection", but just setting CC="${CC}"
doesn't work, so I've added --with-ghc="${CC}", which seems to work
(with /usr/bin/gcc and /usr/bin/g++ removed). For the switch to
clang, I also added --with-clang="${CC}", but I've no idea wether
this will work or not.

Anyway, when my ghc build finishes sucessfully, I'll put the diff
below in.

Ciao,
        Kili

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/ghc/Makefile,v
retrieving revision 1.143
diff -u -p -r1.143 Makefile
--- Makefile 1 Nov 2016 18:14:05 -0000 1.143
+++ Makefile 27 Feb 2017 22:42:12 -0000
@@ -106,7 +106,9 @@ CFLAGS += -fno-pie
 
 CONFIGURE_STYLE = gnu
 CONFIGURE_ARGS += --with-iconv-includes=${LOCALBASE}/include \
- --with-iconv-libraries=${LOCALBASE}/lib
+ --with-iconv-libraries=${LOCALBASE}/lib \
+ --with-gcc="${CC}" \
+ --with-clang="${CC}"
 # XXX: wxneeded is a hack. Fix rts/Linker.c, mmapForLinker() and
 #      loadObj_() instead.
 CONFIGURE_ENV += CONF_CC_OPTS_STAGE0="-fno-pie -nopie" \
@@ -161,7 +163,9 @@ post-patch:
 # - Install a precompiled binary.
  cd ${WRKDIR}/ghc-${BIN_VER} && \
  LD_LIBRARY_PATH=${BOOTSTRAP_SHLIBS} \
- ./configure --prefix=${WRKDIR}/bootstrap && \
+ ./configure --prefix=${WRKDIR}/bootstrap \
+    --with-gcc="${CC}" \
+    --with-clang="${CC}" && \
  LD_LIBRARY_PATH=${BOOTSTRAP_SHLIBS} \
  ${MAKE_PROGRAM} install
  rm -rf ${WRKDIR}/ghc-${BIN_VER}

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Gleydson Soares-3
In reply to this post by Christian Weisgerber

> plan9/plan9port
fixed.

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Christian Weisgerber
In reply to this post by Christian Weisgerber
The fixes that have been committed have unlocked additional parts
of the ports tree, revealing new build failures.  Here is an updated
list.  I've added the MAINTAINERs.

archivers/hs-zlib   Matthias Kilian <[hidden email]>
audio/gogglesmm     The OpenBSD ports mailing-list <[hidden email]>
databases/hs-postgresql-libpq David Schaefer <[hidden email]>
databases/riak      Jonathan Matthew <[hidden email]>
devel/boost         Brad Smith <[hidden email]>
devel/cil           The OpenBSD ports mailing-list <[hidden email]>
devel/hs-bytestring-mmap Matthias Kilian <[hidden email]>
devel/hs-hinotify   The OpenBSD ports mailing-list <[hidden email]>
devel/hs-lifted-base Matthias Kilian <[hidden email]>
devel/hs-network    Matthias Kilian <[hidden email]>
devel/hs-old-time   Matthias Kilian <[hidden email]>
devel/hs-primitive  Jim Razmus II <[hidden email]>
devel/hs-readline   Matthias Kilian <[hidden email]>
devel/hs-regex-posix Matthias Kilian <[hidden email]>
devel/hs-unix-compat Jim Razmus II <[hidden email]>
devel/jdk/1.7       Kurt Miller <[hidden email]>
devel/libfmt        Markus Friedl <[hidden email]>
devel/ocaml-curses  The OpenBSD ports mailing-list <[hidden email]>
devel/py-sip        The OpenBSD ports mailing-list <[hidden email]>
devel/radare2/main  Edd Barrett <[hidden email]>
games/ioquake3      Aaron Bieber <[hidden email]>
games/roadfighter   The OpenBSD ports mailing-list <[hidden email]>
games/teeworlds     Donovan Watteau <[hidden email]>
games/tome4         Solene Rapenne <[hidden email]>
games/wordwarvi     Pascal Stumpf <[hidden email]>
geo/osm2go          The OpenBSD ports mailing-list <[hidden email]>
graphics/birdfont   Jasper Lievisse Adriaanse <[hidden email]>
graphics/hs-OpenGLRaw Matthias Kilian <[hidden email]>
lang/nim            The OpenBSD ports mailing-list <[hidden email]>
lang/squeak/vm      Marc Espie <[hidden email]>
misc/rocrail        Sebastian Reitenbach <[hidden email]>
misc/wmtimer        The OpenBSD ports mailing-list <[hidden email]>
net/clog            The OpenBSD ports mailing-list <[hidden email]>
net/dysnomia        The OpenBSD ports mailing-list <[hidden email]>
net/hs-curl         David Schaefer <[hidden email]>
net/hs-network-info David Schaefer <[hidden email]>
net/olsrd           Martin Reindl <[hidden email]>
net/pidgin          Brad Smith <[hidden email]>
net/spectrum-tools  The OpenBSD ports mailing-list <[hidden email]>
plan9/devdrawserver Gleydson Soares <[hidden email]>
productivity/wyrd   Okan Demirmen <[hidden email]>
security/hs-skein   The OpenBSD ports mailing-list <[hidden email]>
security/ssh-askpass-fullscreen The OpenBSD ports mailing-list <[hidden email]>
textproc/hs-libxml-sax David Coppa <[hidden email]>
textproc/pilot_makedoc The OpenBSD ports mailing-list <[hidden email]>
textproc/wkhtmltopdf Frank Groeneveld <[hidden email]>
www/iridium         Robert Nagy <[hidden email]>
www/phantomjs       Francisco de Borja Lopez Rio <[hidden email]>
x11/hs-X11          Matthias Kilian <[hidden email]>
x11/isomaster       Giovanni Bechis <[hidden email]>
x11/p5-Wx           The OpenBSD ports mailing-list <[hidden email]>
x11/qt3             Marc Espie <[hidden email]>
x11/qt4             Marc Espie <[hidden email]>
x11/roxterm         The OpenBSD ports mailing-list <[hidden email]>

--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Juan Francisco Cantero Hurtado
On Tue, Feb 28, 2017 at 01:03:38PM +0000, Christian Weisgerber wrote:
> The fixes that have been committed have unlocked additional parts
> of the ports tree, revealing new build failures.  Here is an updated
> list.  I've added the MAINTAINERs.
>
> lang/nim            The OpenBSD ports mailing-list <[hidden email]>

I've a patch for nim from two or three days ago. It builds the package
but I don't find where is the gcc command in the tests and I don't want
commit the changes without to run first the tests.

--
Juan Francisco Cantero Hurtado http://juanfra.info

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Gleydson Soares-3
In reply to this post by Christian Weisgerber
> The fixes that have been committed have unlocked additional parts
> of the ports tree, revealing new build failures.  Here is an updated
> list.  I've added the MAINTAINERs....
..
> plan9/devdrawserver Gleydson Soares <[hidden email]>

fixed.

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Frank Groeneveld
In reply to this post by Christian Weisgerber
On Tue, Feb 28, 2017, at 14:03, Christian Weisgerber wrote:
> textproc/wkhtmltopdf Frank Groeneveld <[hidden email]>

I've been trying to fix textporc/wkhtmltopdf in the last few days, but
can't seem to make qmake use the correct compiler. The do-configure step
of this port configures the patched QT that is part of the port. I've
tried adding CXX="${CXX}" and/or SYS_CXX="${CXX}" to the env of that
step, but it seems to be unused. Anybody got some hints on how to fix
this one?

Thanks!
Frank

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Stuart Henderson
On 2017/03/01 11:02, Frank Groeneveld wrote:

> On Tue, Feb 28, 2017, at 14:03, Christian Weisgerber wrote:
> > textproc/wkhtmltopdf Frank Groeneveld <[hidden email]>
>
> I've been trying to fix textporc/wkhtmltopdf in the last few days, but
> can't seem to make qmake use the correct compiler. The do-configure step
> of this port configures the patched QT that is part of the port. I've
> tried adding CXX="${CXX}" and/or SYS_CXX="${CXX}" to the env of that
> step, but it seems to be unused. Anybody got some hints on how to fix
> this one?
>
> Thanks!
> Frank
>

It gets further with this, build is still running so there might be
more needed.

Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/wkhtmltopdf/Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile
--- Makefile 13 Sep 2016 18:52:06 -0000 1.12
+++ Makefile 1 Mar 2017 12:12:09 -0000
@@ -39,7 +39,9 @@ LIB_DEPENDS = converters/libiconv \
 
 USE_GMAKE = Yes
 MAKE_FLAGS = LIBwkhtmltox_VERSION=${LIBwkhtmltox_VERSION}
-MAKE_ENV += WRKBUILD=${WRKBUILD}
+MAKE_ENV += WRKBUILD=${WRKBUILD} \
+ PORTS_CC="${CC}" PORTS_CXX="${CXX}"
+CONFIGURE_ENV = PORTS_CC="${CC}" PORTS_CXX="${CXX}"
 FAKE_FLAGS = INSTALL_ROOT=${WRKINST}${TRUEPREFIX}
 
 SEPARATE_BUILD = Yes
@@ -51,7 +53,7 @@ pre-patch:
  cd ${WRKDIR}/${DISTNAME} && mv ../qt-${QT_COMMIT} qt
 
 do-configure:
- mkdir ${WRKBUILD}/qt
+ mkdir -p ${WRKBUILD}/qt
  # qt config options taken from scripts/build.py
  cd ${WRKBUILD}/qt && \
  env -i ${CONFIGURE_ENV} ${WRKSRC}/qt/configure \
Index: patches/patch-qt_mkspecs_openbsd-g++_qmake_conf
===================================================================
RCS file: patches/patch-qt_mkspecs_openbsd-g++_qmake_conf
diff -N patches/patch-qt_mkspecs_openbsd-g++_qmake_conf
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-qt_mkspecs_openbsd-g++_qmake_conf 1 Mar 2017 12:12:09 -0000
@@ -0,0 +1,36 @@
+$OpenBSD$
+--- qt/mkspecs/openbsd-g++/qmake.conf.orig Wed Mar  1 12:02:31 2017
++++ qt/mkspecs/openbsd-g++/qmake.conf Wed Mar  1 12:03:23 2017
+@@ -8,7 +8,7 @@ TEMPLATE = app
+ CONFIG += qt warn_on release link_prl gdb_dwarf_index
+ QT += core gui
+
+-QMAKE_CC = gcc
++QMAKE_CC = ${CC}
+ QMAKE_LEX = flex
+ QMAKE_LEXFLAGS =
+ QMAKE_YACC = yacc
+@@ -24,7 +24,7 @@ QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB
+ QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+ QMAKE_CFLAGS_THREAD = -pthread
+
+-QMAKE_CXX = g++
++QMAKE_CXX = ${CXX}
+ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
+ QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
+ QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
+@@ -45,10 +45,10 @@ QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
+ QMAKE_INCDIR_OPENGL = /usr/X11R6/include
+ QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+-QMAKE_LINK = g++
+-QMAKE_LINK_SHLIB = g++
+-QMAKE_LINK_C = gcc
+-QMAKE_LINK_C_SHLIB = gcc
++QMAKE_LINK = $$QMAKE_CXX
++QMAKE_LINK_SHLIB = $$QMAKE_CXX
++QMAKE_LINK_C = $$QMAKE_CC
++QMAKE_LINK_C_SHLIB = $$QMAKE_CC
+ QMAKE_LINK_SHLIB_CMD = $$QMAKE_LINK_SHLIB $(LFLAGS) \
+ $$QMAKE_CFLAGS_SHLIB $$QMAKE_LFLAGS \
+ -o $(TARGETD) $(OBJECTS) $(OBJMOC) $(LIBS)

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Stuart Henderson
On 2017/03/01 12:12, Stuart Henderson wrote:

> On 2017/03/01 11:02, Frank Groeneveld wrote:
> > On Tue, Feb 28, 2017, at 14:03, Christian Weisgerber wrote:
> > > textproc/wkhtmltopdf Frank Groeneveld <[hidden email]>
> >
> > I've been trying to fix textporc/wkhtmltopdf in the last few days, but
> > can't seem to make qmake use the correct compiler. The do-configure step
> > of this port configures the patched QT that is part of the port. I've
> > tried adding CXX="${CXX}" and/or SYS_CXX="${CXX}" to the env of that
> > step, but it seems to be unused. Anybody got some hints on how to fix
> > this one?
> >
> > Thanks!
> > Frank
> >
>
> It gets further with this, build is still running so there might be
> more needed.

Oops, I forgot to re-run update-patches and had an old one. However unfortunately
not enough as linking fails.

Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/wkhtmltopdf/Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile
--- Makefile 13 Sep 2016 18:52:06 -0000 1.12
+++ Makefile 1 Mar 2017 14:13:39 -0000
@@ -39,7 +39,9 @@ LIB_DEPENDS = converters/libiconv \
 
 USE_GMAKE = Yes
 MAKE_FLAGS = LIBwkhtmltox_VERSION=${LIBwkhtmltox_VERSION}
-MAKE_ENV += WRKBUILD=${WRKBUILD}
+MAKE_ENV += WRKBUILD=${WRKBUILD} \
+ PORTS_CC="${CC}" PORTS_CXX="${CXX}"
+CONFIGURE_ENV = PORTS_CC="${CC}" PORTS_CXX="${CXX}"
 FAKE_FLAGS = INSTALL_ROOT=${WRKINST}${TRUEPREFIX}
 
 SEPARATE_BUILD = Yes
@@ -51,7 +53,7 @@ pre-patch:
  cd ${WRKDIR}/${DISTNAME} && mv ../qt-${QT_COMMIT} qt
 
 do-configure:
- mkdir ${WRKBUILD}/qt
+ mkdir -p ${WRKBUILD}/qt
  # qt config options taken from scripts/build.py
  cd ${WRKBUILD}/qt && \
  env -i ${CONFIGURE_ENV} ${WRKSRC}/qt/configure \
Index: patches/patch-qt_mkspecs_openbsd-g++_qmake_conf
===================================================================
RCS file: patches/patch-qt_mkspecs_openbsd-g++_qmake_conf
diff -N patches/patch-qt_mkspecs_openbsd-g++_qmake_conf
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-qt_mkspecs_openbsd-g++_qmake_conf 1 Mar 2017 14:13:39 -0000
@@ -0,0 +1,36 @@
+$OpenBSD$
+--- qt/mkspecs/openbsd-g++/qmake.conf.orig Tue May 10 09:19:52 2016
++++ qt/mkspecs/openbsd-g++/qmake.conf Wed Mar  1 12:07:44 2017
+@@ -8,7 +8,7 @@ TEMPLATE = app
+ CONFIG += qt warn_on release link_prl gdb_dwarf_index
+ QT += core gui
+
+-QMAKE_CC = gcc
++QMAKE_CC = ${PORTS_CC}
+ QMAKE_LEX = flex
+ QMAKE_LEXFLAGS =
+ QMAKE_YACC = yacc
+@@ -24,7 +24,7 @@ QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB
+ QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+ QMAKE_CFLAGS_THREAD = -pthread
+
+-QMAKE_CXX = g++
++QMAKE_CXX = ${PORTS_CXX}
+ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
+ QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
+ QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
+@@ -45,10 +45,10 @@ QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
+ QMAKE_INCDIR_OPENGL = /usr/X11R6/include
+ QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+-QMAKE_LINK = g++
+-QMAKE_LINK_SHLIB = g++
+-QMAKE_LINK_C = gcc
+-QMAKE_LINK_C_SHLIB = gcc
++QMAKE_LINK = $$QMAKE_CXX
++QMAKE_LINK_SHLIB = $$QMAKE_CXX
++QMAKE_LINK_C = $$QMAKE_CC
++QMAKE_LINK_C_SHLIB = $$QMAKE_CC
+ QMAKE_LINK_SHLIB_CMD = $$QMAKE_LINK_SHLIB $(LFLAGS) \
+ $$QMAKE_CFLAGS_SHLIB $$QMAKE_LFLAGS \
+ -o $(TARGETD) $(OBJECTS) $(OBJMOC) $(LIBS)

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Frank Groeneveld
On Wed, Mar 1, 2017, at 15:14, Stuart Henderson wrote:
> Oops, I forgot to re-run update-patches and had an old one. However
> unfortunately
> not enough as linking fails.
>

Thanks, that gets us a lot further indeed. The complete QT build
finished and now only the final linking step fails indeed.
For the interested, this is the command:

c++ -L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib -pthread
-shared -Wl,-soname,libwkhtmltox.so.0 -fPIC -o libwkhtmltox.so.0.0
loadsettings.o multipageloader.o tempfile.o converter.o websettings.o
reflect.o utilities.o pdfsettings.o pdfconverter.o outline.o
tocstylesheet.o imagesettings.o imageconverter.o pdf_c_bindings.o
image_c_bindings.o moc_multipageloader_p.o moc_converter_p.o
moc_pdfconverter_p.o moc_imageconverter_p.o moc_pdf_c_bindings_p.o
moc_image_c_bindings_p.o moc_converter.o moc_multipageloader.o
moc_utilities.o moc_pdfconverter.o moc_imageconverter.o
qrc_wkhtmltopdf.o    -L/usr/local/lib
-L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib
-L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/plugins/codecs
-lqcncodecs -L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib
-L/usr/local/lib -lqjpcodecs -lqkrcodecs -lqtwcodecs -lQtWebKit
-L/usr/X11R6/lib -lQtSvg -lQtXmlPatterns -lQtGui -ljpeg -lpng -lXrender
-lfontconfig -lfreetype -lXext -lX11 -lQtNetwork -lQtCore -lz -lm
-liconv
/usr/bin/ld: cannot find -lQtWebKit

Which seems weird to me, because:

$ ls /usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib
libQAxContainer.prl        libQtNetwork.a             libQtSvg.prl
libQAxServer.prl           libQtNetwork.la            libQtTest.a
libQt3Support.la           libQtNetwork.prl           libQtTest.la
libQt3Support.prl          libQtOpenGL.la             libQtTest.prl
libQtCore.a                libQtOpenGL.prl            libQtWebKit.la
libQtCore.la               libQtOpenVG.la             libQtWebKit.prl
libQtCore.prl              libQtOpenVG.prl            libQtXml.a
libQtDBus.la               libQtScript.la             libQtXml.la
libQtDBus.prl              libQtScript.prl            libQtXml.prl
libQtDeclarative.la        libQtScriptTools.la        libQtXmlPatterns.a
libQtDeclarative.prl       libQtScriptTools.prl      
libQtXmlPatterns.la
libQtGui.a                 libQtSql.a                
libQtXmlPatterns.prl
libQtGui.la                libQtSql.la                libpvrQWSWSEGL.prl
libQtGui.prl               libQtSql.prl               pkgconfig
libQtMultimedia.la         libQtSvg.a
libQtMultimedia.prl        libQtSvg.la

libQtWebkit seems to be there, right?

Frank

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Juan Francisco Cantero Hurtado
In reply to this post by Juan Francisco Cantero Hurtado
On Tue, Feb 28, 2017 at 07:11:48PM +0100, Juan Francisco Cantero Hurtado wrote:

> On Tue, Feb 28, 2017 at 01:03:38PM +0000, Christian Weisgerber wrote:
> > The fixes that have been committed have unlocked additional parts
> > of the ports tree, revealing new build failures.  Here is an updated
> > list.  I've added the MAINTAINERs.
> >
> > lang/nim            The OpenBSD ports mailing-list <[hidden email]>
>
> I've a patch for nim from two or three days ago. It builds the package
> but I don't find where is the gcc command in the tests and I don't want
> commit the changes without to run first the tests.

Everything is working now but I need help with something. Nim uses a
kind of compiler profiles, so we can't just add "${CC}" to the build, we
need to define the real compiler, i.e. gcc, egcc or clang. Now I'm using
an if/else conditional with MACHINE_ARCH to define the compiler but I
would like to use something like "if CLANG_ARCHS contains
MACHINE_ARCH...". I don't know how to write that. Any idea?.

--
Juan Francisco Cantero Hurtado http://juanfra.info

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Amit Kulkarni
In reply to this post by Frank Groeneveld
On Wed, Mar 1, 2017 at 10:10 AM, Frank Groeneveld
<[hidden email]> wrote:

> On Wed, Mar 1, 2017, at 15:14, Stuart Henderson wrote:
>> Oops, I forgot to re-run update-patches and had an old one. However
>> unfortunately
>> not enough as linking fails.
>>
>
> Thanks, that gets us a lot further indeed. The complete QT build
> finished and now only the final linking step fails indeed.
> For the interested, this is the command:
>
> c++ -L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib -pthread
> -shared -Wl,-soname,libwkhtmltox.so.0 -fPIC -o libwkhtmltox.so.0.0
> loadsettings.o multipageloader.o tempfile.o converter.o websettings.o
> reflect.o utilities.o pdfsettings.o pdfconverter.o outline.o
> tocstylesheet.o imagesettings.o imageconverter.o pdf_c_bindings.o
> image_c_bindings.o moc_multipageloader_p.o moc_converter_p.o
> moc_pdfconverter_p.o moc_imageconverter_p.o moc_pdf_c_bindings_p.o
> moc_image_c_bindings_p.o moc_converter.o moc_multipageloader.o
> moc_utilities.o moc_pdfconverter.o moc_imageconverter.o
> qrc_wkhtmltopdf.o    -L/usr/local/lib
> -L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib
> -L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/plugins/codecs
> -lqcncodecs -L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib
> -L/usr/local/lib -lqjpcodecs -lqkrcodecs -lqtwcodecs -lQtWebKit
> -L/usr/X11R6/lib -lQtSvg -lQtXmlPatterns -lQtGui -ljpeg -lpng -lXrender
> -lfontconfig -lfreetype -lXext -lX11 -lQtNetwork -lQtCore -lz -lm
> -liconv
> /usr/bin/ld: cannot find -lQtWebKit
>
> Which seems weird to me, because:
>
> $ ls /usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib
> libQAxContainer.prl        libQtNetwork.a             libQtSvg.prl
> libQAxServer.prl           libQtNetwork.la            libQtTest.a
> libQt3Support.la           libQtNetwork.prl           libQtTest.la
> libQt3Support.prl          libQtOpenGL.la             libQtTest.prl
> libQtCore.a                libQtOpenGL.prl            libQtWebKit.la
> libQtCore.la               libQtOpenVG.la             libQtWebKit.prl
> libQtCore.prl              libQtOpenVG.prl            libQtXml.a
> libQtDBus.la               libQtScript.la             libQtXml.la
> libQtDBus.prl              libQtScript.prl            libQtXml.prl
> libQtDeclarative.la        libQtScriptTools.la        libQtXmlPatterns.a
> libQtDeclarative.prl       libQtScriptTools.prl
> libQtXmlPatterns.la
> libQtGui.a                 libQtSql.a
> libQtXmlPatterns.prl
> libQtGui.la                libQtSql.la                libpvrQWSWSEGL.prl
> libQtGui.prl               libQtSql.prl               pkgconfig
> libQtMultimedia.la         libQtSvg.a
> libQtMultimedia.prl        libQtSvg.la
>
> libQtWebkit seems to be there, right?
>
>

libQtWebkit does not seem to be listed in /usr/ports/pobj, but the
others seem to be listed. I see QtNetwork is listed...

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Amit Kulkarni
On Wed, Mar 1, 2017 at 10:44 AM, Amit Kulkarni <[hidden email]> wrote:

> On Wed, Mar 1, 2017 at 10:10 AM, Frank Groeneveld
> <[hidden email]> wrote:
>> On Wed, Mar 1, 2017, at 15:14, Stuart Henderson wrote:
>>> Oops, I forgot to re-run update-patches and had an old one. However
>>> unfortunately
>>> not enough as linking fails.
>>>
>>
>> Thanks, that gets us a lot further indeed. The complete QT build
>> finished and now only the final linking step fails indeed.
>> For the interested, this is the command:
>>
>> c++ -L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib -pthread
>> -shared -Wl,-soname,libwkhtmltox.so.0 -fPIC -o libwkhtmltox.so.0.0
>> loadsettings.o multipageloader.o tempfile.o converter.o websettings.o
>> reflect.o utilities.o pdfsettings.o pdfconverter.o outline.o
>> tocstylesheet.o imagesettings.o imageconverter.o pdf_c_bindings.o
>> image_c_bindings.o moc_multipageloader_p.o moc_converter_p.o
>> moc_pdfconverter_p.o moc_imageconverter_p.o moc_pdf_c_bindings_p.o
>> moc_image_c_bindings_p.o moc_converter.o moc_multipageloader.o
>> moc_utilities.o moc_pdfconverter.o moc_imageconverter.o
>> qrc_wkhtmltopdf.o    -L/usr/local/lib
>> -L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib
>> -L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/plugins/codecs
>> -lqcncodecs -L/usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib
>> -L/usr/local/lib -lqjpcodecs -lqkrcodecs -lqtwcodecs -lQtWebKit
>> -L/usr/X11R6/lib -lQtSvg -lQtXmlPatterns -lQtGui -ljpeg -lpng -lXrender
>> -lfontconfig -lfreetype -lXext -lX11 -lQtNetwork -lQtCore -lz -lm
>> -liconv
>> /usr/bin/ld: cannot find -lQtWebKit
>>
>> Which seems weird to me, because:
>>
>> $ ls /usr/ports/pobj/wkhtmltopdf-0.12.3.2/build-amd64/qt/lib
>> libQAxContainer.prl        libQtNetwork.a             libQtSvg.prl
>> libQAxServer.prl           libQtNetwork.la            libQtTest.a
>> libQt3Support.la           libQtNetwork.prl           libQtTest.la
>> libQt3Support.prl          libQtOpenGL.la             libQtTest.prl
>> libQtCore.a                libQtOpenGL.prl            libQtWebKit.la
>> libQtCore.la               libQtOpenVG.la             libQtWebKit.prl
>> libQtCore.prl              libQtOpenVG.prl            libQtXml.a
>> libQtDBus.la               libQtScript.la             libQtXml.la
>> libQtDBus.prl              libQtScript.prl            libQtXml.prl
>> libQtDeclarative.la        libQtScriptTools.la        libQtXmlPatterns.a
>> libQtDeclarative.prl       libQtScriptTools.prl
>> libQtXmlPatterns.la
>> libQtGui.a                 libQtSql.a
>> libQtXmlPatterns.prl
>> libQtGui.la                libQtSql.la                libpvrQWSWSEGL.prl
>> libQtGui.prl               libQtSql.prl               pkgconfig
>> libQtMultimedia.la         libQtSvg.a
>> libQtMultimedia.prl        libQtSvg.la
>>
>> libQtWebkit seems to be there, right?
>>
>>
>
> libQtWebkit does not seem to be listed in /usr/ports/pobj, but the
> others seem to be listed. I see QtNetwork is listed...

I meant to say the .a file is missing for libQtWebkit

Thanks

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Stuart Henderson
In reply to this post by Juan Francisco Cantero Hurtado
On 2017/03/01 17:10, Juan Francisco Cantero Hurtado wrote:

> On Tue, Feb 28, 2017 at 07:11:48PM +0100, Juan Francisco Cantero Hurtado wrote:
> > On Tue, Feb 28, 2017 at 01:03:38PM +0000, Christian Weisgerber wrote:
> > > The fixes that have been committed have unlocked additional parts
> > > of the ports tree, revealing new build failures.  Here is an updated
> > > list.  I've added the MAINTAINERs.
> > >
> > > lang/nim            The OpenBSD ports mailing-list <[hidden email]>
> >
> > I've a patch for nim from two or three days ago. It builds the package
> > but I don't find where is the gcc command in the tests and I don't want
> > commit the changes without to run first the tests.
>
> Everything is working now but I need help with something. Nim uses a
> kind of compiler profiles, so we can't just add "${CC}" to the build, we
> need to define the real compiler, i.e. gcc, egcc or clang. Now I'm using
> an if/else conditional with MACHINE_ARCH to define the compiler but I
> would like to use something like "if CLANG_ARCHS contains
> MACHINE_ARCH...". I don't know how to write that. Any idea?.
>
> --
> Juan Francisco Cantero Hurtado http://juanfra.info
>

Ports should honour CC/CXX. Can you sed these into wherever the
compiler profile is defined?

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Juan Francisco Cantero Hurtado
On Wed, Mar 01, 2017 at 05:45:32PM +0000, Stuart Henderson wrote:

> On 2017/03/01 17:10, Juan Francisco Cantero Hurtado wrote:
> > On Tue, Feb 28, 2017 at 07:11:48PM +0100, Juan Francisco Cantero Hurtado wrote:
> > > On Tue, Feb 28, 2017 at 01:03:38PM +0000, Christian Weisgerber wrote:
> > > > The fixes that have been committed have unlocked additional parts
> > > > of the ports tree, revealing new build failures.  Here is an updated
> > > > list.  I've added the MAINTAINERs.
> > > >
> > > > lang/nim            The OpenBSD ports mailing-list <[hidden email]>
> > >
> > > I've a patch for nim from two or three days ago. It builds the package
> > > but I don't find where is the gcc command in the tests and I don't want
> > > commit the changes without to run first the tests.
> >
> > Everything is working now but I need help with something. Nim uses a
> > kind of compiler profiles, so we can't just add "${CC}" to the build, we
> > need to define the real compiler, i.e. gcc, egcc or clang. Now I'm using
> > an if/else conditional with MACHINE_ARCH to define the compiler but I
> > would like to use something like "if CLANG_ARCHS contains
> > MACHINE_ARCH...". I don't know how to write that. Any idea?.
> >
> > --
> > Juan Francisco Cantero Hurtado http://juanfra.info
> >
>
> Ports should honour CC/CXX. Can you sed these into wherever the
> compiler profile is defined?

No, because ${CC} is always "cc", not "gcc" or "clang".

We can't use a regex blindly to modify nim because it will give us
problems. Patching the code is even worse because the updates will be
harder and nim hasn't a maintainer.

They have a simple option to change the compilers but we need a variable
with the realname of the compiler, i.e. clang or gcc.

You can use "nim c -cc:clang" or "nim c -cc:gcc" (the default) or "nim c
-cc:egcc". All of them are the name of the profile, not the compiler
executable.

Here is the patch. It includes some adittional changes. If someone has
an better idea for the conditional... I'm listening :)


Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/nim/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile 9 Jan 2017 10:32:33 -0000 1.6
+++ Makefile 1 Mar 2017 19:55:21 -0000
@@ -5,6 +5,7 @@ ONLY_FOR_ARCHS = i386 amd64
 COMMENT = statically typed, imperative programming language
 
 VERSION = 0.16.0
+REVISION = 0
 DISTNAME = nim-${VERSION}
 EXTRACT_SUFX = .tar.xz
 
@@ -19,23 +20,28 @@ PERMIT_PACKAGE_CDROM = Yes
 
 WANTLIB = c m
 
+SUBST_VARS += CC
+
 post-patch:
  mkdir -p ${WRKSRC}/nimcache-port
  mkdir -p ${WRKSRC}/nimcache-port-test
  perl -i -pe "s#NIM_PORT_PATH#${PATH}#" ${WRKSRC}/koch.nim
  perl -i -pe "s#NIM_PORT_CACHE#${WRKSRC}/nimcache-port-test#" \
  ${WRKSRC}/koch.nim
+ ${SUBST_CMD} ${WRKSRC}/koch.nim ${WRKSRC}/tests/testament/tester.nim \
+ ${WRKSRC}/config/nim.cfg
 
 do-build:
  cd ${WRKSRC} && ${SETENV} CC="${CC}" LINKER="${CC}" \
  CFLAGS="${CFLAGS}" sh build.sh
  # slow machines can get a head of themselves and fail to link
- cd ${WRKSRC} && bin/nim c -d:release --parallelBuild:1 \
- --nimcache:"${WRKSRC}/nimcache-port" --listFullPaths \
- --listCmd --putenv:"PATH=${PATH}" koch
- cd ${WRKSRC} && ./koch boot -d:release --parallelBuild:1 \
- --nimcache:"${WRKSRC}/nimcache-port" --listFullPaths \
- --listCmd --putenv:"PATH=${PATH}"
+ cd ${WRKSRC} && bin/nim c -d:release --cc:${CC} --parallelBuild:1 \
+ --nimcache:"${WRKSRC}/nimcache-port" --listFullPaths --listCmd \
+ --putenv:"PATH=${PATH} CC=${CC} LINKER=${CC}" \
+ koch
+ cd ${WRKSRC} && ./koch boot -d:release --cc:${CC} --parallelBuild:1 \
+ --nimcache:"${WRKSRC}/nimcache-port" --listFullPaths --listCmd \
+ --putenv:"PATH=${PATH} CC=${CC} LINKER=${CC}"
 
 do-install:
  ${INSTALL_PROGRAM_DIR} ${PREFIX}/bin
@@ -49,9 +55,16 @@ do-install:
  ${INSTALL_DATA} ${WRKSRC}/config/*.cfg ${PREFIX}/share/examples/nim
 
 do-test:
- cd ${WRKSRC} && ${SETENV} ./koch test all -d:release \
- --parallelBuild:1 --listFullPaths --listCmd \
- --nimcache:"${WRKSRC}/nimcache-port-test" \
- --putenv:"PATH=${PATH}"
+ cd ${WRKSRC} && ${SETENV} ./koch test all -d:release --threads:on \
+ --cc:${CC} --parallelBuild:1 --listFullPaths --listCmd \
+ --passL:"-pthread -Wl,-rpath=.:/usr/local/lib:${WRKSRC}/nimcache-port-test/" \
+ --putenv:"PATH=${PATH} CC=${CC} LINKER=${CC}"
+
+# CC is always "cc". We need the real name.
+.if ${MACHINE_ARCH} == "amd64"
+CC = clang
+.elif
+CC = gcc
+.endif
 
 .include <bsd.port.mk>
Index: patches/patch-config_nim_cfg
===================================================================
RCS file: /cvs/ports/lang/nim/patches/patch-config_nim_cfg,v
retrieving revision 1.3
diff -u -p -r1.3 patch-config_nim_cfg
--- patches/patch-config_nim_cfg 9 Jan 2017 10:32:33 -0000 1.3
+++ patches/patch-config_nim_cfg 1 Mar 2017 19:55:21 -0000
@@ -1,6 +1,15 @@
 $OpenBSD: patch-config_nim_cfg,v 1.3 2017/01/09 10:32:33 juanfra Exp $
 --- config/nim.cfg.orig Sun Jan  8 21:33:42 2017
-+++ config/nim.cfg Mon Jan  9 02:28:32 2017
++++ config/nim.cfg Wed Mar  1 00:00:37 2017
+@@ -8,7 +8,7 @@
+ # Environment variables can be accessed like so:
+ #  gcc.path %= "$CC_PATH"
+
+-cc = gcc
++cc = ${CC}
+
+ # additional options always passed to the compiler:
+ --parallel_build: "0" # 0 to auto-detect number of processors
 @@ -76,7 +76,7 @@ path="$lib/pure"
    @end
    @if bsd or haiku:
@@ -19,7 +28,16 @@ $OpenBSD: patch-config_nim_cfg,v 1.3 201
  @end
 
  # Configuration for Objective-C compiler:
-@@ -155,18 +157,23 @@ clang.objc.options.linker = "-lobjc -lgnustep-base"
+@@ -135,6 +137,8 @@ clang.objc.options.linker = "-lobjc -lgnustep-base"
+ @if freebsd or openbsd or netbsd:
+   gcc.options.linker = "-Wl,-rpath=.:/usr/local/lib:/usr/pkg/lib:/usr/X11R6/lib"
+   gcc.cpp.options.linker = "-Wl,-rpath=.:/usr/local/lib:/usr/pkg/lib:/usr/X11R6/lib"
++  egcc.options.linker = "-Wl,-rpath=.:/usr/local/lib:/usr/pkg/lib:/usr/X11R6/lib"
++  egcc.cpp.options.linker = "-Wl,-rpath=.:/usr/local/lib:/usr/pkg/lib:/usr/X11R6/lib"
+   llvm_gcc.options.linker = "-Wl,-rpath=.:/usr/local/lib:/usr/pkg/lib:/usr/X11R6/lib"
+   llvm_gcc.cpp.options.linker = "-Wl,-rpath=.:/usr/local/lib:/usr/pkg/lib:/usr/X11R6/lib"
+   clang.options.linker = "-Wl,-rpath=.:/usr/local/lib:/usr/pkg/lib:/usr/X11R6/lib"
+@@ -155,18 +159,23 @@ clang.objc.options.linker = "-lobjc -lgnustep-base"
    gcc.options.linker %= "-L $WIND_BASE/target/lib/usr/lib/ppc/PPC32/common -mrtp -fno-strict-aliasing -D_C99 -D_HAS_C9X -std=c99 -fasm -Wall -Wno-write-strings"
  @end
 
@@ -45,7 +63,7 @@ $OpenBSD: patch-config_nim_cfg,v 1.3 201
  # Configuration for the LLVM GCC compiler:
  llvm_gcc.options.debug = "-g"
  llvm_gcc.options.always = "-w"
-@@ -176,7 +183,7 @@ llvm_gcc.options.size = "-Os"
+@@ -176,7 +185,7 @@ llvm_gcc.options.size = "-Os"
  # Configuration for the LLVM CLang compiler:
  clang.options.debug = "-g"
  clang.options.always = "-w"
Index: patches/patch-koch_nim
===================================================================
RCS file: /cvs/ports/lang/nim/patches/patch-koch_nim,v
retrieving revision 1.2
diff -u -p -r1.2 patch-koch_nim
--- patches/patch-koch_nim 9 Jan 2017 10:32:33 -0000 1.2
+++ patches/patch-koch_nim 1 Mar 2017 19:55:21 -0000
@@ -1,12 +1,19 @@
 $OpenBSD: patch-koch_nim,v 1.2 2017/01/09 10:32:33 juanfra Exp $
 --- koch.nim.orig Sun Jan  8 21:33:42 2017
-+++ koch.nim Mon Jan  9 03:15:50 2017
-@@ -393,7 +393,7 @@ proc tests(args: string) =
-   nimexec "cc --taintMode:on tests/testament/tester"
++++ koch.nim Tue Feb 28 23:20:42 2017
+@@ -390,12 +390,12 @@ template `|`(a, b): string = (if a.len > 0: a else: b)
+ proc tests(args: string) =
+   # we compile the tester with taintMode:on to have a basic
+   # taint mode test :-)
+-  nimexec "cc --taintMode:on tests/testament/tester"
++  nimexec "cc --taintMode:on --cc:${CC} tests/testament/tester"
    # Since tests take a long time (on my machine), and we want to defy Murhpys
    # law - lets make sure the compiler really is freshly compiled!
 -  nimexec "c --lib:lib -d:release --opt:speed compiler/nim.nim"
-+  nimexec "c --lib:lib -d:release --opt:speed --listFullPaths --listCmd --putenv:PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:: --nimcache:/usr/write-ports/pobj/nim-0.16.0/nim-0.16.0/nimcache-port-test compiler/nim.nim"
++  nimexec "c --lib:lib -d:release --cc:${CC} --opt:speed --listFullPaths --listCmd --putenv:PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:: --nimcache:/usr/write-ports/pobj/nim-0.16.0/nim-0.16.0/nimcache-port-test compiler/nim.nim"
    let tester = quoteShell(getCurrentDir() / "tests/testament/tester".exe)
-   let success = tryExec tester & " " & (args|"all")
+-  let success = tryExec tester & " " & (args|"all")
++  let success = tryExec tester & " --targets:c " & " " & (args|"all")
    if not existsEnv("TRAVIS") and not existsEnv("APPVEYOR"):
+     exec tester & " html"
+   if not success:
Index: patches/patch-tests_testament_tester_nim
===================================================================
RCS file: /cvs/ports/lang/nim/patches/patch-tests_testament_tester_nim,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tests_testament_tester_nim
--- patches/patch-tests_testament_tester_nim 9 Jan 2017 10:32:33 -0000 1.3
+++ patches/patch-tests_testament_tester_nim 1 Mar 2017 19:55:21 -0000
@@ -8,7 +8,7 @@ FAILURE
 Error 1 in . (Makefile:42 'do-test')"
 
 --- tests/testament/tester.nim.orig Sun Jan  8 21:33:43 2017
-+++ tests/testament/tester.nim Mon Jan  9 02:33:36 2017
++++ tests/testament/tester.nim Tue Feb 28 23:20:42 2017
 @@ -12,7 +12,7 @@
  import
    parseutils, strutils, pegs, os, osproc, streams, parsecfg, json,
@@ -18,6 +18,15 @@ Error 1 in . (Makefile:42 'do-test')"
 
  const
    resultsFile = "testresults.html"
+@@ -118,7 +118,7 @@ proc callCCompiler(cmdTemplate, filename, options: str
+                   target: TTarget): TSpec =
+   let c = parseCmdLine(cmdTemplate % ["target", targetToCmd[target],
+                        "options", options, "file", filename.quoteShell])
+-  var p = startProcess(command="gcc", args=c[5.. ^1],
++  var p = startProcess(command="${CC}", args=c[5.. ^1],
+                        options={poStdErrToStdOut, poUsePath})
+   let outp = p.outputStream
+   var x = newStringOfCap(120)
 @@ -326,7 +326,7 @@ proc testSpec(r: var TResults, test: TTest) =
        r.addResult(test, expected.outp, "executable not found", reExeNotFound)
        return

Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Stuart Henderson
On 2017/03/01 21:15, Juan Francisco Cantero Hurtado wrote:

> On Wed, Mar 01, 2017 at 05:45:32PM +0000, Stuart Henderson wrote:
> > On 2017/03/01 17:10, Juan Francisco Cantero Hurtado wrote:
> > > On Tue, Feb 28, 2017 at 07:11:48PM +0100, Juan Francisco Cantero Hurtado wrote:
> > > > On Tue, Feb 28, 2017 at 01:03:38PM +0000, Christian Weisgerber wrote:
> > > > > The fixes that have been committed have unlocked additional parts
> > > > > of the ports tree, revealing new build failures.  Here is an updated
> > > > > list.  I've added the MAINTAINERs.
> > > > >
> > > > > lang/nim            The OpenBSD ports mailing-list <[hidden email]>
> > > >
> > > > I've a patch for nim from two or three days ago. It builds the package
> > > > but I don't find where is the gcc command in the tests and I don't want
> > > > commit the changes without to run first the tests.
> > >
> > > Everything is working now but I need help with something. Nim uses a
> > > kind of compiler profiles, so we can't just add "${CC}" to the build, we
> > > need to define the real compiler, i.e. gcc, egcc or clang. Now I'm using
> > > an if/else conditional with MACHINE_ARCH to define the compiler but I
> > > would like to use something like "if CLANG_ARCHS contains
> > > MACHINE_ARCH...". I don't know how to write that. Any idea?.
> > >
> > > --
> > > Juan Francisco Cantero Hurtado http://juanfra.info
> > >
> >
> > Ports should honour CC/CXX. Can you sed these into wherever the
> > compiler profile is defined?
>
> No, because ${CC} is always "cc", not "gcc" or "clang".

${CC} is not always "cc", it can be set to something else. For example
if I do "scan-build make", it is /usr/local/bin/../libexec/ccc-analyzer.
It might be something else if I want to use distcc, etc.


Reply | Threaded
Open this post in threaded view
|

Re: Ports with hardcoded "gcc", "g++"

Frank Groeneveld
In reply to this post by Amit Kulkarni
On Wed, Mar 1, 2017, at 17:47, Amit Kulkarni wrote:
> I meant to say the .a file is missing for libQtWebkit
>
> Thanks
>

Found the cause and fixed it. Attached patch makes it build correctly
without g++/gcc.

Thanks again Stuart and Amit for the hints.

Frank

final.diff (4K) Download Attachment
123