UPDATE: magic 8.3.393

2023-04-24 Thread Brad Smith
Update to magic 8.3.393.

Various bug fixes.

The bash patch merged upstream. Plus as I was doing so I noticed two other
shell scripts that were being installed also needed the same change.


Index: Makefile
===
RCS file: /home/cvs/ports/cad/magic/Makefile,v
retrieving revision 1.11
diff -u -p -u -p -r1.11 Makefile
--- Makefile4 Apr 2023 06:26:35 -   1.11
+++ Makefile23 Apr 2023 08:00:35 -
@@ -1,6 +1,6 @@
 COMMENT =  interactive system for VLSI circuit layouts
 
-DISTNAME = magic-8.3.365
+DISTNAME = magic-8.3.393
 EXTRACT_SUFX = .tgz
 
 CATEGORIES =   cad
Index: distinfo
===
RCS file: /home/cvs/ports/cad/magic/distinfo,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 distinfo
--- distinfo4 Apr 2023 06:26:35 -   1.6
+++ distinfo23 Apr 2023 07:58:26 -
@@ -1,2 +1,2 @@
-SHA256 (magic-8.3.365.tgz) = lbPWZtRV8S11kC45MPT8WFl/7sLkf+5M4Fu6DgqCL6o=
-SIZE (magic-8.3.365.tgz) = 4206213
+SHA256 (magic-8.3.393.tgz) = aOqjNt4zLR8SQrUU1blVw8bqadQaaAzKnLoywPBhQTk=
+SIZE (magic-8.3.393.tgz) = 4209393
Index: patches/patch-tcltk_magic_sh_in
===
RCS file: patches/patch-tcltk_magic_sh_in
diff -N patches/patch-tcltk_magic_sh_in
--- patches/patch-tcltk_magic_sh_in 11 Mar 2022 18:24:29 -  1.3
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,9 +0,0 @@
-Index: tcltk/magic.sh.in
 tcltk/magic.sh.in.orig
-+++ tcltk/magic.sh.in
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!/usr/bin/env bash
- #
- # For installation, put this file (magic.sh) in a known executable path.
- # Put startup script "magic.tcl", shared library "tclmagic.so", and



UPDATE: magic 8.3.365

2023-02-03 Thread Brad Smith
Here is an update to magic 8.3.365.

Some bug fixes and fixes for building with Clang 15.


Index: Makefile
===
RCS file: /cvs/ports/cad/magic/Makefile,v
retrieving revision 1.10
diff -u -p -u -p -r1.10 Makefile
--- Makefile24 Jan 2023 17:44:18 -  1.10
+++ Makefile3 Feb 2023 21:31:48 -
@@ -1,6 +1,6 @@
 COMMENT =  interactive system for VLSI circuit layouts
-DISTNAME = magic-8.3.340
-REVISION = 0
+
+DISTNAME = magic-8.3.365
 EXTRACT_SUFX = .tgz
 
 CATEGORIES =   cad
Index: distinfo
===
RCS file: /cvs/ports/cad/magic/distinfo,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 distinfo
--- distinfo6 Dec 2022 19:39:23 -   1.5
+++ distinfo3 Feb 2023 21:31:48 -
@@ -1,2 +1,2 @@
-SHA256 (magic-8.3.340.tgz) = gugQg3RilNFal7z9b07CSQ4ziZt+w0z+GTEXtpW3Rtg=
-SIZE (magic-8.3.340.tgz) = 4190828
+SHA256 (magic-8.3.365.tgz) = lbPWZtRV8S11kC45MPT8WFl/7sLkf+5M4Fu6DgqCL6o=
+SIZE (magic-8.3.365.tgz) = 4206213
Index: patches/patch-database_DBpaint_c
===
RCS file: patches/patch-database_DBpaint_c
diff -N patches/patch-database_DBpaint_c
--- patches/patch-database_DBpaint_c24 Jan 2023 17:44:18 -  1.1
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,14 +0,0 @@
-Fix with clang 15: use a cast to allow invalid pointer to integer conversion.
-
-Index: database/DBpaint.c
 database/DBpaint.c.orig
-+++ database/DBpaint.c
-@@ -1539,7 +1539,7 @@ DBNMPaintPlane0(plane, exacttype, area, resultTbl, und
-   }
- 
-   oldType = TiGetTypeExact(tile);
--  newType = DBDiagonalProc(oldType, &dinfo);
-+  newType = DBDiagonalProc(oldType, (uintptr_t)&dinfo);
- 
-   /* Ignore tiles that don't change type. */
- 
Index: patches/patch-drc_DRCtech_c
===
RCS file: patches/patch-drc_DRCtech_c
diff -N patches/patch-drc_DRCtech_c
--- patches/patch-drc_DRCtech_c 24 Jan 2023 17:44:18 -  1.1
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,15 +0,0 @@
-Fix with clang 15: fix invalid pointer to integer conversion.
-
-Index: drc/DRCtech.c
 drc/DRCtech.c.orig
