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 28, 2024
1 parent f526445 commit d629b63
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 80 deletions.
13 changes: 5 additions & 8 deletions graphics/tkimg/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

name tkimg
version 1.4.16
Expand All @@ -13,8 +12,6 @@ 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
16 changes: 11 additions & 5 deletions math/netgen/Portfile
Original file line number Diff line number Diff line change
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
9 changes: 4 additions & 5 deletions science/gvemod-labeler/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

name gvemod-labeler
version 0.4
Expand All @@ -16,7 +15,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 +33,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 +44,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
8 changes: 3 additions & 5 deletions science/magic/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 conflicts_build 1.0

name magic
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,8 @@ 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

use_parallel_build no

Expand Down
9 changes: 3 additions & 6 deletions science/xcrysden/Portfile
Original file line number Diff line number Diff line change
@@ -1,13 +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 compilers 1.0

name xcrysden
version 1.6.2
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 +30,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 +81,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=${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
17 changes: 8 additions & 9 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 Down Expand Up @@ -31,31 +30,31 @@ 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
# 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-Xmu
# see https://github.com/NGSolve/netgen/blob/master/CMakeLists.txt#L252
configure.cppflags-append -DTOGL_X11
}
Expand Down
10 changes: 3 additions & 7 deletions x11/blt/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

name blt
version 2.5.3
Expand All @@ -12,10 +11,9 @@ 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,13 @@ 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

# prevent having to modify all of Debian patches
patch.pre_args-replace -p0 -p1
Expand Down
17 changes: 8 additions & 9 deletions x11/tix/Portfile
Original file line number Diff line number Diff line change
@@ -1,12 +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 tix
version 8.4.3
revision 5
platforms darwin
categories x11
license BSD
maintainers {gmx.us:chrischavez @chrstphrchvz} openmaintainer
Expand All @@ -30,8 +28,7 @@ checksums rmd160 99249c4d7a19fcb8c27f11ab1b3ef6102911409d \
sha256 562f040ff7657e10b5cffc2c41935f1a53c6402eb3d5f3189113d734fd6c03cb \
size 1831503

depends_lib port:tcl \
port:tk
depends_lib port:tcl
patchfiles patch-generic-tixGrSort.c.diff \
patch-tk_x11.diff \
patch-dyld_variable.diff \
Expand All @@ -42,20 +39,22 @@ patchfiles-append patch-missing-headers.diff \
panic.patch

configure.args --mandir=${prefix}/share/man \
--with-tcl=${prefix}/lib \
--with-tk=${prefix}/lib
--with-tcl=${prefix}/lib

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-x \
--x-includes=${prefix}/include \
--x-libraries=${prefix}/lib
--x-libraries=${prefix}/lib \
--with-tk=${prefix}/lib/tk-x11
}

if {![variant_isset quartz]} {
Expand Down
Loading

0 comments on commit d629b63

Please sign in to comment.