Re: education/gamgi: set "-fcommon", update to 0.17.3g

2021-02-20 Thread Christian Weisgerber
Klemens Nanni:

> > That's a hint that it's defined in a header file that is included
> > everywhere.  You just need to mark it extern and copy the definition
> > into a *.c file.
> Right, but if I mark that symbol `extern' others now show up as well:

I see.  There are a lot of tables that are defined in a handful of
*.c files and the declaration in the corresponding *.h files is
missing an "extern".  That's straightforward to fix...

> I don't want to patch all of those.

... but it affects 700 variables or so.  I guess -fcommon is the
pragmatic solution.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: education/gamgi: set "-fcommon", update to 0.17.3g

2021-02-19 Thread Klemens Nanni
On Fri, Feb 19, 2021 at 01:27:42PM +0100, Christian Weisgerber wrote:
> Klemens Nanni:
> 
> > I went the easy way just like Debian did;  the update itself did not
> > change "-fno-common" behaviour, i.e. it's the same twenty files that
> > clash on the `gamgi' symbol.
> 
> That's a hint that it's defined in a header file that is included
> everywhere.  You just need to mark it extern and copy the definition
> into a *.c file.
Right, but if I mark that symbol `extern' others now show up as well:

$ make build 2>&1 | grep 'duplicate symbol'
ld: error: duplicate symbol: gamgi_chem_property_color
ld: error: duplicate symbol: gamgi_chem_property_ionic
ld: error: duplicate symbol: gamgi_chem_property_ionic_driver
ld: error: duplicate symbol: gamgi_chem_property_mass
ld: error: duplicate symbol: gamgi_chem_property_mass_driver
ld: error: duplicate symbol: gamgi_chem_property_radius
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_1
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_10
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_100
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_101
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_102
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_103
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_104
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_105
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_106
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_107
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_108
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_109
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_11
ld: error: duplicate symbol: gamgi_phys_symmetry_driver_110

I don't want to patch all of those.


> > +# avoid patching twenty occurence of "ld: error: duplicate symbol: gamgi"
> > +COPTS +=   -fcommon
> 
> It's never been quite clear to me how COPTS is to be used, but we
> do not use it in the ports tree.
bsd.port.mk(5) mentions `COPTS' just like `CFLAGS', would you want to
unmention it there?



Re: education/gamgi: set "-fcommon", update to 0.17.3g

2021-02-19 Thread Christian Weisgerber
Klemens Nanni:

> I went the easy way just like Debian did;  the update itself did not
> change "-fno-common" behaviour, i.e. it's the same twenty files that
> clash on the `gamgi' symbol.

That's a hint that it's defined in a header file that is included
everywhere.  You just need to mark it extern and copy the definition
into a *.c file.

> +# avoid patching twenty occurence of "ld: error: duplicate symbol: gamgi"
> +COPTS += -fcommon

It's never been quite clear to me how COPTS is to be used, but we
do not use it in the ports tree.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



education/gamgi: set "-fcommon", update to 0.17.3g

2021-02-19 Thread Klemens Nanni
http://www.gamgi.org/changelogs/changelogs.html

Repology lists a bunch of other Debian (based) distributions building
this tool, FreeBSD is not on the list, FWIW.

I went the easy way just like Debian did;  the update itself did not
change "-fno-common" behaviour, i.e. it's the same twenty files that
clash on the `gamgi' symbol.

gamgi starts fine and I can model basic things like orbitals, but that's
all I tested.

Feedback? OK?

Index: Makefile
===
RCS file: /cvs/ports/education/gamgi/Makefile,v
retrieving revision 1.21
diff -u -p -r1.21 Makefile
--- Makefile12 Jul 2019 20:46:07 -  1.21
+++ Makefile19 Feb 2021 02:34:38 -
@@ -2,7 +2,7 @@
 
 COMMENT=   General Atomistic Modelling Graphic Interface
 