-+++ drc/DRCtech.c
-@@ -1968,7 +1968,8 @@ drcMaskSpacing(set1, set2, pmask1, pmask2, wwidth, dis
- TileTypeBitMask *set1, *set2;
- PlaneMask pmask1, pmask2;
- int wwidth, distance;
--char *adjacency, *why;
-+char *adjacency;
-+int why;
- bool widerule;
- int runlength;
- bool multiplane;



Re: UPDATE: magic

2021-12-29 Thread Alessandro De Laurenzis

Hello Brad,

On 29/12/2021 01:04, Brad Smith wrote:

Hi Alessandro,

It looks like the issue mentioned in the Debian
bug report was fixed a bit under 2 years ago.



The issue with this port was very similar to that bug report, but the 
root cause identified when we initially imported cad/magic was a 
different Clang's pre-processor behavior w.r.t. GCC's one in line 
continuation symbol treatment.


I see that you added lang/python as dependency (very good catch!); my 
understanding is that when python is found during the config step, a 
pre-processing script is used instead of CPP (I didn't notice that in 
the past...), so this should solve the issue.


I would add a note in the commit log, in order to remember this point!

Regarding your diff, please see my comments in-line.


Can you please test this to make sure it works
as expected?


Index: Makefile
===
RCS file: /home/cvs/ports/cad/magic/Makefile,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 Makefile
--- Makefile6 Mar 2021 11:59:59 -   1.6
+++ Makefile28 Dec 2021 22:53:21 -
@@ -2,6 +2,7 @@
  
  COMMENT =	interactive system for VLSI circuit layouts

  DISTNAME =magic-8.3.137
+REVISION = 0
  EXTRACT_SUFX =.tgz
  
  CATEGORIES =	cad

@@ -11,16 +12,17 @@ MAINTAINER =Alessandro De Laurenzis   
-WANTLIB =	${MODTK_WANTLIB} c cairo fontconfig freetype m GL GLU X11

+WANTLIB =  ${MODTK_WANTLIB} GL GLU X11 Xext Xi Xmu c cairo fontconfig \
+   freetype m
  
  MASTER_SITES =	http://opencircuitdesign.com/magic/archive/
  
-# The cpp preprocessor is used to generate .tech files; clang's breaks

-# newlines: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698760
-COMPILER = ports-gcc
+COMPILER = base-clang ports-gcc
  COMPILER_LANGS = c
  
-MODULES =	x11/tk

+MODULES =  lang/python \
+   x11/tk
+MODPY_RUNDEP = No
  
  LIB_DEPENDS =	${MODTK_LIB_DEPENDS} \

graphics/cairo
@@ -31,16 +33,16 @@ WRKCONF =   ${WRKSRC}/scripts
  CONFIGURE_STYLE = gnu
  CONFIGURE_ARGS += --with-distdir=${PREFIX} \
--with-tcl=${MODTCL_LIBDIR} \
-   --with-tk=${MODTK_LIBDIR} \
-   --with-cairo=${LOCALBASE}/include \


Removing --with-cairo=${LOCALBASE}/include I see the following warnings 
during configure step:



checking cairo/cairo.h presence... no
configure: WARNING: cairo/cairo.h: accepted by the compiler, rejected by the 
preprocessor!
configure: WARNING: cairo/cairo.h: proceeding with the compiler's result


so I would like to preserve that line.


-   --enable-cairo-offscreen


This breaks OpenGL support, we definitely need that option.


+   --with-tk=${MODTK_LIBDIR}
+CONFIGURE_ENV +=   LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
+
+CFLAGS +=  -I${LOCALBASE}/include -I${X11BASE}/include


The Clang compile log is much more noisy, so - considering that 
cad/magic codebase is very old - I would add also the following:



# Really really not C99
CFLAGS +=   -Wno-return-type -Wno-parentheses
  
  USE_GMAKE =	Yes
  
  NO_TEST =	Yes
  
  post-patch:

-   @${SUBST_CMD} ${WRKSRC}/scripts/configure
@${SUBST_CMD} ${WRKSRC}/utils/paths.h
  
  post-install:

Index: patches/patch-scripts_configure
===
RCS file: /home/cvs/ports/cad/magic/patches/patch-scripts_configure,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-scripts_configure
--- patches/patch-scripts_configure 6 Mar 2021 11:59:59 -   1.3
+++ patches/patch-scripts_configure 28 Dec 2021 21:50:55 -
@@ -21,20 +21,19 @@ Index: scripts/configure
 # Not available on all versions:  check for include file.
 ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" 
"$ac_includes_default"
   if test "x$ac_cv_header_dlfcn_h" = xyes; then :
-@@ -8050,6 +8050,12 @@ fi
+@@ -8050,6 +8050,11 @@ fi
 fi
 ;;
   
  +*-openbsd*)

  +  SHLIB_CFLAGS="-fPIC"
  +  LDDL_FLAGS="-shared ${LIB_SPEC}"
-+  CFLAGS="${CFLAGS} -I${X11BASE}/include"
  +  ;;
  +
   *-nextstep*)
 LDDL_FLAGS="-nostdlib -r"
 ;;
-@@ -9485,16 +9491,5 @@ else
+@@ -9485,16 +9490,5 @@ else
echo
  fi
   fi
I see that the line "BUILD_DEPENDS = devel/m4" got lost in one of the 
recent updates (but it is still needed AFAICS), so I would re-add it.


With the above modifications (except the additional CFLAGS line, which I 
consider optional), this is OK maintainer.


Please find attached a modified patch for your convenience. Adding 
ports@ in case other developers wants to chime in.


Also, I'm currently testing a newer upstream version, but that would 
require a bit more time.


All the best

--
Alessandro De Laurenzis
[mailto:jus...@atlantide.mooo.com]
Web: http://www.atlantide.mooo.com
LinkedIn: http:/