Opened 9 months ago

Closed 9 months ago

#69243 closed defect (fixed)

texlive-bin: TeXDist prefpane support prevents non-root installation

Reported by: pereimer Owned by: drkp (Dan Ports)
Priority: Normal Milestone:
Component: ports Version: 2.9.0
Keywords: Cc:
Port: texlive-bin

Description

I am trying to install texlive without root priv. I installed macports with

export MP_PREFIX=/Users/me/local
./configure --prefix=$MP_PREFIX --with-applications-dir=$MP_PREFIX/Applications --with-no-root-privileges
make
make install
port -v selfupdate

That worked fine, and everything I've installed until texlive followed $MP_PREFIX. However,

port install texlive

gives, after computing the dependencies and agreeing to them, the following message

--->  Activating texlive-bin @2023.66589_4+x11
Error: Failed to activate texlive-bin: can't create directory "/Library/TeX/Distributions/.FactoryDefaults/MacPorts-Users_reimer_local-TeXLive": permission denied
    while executing
"::file mkdir $dstfile"
    (procedure "_activate_file" line 18)
    invoked from within
"_activate_file "${extracted_dir}${file}" $file"
    ("foreach" body line 2)
    invoked from within
"foreach file $files {
                    if {[_activate_file "${extracted_dir}${file}" $file] == 1} {
                        lappend rollback_fileli..."
    ("try" body line 3)
    while executing
"throw [dict get $eOptions -errorcode] [dict get $eOptions -errorinfo]"
    ("try ... on" handler line 5)
    invoked from within
"registry::write {
            # Activate it, and catch errors so we can roll-back
            try {
                $port activate $imagefiles
       ..."
Error: See /Users/reimer/local/var/macports/logs/_Users_reimer_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_tex_texlive-bin/texlive-bin/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port texlive failed

Clearly, it is trying to put data in /Library rather than the directory $MP_PREFIX. I have tried setting

export TEXLIVE_INSTALL_PREFIX=/Users/me/local

as suggested in several locations for a generic installation of texlive, but I couldn't find any suggestions specifically for MacPorts.

Is this a bug or feature request, or simply a switch/environmental variable which I have not found?

Thanks,

Paul

Change History (8)

comment:1 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: texlive MP_PREFIX root removed
Owner: set to drkp
Port: texlive-bin added
Status: newassigned
Summary: texlive ignoring installation prefixtexlive-bin: ignoring installation prefix

I assume this is intentional, but I don't know the TeX software well enough to explain why. Maybe the TeX software requires that it is installed there.

Using the command port file all|sort -u|xargs grep /Library/TeX I found several ports referencing this path, chiefly texlive-bin.

MacPorts will not see that you have set the environment variable TEXLIVE_INSTALL_PREFIX because MacPorts intentionally ignores user environment variables in order to provide a consistent experience. MacPorts can be told not to ignore certain environment variables but I doubt that's the correct thing to do in this case; it doesn't look like texlive-bin would make use of that environment variable.

comment:2 Changed 9 months ago by pereimer

Since it is probably the only way that I will be able to install this package, could you tell me how I can get port to use external environmental variables (e.g. TEXLIVE_INSTALL_PREFIX)? While I could install it directly, I am installing things which depend on texlive and would like to do those via macports, so I believe that I need texlive installed via macports.

I did notice that from port file all|sort -u|xargs grep /Library/ that kde4-kile uses a variable TEXPREFIX to reference the installation location; although /Library/TeX seems to be hardwired into most of the other ports.

I doubt that I am the only person to not have root privileges and wanting to install TeX, so would be of general use.

Thanks,

Paul

comment:3 Changed 9 months ago by drkp (Dan Ports)

Yes, this is to support the TeX Distribution prefpane that's used by MacTeX and is used to select between multiple TeX Live installations. The actual TeX files are in $prefix.

There's no reason to try to change where the TeX Distribution symlinks are installed, but we could control whether they are installed with a variant.

comment:4 Changed 9 months ago by drkp (Dan Ports)

Incidentally, the other references to /Library/TeX are all ports that want to be able to (optionally) support using MacTeX instead of the texlive ports if they're installed.

comment:5 in reply to:  3 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to drkp:

There's no reason to try to change where the TeX Distribution symlinks are installed, but we could control whether they are installed with a variant.

If it's a matter of not having permission to write to /Library, then I wouldn't use a variant; I would just skip installing those files if the user is using a non-root MacPorts installation.

comment:6 Changed 9 months ago by drkp (Dan Ports)

Ah, good point, I can't think of any other reason you'd want to control it.

comment:7 Changed 9 months ago by drkp (Dan Ports)

Summary: texlive-bin: ignoring installation prefixtexlive-bin: TeXDist prefpane support prevents non-root installation

comment:8 Changed 9 months ago by drkp (Dan Ports)

Resolution: fixed
Status: assignedclosed

In 0639c3c3f7d66708f7c0290cf071477d6d2881fb/macports-ports (master):

texlive-bin: only install TeXDist prefpane support as root

This fixes breakage for non-root MacPorts installations.

Closes: #69243

Note: See TracTickets for help on using tickets.