-V= 0.15.5
+V= 0.17.3g
 DISTNAME=  gamgi-all-${V}
 PKGNAME=   ${DISTNAME:S/-all//}
 CATEGORIES=education x11
@@ -12,9 +12,14 @@ HOMEPAGE=http://www.gamgi.org/
 # GPLv2
 PERMIT_PACKAGE=Yes
 
-MASTER_SITES=  ftp://ftp.gamgi.org/gamgi/src/
+MASTER_SITES=  http://atom.ist.utl.pt/src/ \
+   http://gamgi.ist.utl.pt/src/ \
+   ftp://atom.ist.utl.pt/src/
 
 USE_GMAKE= Yes
+
+# avoid patching twenty occurence of "ld: error: duplicate symbol: gamgi"
+COPTS +=   -fcommon
 
 WANTLIB += GL GLU X11 Xext Xi Xmu atk-1.0 c cairo expat freetype
 WANTLIB += gdk-x11-2.0 gdk_pixbuf-2.0 glib-2.0 gmodule-2.0 gobject-2.0
Index: distinfo
===
RCS file: /cvs/ports/education/gamgi/distinfo,v
retrieving revision 1.11
diff -u -p -r1.11 distinfo
--- distinfo18 Jan 2015 03:13:51 -  1.11
+++ distinfo19 Feb 2021 02:13:35 -
@@ -1,2 +1,2 @@
-SHA256 (gamgi-all-0.15.5.tar.gz) = q0lT9RPQAJxOmr0pK+wRETscf7VLuCd7viod14WU7+Q=
-SIZE (gamgi-all-0.15.5.tar.gz) = 2180662
+SHA256 (gamgi-all-0.17.3g.tar.gz) = 
WkbgGhMU3mn77FhWyPbwQQnxUgNYD6bSX5cTJF5MzEw=
+SIZE (gamgi-all-0.17.3g.tar.gz) = 2575304
Index: patches/patch-src-make_local
===
RCS file: /cvs/ports/education/gamgi/patches/patch-src-make_local,v
retrieving revision 1.7
diff -u -p -r1.7 patch-src-make_local
--- patches/patch-src-make_local29 Dec 2019 23:56:58 -  1.7
+++ patches/patch-src-make_local19 Feb 2021 02:21:27 -
@@ -1,8 +1,11 @@
 $OpenBSD: patch-src-make_local,v 1.7 2019/12/29 23:56:58 ajacoutot Exp $
+
+Set include and library paths.
+
 Index: src/make_local
 --- src/make_local.orig
 +++ src/make_local
-@@ -70,29 +70,29 @@ PATH_GTKGL_L =-L/usr/lib
+@@ -80,29 +80,29 @@ PATH_GTKGL_L =-L/usr/lib
  
  #= OpenBSD 
=
  #
@@ -14,11 +17,23 @@ Index: src/make_local
 -# PATH_PANGO_H = -I/usr/local/include/pango-2.0
 -# PATH_ATK_H = -I/usr/local/include/atk-2.0
 -# PATH_GTK_H =  -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include 
\
--#  -I/usr/include/gdk-pixbuf-2.0/
+-# -I/usr/include/gdk-pixbuf-2.0/
 -# PATH_MESA_H = -I/usr/X11R6/include/GL
 -# PATH_GTKGL_H = -I/usr/local/include/gtkglext-1.0 \
 -# -I/usr/local/lib/gtkglext-1.0/include
--#
++PATH_EXPAT_H = -I${X11BASE}/include
++PATH_FREETYPE_H = -I${X11BASE}/include/freetype2
++PATH_X_H = -I${X11BASE}/include
++PATH_GLIB_H = -I${LOCALBASE}/include/glib-2.0 
-I${LOCALBASE}/lib/glib-2.0/include
++PATH_CAIRO_H = -I${LOCALBASE}/include/cairo
++PATH_PANGO_H = -I${LOCALBASE}/include/pango-1.0 
-I${LOCALBASE}/include/harfbuzz
++PATH_ATK_H = -I${LOCALBASE}/include/atk-1.0
++PATH_GTK_H =  -I${LOCALBASE}/include/gtk-2.0 
-I${LOCALBASE}/lib/gtk-2.0/include \
++  -I${LOCALBASE}/include/gdk-pixbuf-2.0
++PATH_MESA_H = -I${X11BASE}/include/GL
++PATH_GTKGL_H = -I${LOCALBASE}/include/gtkglext-1.0 \
++  -I${LOCALBASE}/lib/gtkglext-1.0/include
+ #
 -# PATH_EXPAT_L = -L/usr/X11R6/lib
 -# PATH_FREETYPE_L = -L/usr/X11R6/lib
 -# PATH_X_L = -L/usr/X11R6/lib
@@ -29,19 +44,6 @@ Index: src/make_local
 -# PATH_GTK_L = -L/usr/local/lib
 -# PATH_MESA_L = -L/usr/X11R6/lib
 -# PATH_GTKGL_L = -L/usr/local/lib
-+PATH_EXPAT_H = -I${X11BASE}/include
-+PATH_FREETYPE_H = -I${X11BASE}/include/freetype2
-+PATH_X_H = -I${X11BASE}/include
-+PATH_GLIB_H = -I${LOCALBASE}/include/glib-2.0 
-I${LOCALBASE}/lib/glib-2.0/include
-+PATH_CAIRO_H = -I${LOCALBASE}/include/cairo
-+PATH_PANGO_H = -I${LOCALBASE}/include/pango-1.0
-+PATH_ATK_H = -I${LOCALBASE}/include/atk-1.0
-+PATH_GTK_H =  -I${LOCALBASE}/include/gtk-2.0 
-I${LOCALBASE}/lib/gtk-2.0/include \
-+   -I${LOCALBASE}/include/gdk-pixbuf-2.0/ -I${LOCALBASE}/include/harfbuzz
-+PATH_MESA_H = -I${X11BASE}/include/GL
-+PATH_GTKGL_H = -I${LOCALBASE}/include/gtkglext-1.0 \
-+  -I${LOCALBASE}/lib/gtkglext-1.0/include/
-+
 +PATH_EXPAT_L = -L${X11BASE}/lib
 +PATH_FREETYPE_L = -L${X11BASE}/lib
 +PATH_X_L = -L${X