Changeset 118562


Ignore:
Timestamp:
Apr 4, 2014, 10:58:04 PM (6 years ago)
Author:
cal@…
Message:

base: remove all references to macports_tcl_dir, install Tcl packages in TCL_PACKAGE_PATH directly, fixes #43208

This completely removes the need for macports_fastload.tcl and all the other
hacks that MacPorts has been using to locate its own packages (such as appending
to $auto_path during mportinit and preloading some packages).

Note: ${TCL_PACKAGE_PATH}/macports1.0 previously was a symlink and now is
a directory. When the symlink isn't removed before trying to create the
directory, this causes a failure. The Makefile now ensures this doesn't happen,
but I don't know what installer(8) will do in this case. This means we might
have to add delete the symlink in installer preflight.

Location:
trunk/base
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/Makefile.in

    r118264 r118562  
    9797        $(TCLSH) $(srcdir)/src/upgrade_sources_conf_default.tcl "${prefix}"
    9898# Convert image directories (and direct mode installs) to image archives
    99         $(TCLSH) $(srcdir)/src/images_to_archives.tcl "${macports_tcl_dir}"
    100         $(TCLSH) $(srcdir)/src/dedup_portfiles.tcl "${macports_tcl_dir}"
     99        $(TCLSH) $(srcdir)/src/images_to_archives.tcl
     100        $(TCLSH) $(srcdir)/src/dedup_portfiles.tcl
    101101endif
    102102ifndef SELFUPDATING
  • trunk/base/Mk/macports.autoconf.mk.in

    r117621 r118562  
    5050TCLSH                   = @TCLSH@
    5151TCL_PACKAGE_PATH        = @TCL_PACKAGE_PATH@
    52 macports_tcl_dir        = @macports_tcl_dir@
    5352
    5453DSCL                    = @DSCL@
  • trunk/base/configure

    r118560 r118562  
    653653VENDOR_TCL_INSTALL
    654654VENDOR_TCL_SUBDIR
    655 macports_tcl_dir
    656655localstatedir_expanded
    657656MPCONFIGDIR_EXPANDED
     
    94979496eval "localstatedir_expanded=$localstatedir"
    94989497
    9499 eval "macports_tcl_dir=${datadir}/macports/Tcl"
    9500 eval "macports_tcl_dir=$macports_tcl_dir"
    9501 
    95029498# Compute the libexec dir for the vendor packages
    95039499eval "macports_libexec_dir=${libexecdir}/macports"
  • trunk/base/configure.ac

    r118559 r118562  
    312312eval "localstatedir_expanded=$localstatedir"
    313313AC_SUBST(localstatedir_expanded)
    314 eval "macports_tcl_dir=${datadir}/macports/Tcl"
    315 eval "macports_tcl_dir=$macports_tcl_dir"
    316 AC_SUBST(macports_tcl_dir)
    317314# Compute the libexec dir for the vendor packages
    318315eval "macports_libexec_dir=${libexecdir}/macports"
  • trunk/base/portmgr/jobs/Makefile

    r65055 r118562  
    44
    55edit = sed \
    6         -e 's,@macports_tcl_dir@,$(macports_tcl_dir),g'
     6        -e 's,@TCLSH@,$(TCLSH),g'
    77
    88
  • trunk/base/portmgr/jobs/PortIndex2MySQL.tcl

    r116519 r118562  
    1 #!/opt/local/bin/tclsh
     1#!@TCLSH@
    22# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
    33#
     
    179179
    180180# Load macports1.0 so that we can use some of its procs and the portinfo array.
    181 if {[catch { source [file join "@macports_tcl_dir@" macports1.0 macports_fastload.tcl] } errstr]} {
    182     puts $runlog_fd "${::errorInfo}"
    183     puts $runlog_fd "Failed to locate the macports1.0 Tcl package file: $errstr"
    184     cleanup lockfile
    185     terminate 1
    186 }
    187181if {[catch { package require macports } errstr]} {
    188182    puts $runlog_fd "${::errorInfo}"
  • trunk/base/src/cflib1.0/Makefile.in

    r117621 r118562  
    11srcdir = @srcdir@
    22VPATH  = @srcdir@
     3
     4include ../../Mk/macports.autoconf.mk
    35
    46OBJS=           CFLib.o
    57SHLIB_NAME=     CFLib${SHLIB_SUFFIX}
    68LIBS+=          -framework CoreFoundation
    7 INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/cflib1.0
     9INSTALLDIR= ${DESTDIR}${TCL_PACKAGE_PATH}/cflib1.0
    810
    9 include ../../Mk/macports.autoconf.mk
    1011include $(srcdir)/../../Mk/macports.tea.mk
  • trunk/base/src/darwintracelib1.0/Makefile.in

    r118264 r118562  
    11srcdir = @srcdir@
    22VPATH  = @srcdir@
     3
     4include ../../Mk/macports.autoconf.mk
    35
    46# This Makefile will only be run on Darwin systems; we can safely use
     
    79OBJS=           $(SRCS:%.c=%.o)
    810SHLIB_NAME=     darwintrace${SHLIB_SUFFIX}
    9 INSTALLDIR=     ${DESTDIR}${datadir}/macports/Tcl/darwintrace1.0
    10 
    11 include ../../Mk/macports.autoconf.mk
     11INSTALLDIR=     ${DESTDIR}${TCL_PACKAGE_PATH}/darwintrace1.0
    1212
    1313# Yes, we know having $ signs in identifiers is not a very good idea; in the
  • trunk/base/src/machista1.0/Makefile.in

    r117615 r118562  
    22VPATH  = @srcdir@
    33
     4include ../../Mk/macports.autoconf.mk
     5
    46OBJS=           libmachista.o hashmap.o machista_wrap.o
    57SHLIB_NAME= machista${SHLIB_SUFFIX}
    6 INSTALLDIR=     ${DESTDIR}${datadir}/macports/Tcl/machista1.0
     8INSTALLDIR=     ${DESTDIR}${TCL_PACKAGE_PATH}/machista1.0
    79
    810SWIG         = @SWIG@
     
    1618TESTS = ./tests/libmachista-test
    1719
    18 include ../../Mk/macports.autoconf.mk
    1920include $(srcdir)/../../Mk/macports.tea.mk
    2021
  • trunk/base/src/macports1.0/Makefile.in

    r118559 r118562  
    11srcdir = @srcdir@
    22VPATH  = @srcdir@
     3
     4include ../../Mk/macports.autoconf.mk
    35
    46SRCS=           macports.tcl macports_dlist.tcl macports_util.tcl \
     
    79SHLIB_NAME=     MacPorts${SHLIB_SUFFIX}
    810
    9 INSTALLDIR=     ${DESTDIR}${datadir}/macports/Tcl/macports1.0
    10 INSTALLPKGLINK= ${TCL_PACKAGE_PATH}/macports1.0
    11 
    12 include ../../Mk/macports.autoconf.mk
    13 include $(srcdir)/../../Mk/macports.tea.mk
     11INSTALLDIR=     ${DESTDIR}${TCL_PACKAGE_PATH}/macports1.0
     12OLDINSTALLDIR= ${datadir}/macports
    1413
    1514ifeq ($(OBJC_RUNTIME), APPLE_RUNTIME)
     
    2726
    2827install:: all
     28        @# Clean up old instances of the MacPorts Tcl packages
     29        if test -z "${DESTDIR}"; then rm -rf "${OLDINSTALLDIR}"; fi
     30
     31        @# Remove the previously installed link if it still exists. Without this,
     32        @# creating the directory will fail.
     33        if test -L "${INSTALLDIR}"; then rm -rf "${INSTALLDIR}"; fi
     34
    2935        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
    3036
     
    3541        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 pkgIndex.tcl ${INSTALLDIR}
    3642
    37         echo "${TCL_PACKAGE_PATH}" > ${DESTDIR}${prefix}/var/macports/.tclpackage
    38         if test -z "${DESTDIR}" -a "${INSTALLPKGLINK}" != "${INSTALLDIR}"; then \
    39                 if test ! -L "${INSTALLPKGLINK}"; then \
    40             if test ! -e "${TCL_PACKAGE_PATH}"; then \
    41                 $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "${TCL_PACKAGE_PATH}" || true; \
    42             fi; \
    43             if test -d "${INSTALLPKGLINK}"; then \
    44                 rm -vrf "${INSTALLPKGLINK}" || true; \
    45             fi; \
    46             if test ! -e "${INSTALLPKGLINK}"; then \
    47                 ln -vs "${INSTALLDIR}" "${INSTALLPKGLINK}" || true; \
    48             fi; \
    49         fi; \
    50         fi
     43
     44include $(srcdir)/../../Mk/macports.tea.mk
  • trunk/base/src/macports1.0/macports.tcl

    r118456 r118562  
    10241024    }
    10251025
    1026     if {[file isdirectory $libpath]} {
    1027         lappend auto_path $libpath
    1028         set macports::auto_path $auto_path
    1029 
    1030         # XXX: not sure if this the best place, but it needs to happen
    1031         # early, and after auto_path has been set.  Or maybe Pextlib
    1032         # should ship with macports1.0 API?
    1033         package require Pextlib 1.0
    1034         package require registry 1.0
    1035         package require registry2 2.0
    1036         package require machista 1.0
    1037     } else {
    1038         return -code error "Library directory '$libpath' must exist"
    1039     }
    1040 
    10411026    # set the hidden flag on $portdbpath to avoid spotlight indexing, which
    10421027    # might slow builds down considerably. You can avoid this by touching
  • trunk/base/src/macports1.0/macports_test_autoconf.tcl.in

    r111325 r118562  
    3333
    3434namespace eval macports::autoconf {
    35     variable macports_tcl_dir "@macports_tcl_dir@"
    3635    variable prefix "@prefix@"
    3736}
  • trunk/base/src/package1.0/Makefile.in

    r118264 r118562  
    22VPATH  = @srcdir@
    33
    4 INSTALLDIR=     ${DESTDIR}${datadir}/macports/Tcl/package1.0
     4include ../../Mk/macports.autoconf.mk
     5
     6INSTALLDIR=     ${DESTDIR}${TCL_PACKAGE_PATH}/package1.0
    57
    68SRCS=   package.tcl portdmg.tcl portmdmg.tcl portmpkg.tcl portpkg.tcl \
    79        portrpm.tcl portsrpm.tcl portdpkg.tcl portunarchive.tcl \
    810        portarchivefetch.tcl
    9 
    10 include ../../Mk/macports.autoconf.mk
    1111
    1212all:: pkgIndex.tcl
  • trunk/base/src/package1.0/package_test_autoconf.tcl.in

    r111455 r118562  
    3333
    3434namespace eval macports::autoconf {
    35     variable macports_tcl_dir "@macports_tcl_dir@"
    3635    variable prefix "@prefix@"
    3736}
  • trunk/base/src/pextlib1.0/Makefile.in

    r117616 r118562  
    11srcdir = @srcdir@
    22VPATH  = @srcdir@
     3
     4include ../../Mk/macports.autoconf.mk
    35
    46OBJS= \
     
    1315
    1416SHLIB_NAME= Pextlib${SHLIB_SUFFIX}
    15 INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/pextlib1.0
     17INSTALLDIR= ${DESTDIR}${TCL_PACKAGE_PATH}/pextlib1.0
    1618
    17 include ../../Mk/macports.autoconf.mk
    1819include $(srcdir)/../../Mk/macports.tea.mk
    1920
  • trunk/base/src/port/Makefile.in

    r118559 r118562  
    11srcdir = @srcdir@
    22VPATH  = @srcdir@
     3
     4include ../../Mk/macports.autoconf.mk
    35
    46INSTALLDIR=     ${DESTDIR}${prefix}
     
    68SCRIPTS=        portmirror portindex port port-tclsh
    79
    8 edit = sed \
    9         -e 's,@TCLSH\@,$(TCLSH),g' \
    10         -e 's,@macports_tcl_dir\@,$(macports_tcl_dir),g'
    11 
    12 include ../../Mk/macports.autoconf.mk
     10edit = sed -e 's,@TCLSH\@,$(TCLSH),g'
    1311
    1412.PHONY: mkdirs
  • trunk/base/src/port1.0/Makefile.in

    r118264 r118562  
    22VPATH  = @srcdir@
    33
    4 INSTALLDIR=     ${DESTDIR}${datadir}/macports/Tcl/port1.0
     4include ../../Mk/macports.autoconf.mk
     5
     6INSTALLDIR=     ${DESTDIR}${TCL_PACKAGE_PATH}/port1.0
    57
    68SRCS_AUTOCONF= port_autoconf.tcl
     
    1416
    1517include $(srcdir)/../../Mk/macports.subdir.mk
    16 include ../../Mk/macports.autoconf.mk
    1718
    1819.PHONY: test
  • trunk/base/src/port1.0/port_test_autoconf.tcl.in

    r111325 r118562  
    3333
    3434namespace eval macports::autoconf {
    35     variable macports_tcl_dir "@macports_tcl_dir@"
    3635    variable prefix "@prefix@"
    3736}
  • trunk/base/src/registry2.0/Makefile.in

    r118264 r118562  
    33srcdir = @srcdir@
    44VPATH  = @srcdir@
     5
     6include ../../Mk/macports.autoconf.mk
    57
    68SRCS_AUTOCONF = registry_autoconf.tcl
     
    1315
    1416SHLIB_NAME= registry${SHLIB_SUFFIX}
    15 INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/registry2.0
     17INSTALLDIR= ${DESTDIR}${TCL_PACKAGE_PATH}/registry2.0
    1618
    17 include ../../Mk/macports.autoconf.mk
    1819include $(srcdir)/../../Mk/macports.tea.mk
    1920
  • trunk/base/src/tclobjc1.0/Makefile.in

    r117620 r118562  
    22VPATH  = @srcdir@
    33
     4include ../../Mk/macports.autoconf.mk
     5
    46OBJS=           tclobjc.o tclobjc_types.o MPMethodSignatureExtensions.o objc_encoding.o
    57SHLIB_NAME=     tclobjc${SHLIB_SUFFIX}
    6 INSTALLDIR=     ${DESTDIR}${datadir}/macports/Tcl/tclobjc1.0
     8INSTALLDIR=     ${DESTDIR}${TCL_PACKAGE_PATH}/tclobjc1.0
    79
    8 include ../../Mk/macports.autoconf.mk
    910include $(srcdir)/../../Mk/macports.tea.mk
    1011
Note: See TracChangeset for help on using the changeset viewer.