Skip to content

Commit

Permalink
tk dependents: use tk-quartz and tk-x11 as needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jmroot committed Dec 30, 2024
1 parent 19f7b51 commit 72912bf
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 90 deletions.
15 changes: 6 additions & 9 deletions graphics/tkimg/Portfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup active_variants 1.1

name tkimg
version 1.4.16
revision 0
revision 1
categories graphics
license Tcl/Tk
maintainers {mcalhoun @MarcusCalhoun-Lopez} {gmx.us:chrischavez @chrstphrchvz} openmaintainer
homepage https://tkimg.sourceforge.net
description adds a lot of image formats to Tcl/Tk
long_description The \"Img\" package adds a lot of image formats to Tcl/Tk.

platforms darwin

master_sites sourceforge:tkimg/tkimg/[join [lrange [split ${version} .] 0 1] .]/tkimg%20${version}
distname Img-${version}-Source
extract.rename yes
Expand All @@ -39,20 +36,20 @@ patchfiles-append patch-quartz.diff
depends_build-append port:tcllib

depends_lib-append port:tcl \
port:tk \
port:zlib

configure.args-append --with-tcl=${prefix}/lib \
--with-tk=${prefix}/lib
configure.args-append --with-tcl=${prefix}/lib

destroot.destdir INSTALL_ROOT=${destroot}

variant quartz conflicts x11 {
require_active_variants tk quartz
depends_lib-append port:tk-quartz
configure.args-append --with-tk=${prefix}/lib/tk-quartz
}

variant x11 conflicts quartz {
require_active_variants tk x11
depends_lib-append port:tk-x11
configure.args-append --with-tk=${prefix}/lib/tk-x11
}

if {![variant_isset x11] && ![variant_isset quartz]} {
Expand Down
15 changes: 9 additions & 6 deletions math/R/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -255,20 +255,24 @@ variant latex description {build with LaTeX support and docs in PDF} {
}

variant tcltk description {enable use of tcltk} {
depends_lib-append port:tcl \
port:tk
depends_lib-append port:tcl
if {[variant_isset quartz]} {
depends_lib-append port:tk-quartz
configure.args-append --with-tk-config=${prefix}/lib/tk-quartz/tkConfig.sh
} else {
depends_lib-append port:tk-x11
configure.args-append --with-tk-config=${prefix}/lib/tk-x11/tkConfig.sh
}
configure.args-delete --without-tcltk
configure.args-append --with-tcltk \
--with-tcl-config=${prefix}/lib/tclConfig.sh \
--with-tk-config=${prefix}/lib/tkConfig.sh
--with-tcl-config=${prefix}/lib/tclConfig.sh
}

variant tests description {include tests of R installation} {
destroot.target-append install-tests
}

variant x11 conflicts quartz {
require_active_variants tk x11
depends_lib-append port:xorg-libice \
port:xorg-libsm \
port:xorg-libX11 \
Expand All @@ -285,7 +289,6 @@ variant aqua description {Enable native macOS graphics support, needed by R.app
}

variant quartz requires aqua conflicts x11 {
require_active_variants tk quartz
notes-append "
Note that R with quartz variant will not work with R.app because\
of conflicts over the macOS menu."
Expand Down
18 changes: 12 additions & 6 deletions math/netgen/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PortGroup github 1.0
PortGroup legacysupport 1.1

github.setup NGSolve netgen 6.2.2307 v
revision 0
revision 1
categories math
license LGPL-2
maintainers {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
Expand Down Expand Up @@ -60,7 +60,6 @@ patchfiles-append patch-no-external.diff \

depends_lib-append port:zlib \
port:tcl \
port:tk \
port:tkdnd \
port:Togl \
path:lib/libavcodec.dylib:ffmpeg \
Expand All @@ -70,7 +69,6 @@ configure.args-append -DUSE_NATIVE_ARCH=OFF \
-DUSE_PYTHON=OFF \
-DPREFER_SYSTEM_PYBIND11=ON \
-DTCL_INCLUDE_PATH:PATH=${prefix}/include \
-DTK_INCLUDE_PATH:PATH=${prefix}/include \
-DOPENGL_glu_LIBRARY="" \
-DNETGEN_VERSION_GIT="v${version}" \
-DUSE_JPEG=ON \
Expand Down Expand Up @@ -134,7 +132,7 @@ foreach pdv ${pythonversions} {
}

variant quartz conflicts x11 {
require_active_variants tk quartz
depends_lib-append port:tk-quartz
require_active_variants tkdnd quartz
require_active_variants Togl quartz

Expand All @@ -145,10 +143,14 @@ variant quartz conflicts x11 {
reinplace "s|MACPORTS_NO_X11|TRUE|g" \
${worksrcpath}/CMakeLists.txt
}
configure.args-append -DTK_INCLUDE_PATH:PATH=${prefix}/include/tk-quartz \
-DTK_WISH:PATH=${prefix}/libexec/tk-quartz/wish \
-DTK_STUB_LIBRARY:PATH=${prefix}/lib/tk-quartz/libtkstub8.6.a \
-DTK_LIBRARY:PATH=${prefix}/lib/tk-quartz/libtk.dylib
}

variant x11 conflicts quartz {
require_active_variants tk x11
depends_lib-append port:tk-x11
require_active_variants tkdnd x11
require_active_variants Togl x11
depends_lib-append port:xorg-libX11 \
Expand All @@ -159,7 +161,11 @@ variant x11 conflicts quartz {
# Use appropriate headers:
patchfiles-append patch-x11-gl.diff

configure.args-append -DOPENGL_gl_LIBRARY=${prefix}/lib/libGL.dylib
configure.args-append -DOPENGL_gl_LIBRARY=${prefix}/lib/libGL.dylib \
-DTK_INCLUDE_PATH:PATH=${prefix}/include/tk-x11 \
-DTK_WISH:PATH=${prefix}/libexec/tk-x11/wish \
-DTK_STUB_LIBRARY:PATH=${prefix}/lib/tk-x11/libtkstub8.6.a \
-DTK_LIBRARY:PATH=${prefix}/lib/tk-x11/libtk.dylib
}

if {![variant_isset quartz] && ![variant_isset x11]} {
Expand Down
10 changes: 5 additions & 5 deletions science/gvemod-labeler/Portfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup active_variants 1.1

name gvemod-labeler
version 0.4
revision 1
categories science graphics x11
maintainers {raphael @raphael-st} openmaintainer
description An interactive tool for generating \
Expand All @@ -16,7 +16,6 @@ long_description This is the Labeler emodule, an interactive tool \
interactive 3d viewing program).
homepage http://www.geomview.org/
license LGPL-2+
platforms darwin
master_sites sourceforge:project/geomview/${name}:current \
sourceforge:project/geomview/${name}/0.2:old

Expand All @@ -35,9 +34,7 @@ checksums ${distname}${extract.suffix} \
size 254354

depends_lib port:geomview \
port:tk

require_active_variants tk x11
port:tk-x11

# Use the Tcl script from version 0.2 and delete the "Labler" binary.
# Work around case-insensitivity "Labeler" Tcl script <-> "labeler" module
Expand All @@ -48,6 +45,9 @@ post-extract {
${worksrcpath}/src/Makefile.in
}

configure.args --with-tk-lib=${prefix}/lib/tk-x11 \
--with-tk-headers=${prefix}/include/tk-x11

post-destroot {
move ${destroot}${prefix}/libexec/geomview/tcl/Labeler.tc \
${destroot}${prefix}/libexec/geomview/tcl/Labeler
Expand Down
13 changes: 7 additions & 6 deletions science/magic/Portfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup active_variants 1.1
PortGroup conflicts_build 1.0

name magic
version 8.3.507
revision 0
revision 1
checksums rmd160 8817032921bc1a3f44d1e908385920ac3dba8198 \
sha256 612b1f088a77b866286648cd36fefd9d04d9c91398250001133f9b925d0da9f8 \
size 3761909
Expand Down Expand Up @@ -35,14 +34,12 @@ depends_lib port:blt \
port:libGLU \
port:mesa \
port:tcl \
port:tk \
port:tk-x11 \
port:xorg-libice \
port:xorg-libXi \
port:xorg-libXmu \
port:zlib

require_active_variants tk x11

universal_variant no

conflicts_build gnome-keyring
Expand All @@ -61,7 +58,11 @@ if {${os.platform} eq "darwin" && ${os.major} < 19} {
}

configure.args-append \
ac_cv_path_PYTHON3=${configure.python}
ac_cv_path_PYTHON3=${configure.python} \
--with-tk=${prefix}/lib/tk-x11 \
--with-tkincls=${prefix}/include/tk-x11 \
--with-tklibs=${prefix}/lib/tk-x11 \
--with-wish=${prefix}/libexec/tk-x11/wish

use_parallel_build no

Expand Down
10 changes: 4 additions & 6 deletions science/xcrysden/Portfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup active_variants 1.1
PortGroup compilers 1.0

name xcrysden
version 1.6.2
revision 1
categories science
platforms darwin
license GPL-2+

# depends on mesa->py27-xml2->python27->openssl, but nothing from openssl is actually used in XCrySDen
Expand All @@ -32,9 +31,7 @@ checksums rmd160 76d689c50dfc2207cf814b2edc4df36b2921e80b \
compilers.choose fc
compilers.setup require_fortran

require_active_variants tk x11

depends_lib port:fftw-3 port:mesa port:libGLU port:tcl port:tk port:Togl-2.0 \
depends_lib port:fftw-3 port:mesa port:libGLU port:tcl port:tk-x11 port:Togl-2.0 \
port:xorg-libXmu port:xorg-libX11 port:xorg-libXext
depends_run port:BWidget

Expand Down Expand Up @@ -85,7 +82,8 @@ COMPILE_FFTW=no
COMPILE_TOGL=no
FFTW3_LIB=${prefix}/lib/libfftw3.dylib
X_LIB=${prefix}/lib/libXmu.dylib ${prefix}/lib/libX11.dylib ${prefix}/lib/libXext.dylib
TK_LIB=${prefix}/lib/libtk.dylib
TK_INCDIR=-I${prefix}/include/tk-x11
TK_LIB=${prefix}/lib/tk-x11/libtk.dylib
TCL_LIB=${prefix}/lib/libtcl.dylib
GL_LIB=${prefix}/lib/libGL.dylib
GLU_LIB=${prefix}/lib/libGLU.dylib
Expand Down
13 changes: 11 additions & 2 deletions science/xcrysden/files/patch-C-Makefile.diff
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
--- C/Makefile.orig 2020-06-05 21:44:48.000000000 -0700
+++ C/Makefile 2020-06-05 21:45:10.000000000 -0700
--- C/Makefile.orig 2019-10-29 22:37:45
+++ C/Makefile 2024-12-29 15:10:54
@@ -6,7 +6,7 @@
# don't touch below this
#

-INCS = $(FFTW3_INCDIR) $(MESCHACH_INCDIR) $(TCL_INCDIR) $(TK_INCDIR) $(GL_INCDIR) $(X_INCDIR) $(EXTERNAL_INCDIR)
+INCS = $(TK_INCDIR) $(FFTW3_INCDIR) $(MESCHACH_INCDIR) $(TCL_INCDIR) $(GL_INCDIR) $(X_INCDIR) $(EXTERNAL_INCDIR)

include make-objects

@@ -38,7 +38,7 @@
$(CC) $(CFLAGS) $(XFS_OBJS) -o xsf2xsf $(MATH) $(LDLIB)

Expand Down
21 changes: 11 additions & 10 deletions x11/Togl/Portfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup active_variants 1.1
PortGroup github 1.0

name Togl
Expand All @@ -11,7 +10,7 @@ name Togl
# See https://github.com/NGSolve/netgen/tree/master/ng.
github.setup NGSolve netgen 6.2.2307 v
version 2.1
revision 5
revision 6
categories x11
license permissive
maintainers {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
Expand All @@ -31,31 +30,33 @@ worksrcdir ${worksrcdir}/ng/Togl${version}

conflicts Togl-2.0

depends_lib-append port:tcl \
port:tk
depends_lib-append port:tcl

# It does not build with Xcode gcc.
compiler.blacklist-append *gcc-4.0 *gcc-4.2

configure.args-append --with-tcl=${prefix}/lib \
--with-tk=${prefix}/lib
configure.args-append --with-tcl=${prefix}/lib

configure.universal_args-delete --disable-dependency-tracking

variant quartz conflicts x11 {
require_active_variants tk quartz
depends_lib-append port:tk-quartz
configure.args-append --with-tk=${prefix}/lib/tk-quartz \
--with-tkinclude=${prefix}/include/tk-quartz
# see https://github.com/NGSolve/netgen/blob/master/CMakeLists.txt#L250
configure.cppflags-append -DTOGL_NSOPENGL
# see https://github.com/NGSolve/netgen/blob/master/CMakeLists.txt#L221
configure.ldflags-append -undefined dynamic_lookup
}

variant x11 conflicts quartz {
require_active_variants tk x11
depends_lib-append port:xorg-libX11 \
depends_lib-append port:tk-x11 \
port:xorg-libX11 \
port:xorg-libXmu \
port:mesa
configure.args-append --with-Xmu
configure.args-append --with-tk=${prefix}/lib/tk-x11 \
--with-tkinclude=${prefix}/include/tk-x11 \
--with-Xmu
# see https://github.com/NGSolve/netgen/blob/master/CMakeLists.txt#L252
configure.cppflags-append -DTOGL_X11
}
Expand Down
14 changes: 6 additions & 8 deletions x11/blt/Portfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
#-*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup active_variants 1.1

name blt
version 2.5.3
revision 0
revision 1
categories x11
license MIT
maintainers nomaintainer

description BLT is an extension to the Tk toolkit, adding new widgets, \
geometry managers, and miscellaneous commands.
long_description ${description}
long_description {*}${description}

homepage http://blt.sourceforge.net/
platforms darwin

master_sites sourceforge:wize
use_zip yes
Expand All @@ -27,15 +25,15 @@ checksums rmd160 a0e0882e19003bbdb8a89d7c3d410bd32b12b685 \
size 2724036

depends_build port:tcl \
port:tk \
port:tk-x11 \
port:xorg-libX11

require_active_variants tk x11

use_parallel_build no

configure.args-append --with-tcl=${prefix}/lib \
--with-tk=${prefix}/lib
--with-tk=${prefix}/lib/tk-x11 \
--with-tkincls=${prefix}/include/tk-x11 \
--with-tklibs=${prefix}/lib/tk-x11

# prevent having to modify all of Debian patches
patch.pre_args-replace -p0 -p1
Expand Down
Loading

0 comments on commit 72912bf

Please sign in to comment.