Opened 8 years ago

Closed 4 years ago

#51668 closed submission (fixed)

texlive-texdist: new port

Reported by: dliessi (Davide Liessi) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: drkp (Dan Ports), mojca (Mojca Miklavec), koch@…, cooljeanius (Eric Gallager)
Port: texlive-texdist

Description

TeXDist directory structure for MacPorts' TeX Live. It is used by MacTeX's texdist utility and TeX Distribution Preference Pane to switch between TeX distributions.

See http://www.tug.org/mactex/multipletexdistributions.html

This port deletes and writes files outside ${prefix}. The rationale is explained in the comment inside the Portfile.

Attachments (2)

Portfile (5.4 KB) - added by dliessi (Davide Liessi) 8 years ago.
Description.rtf (360 bytes) - added by dliessi (Davide Liessi) 8 years ago.

Download all attachments as: .zip

Change History (24)

Changed 8 years ago by dliessi (Davide Liessi)

Attachment: Portfile added

Changed 8 years ago by dliessi (Davide Liessi)

Attachment: Description.rtf added

comment:1 Changed 7 years ago by mojca (Mojca Miklavec)

Cc: mojca added

comment:2 Changed 7 years ago by mojca (Mojca Miklavec)

I didn't see this ticket earlier. Thanks a lot.

Why do you make symlinks to powerpc rather than making a symlink to the actual architecture being used?

comment:3 Changed 7 years ago by mojca (Mojca Miklavec)

I'm very happy that you sent this patch. But in my opinion this should be part of texlive-common. Otherwise people will either forget to install texlive-texmfdist or keep it installed long after they remove texlive form MacPorts.

Then again, in case Dan would not be comfortable putting the code there, it's still better to have a functional package than not having anything at all.

Dan? Would you be willing to accept the contents to one of your existing texlive packages? I imagine texlive-common would be the best place, but it's up to you.

(I wonder if we really need all the zillion symlinks though. I thought the original author had a neat idea to use them somehow, but I imagine that nowadays almost the only useful bit is the bin dir.)

comment:4 in reply to:  2 Changed 7 years ago by dliessi (Davide Liessi)

Replying to mojca:

Why do you make symlinks to powerpc rather than making a symlink to the actual architecture being used?

That is what also MacTeX does for its symlinks: e.g., MacTeX 2013 links ppc, powerpc, i386 to bin/universal-darwin, x86_64 to bin/x86_64-darwin and texbin to x86_64.

I don't recall the exact reason, but there might be some programs that check for a specific architecture instead of texbin.

comment:5 in reply to:  3 Changed 7 years ago by dliessi (Davide Liessi)

Replying to mojca:

I'm very happy that you sent this patch. But in my opinion this should be part of texlive-common. Otherwise people will either forget to install texlive-texmfdist or keep it installed long after they remove texlive form MacPorts.

I would not oppose including this in one of the texlive ports. I would even be willing to maintain the relevant part of that Portfile.

The reason for having a separate port is that I believe most MacTeX users will not install TeX Live through MacPorts and most MacPorts TeX Live users will not install MacTeX, so this package is probably useless for most TeX users on Mac.

(One of the entries in my to-do list is to ask the author(s) of the texdist script to put it somewhere online and provide also that script via this package, which would motivate a separate package. The script is currently available only inside the MacTeX bundles, as far as I know.)

(I wonder if we really need all the zillion symlinks though. I thought the original author had a neat idea to use them somehow, but I imagine that nowadays almost the only useful bit is the bin dir.)

(Indeed, the original author had great plans, and you are probably right, but I decided to provide the full directory structure to adhere to the informal specification and for consistency with the ones provided by MacTeX.)

comment:6 Changed 7 years ago by mojca (Mojca Miklavec)

No, ppc is there because MacTeX provides binaries for several architectures and it is in principle possible to switch between them (nowadays you could switch between x86_64 and universal (=i386+ppc)). MacTeX installs it "just in case", but you wouldn't want to use PPC on 10.12 anyway. Providing symlinks for anything but the exact architecture(s) that MacPorts builds on that particular machine is useless.

If you start working on texdist itself, please keep me in the loop.

comment:7 in reply to:  6 Changed 7 years ago by dliessi (Davide Liessi)

Replying to mojca:

No, ppc is there because MacTeX provides binaries for several architectures and it is in principle possible to switch between them (nowadays you could switch between x86_64 and universal (=i386+ppc)). MacTeX installs it "just in case", but you wouldn't want to use PPC on 10.12 anyway. Providing symlinks for anything but the exact architecture(s) that MacPorts builds on that particular machine is useless.

OK, maybe I misunderstood what was going on. I'll try removing "false" symlinks and test switching between distributions and see how programs behave.

If you start working on texdist itself, please keep me in the loop.

I will.

comment:8 Changed 7 years ago by dliessi (Davide Liessi)

The texdist script determines if a TeX distribution is usable by checking if Contents/Programs/$arch/tex exists, where $arch is the output of uname -p. So at least that symlink is needed, besides the texbin one.

I could cheat and provide only the $arch and texbin symlinks: this would not provide the complete picture in the universal case, and it would provide wrong symlinks where uname -p does not correspond to the actual architecture (e.g. on my machine it outputs i386, while texlive-bin installs x86_64), but at least existing symlinks would not point to a different architecture family (PowerPC vs Intel).

The ideal situation would be to provide the following symlinks, besides texbin:

  • 32-bit Intel: i386
  • 64-bit Intel: i386, x86_64
  • 32-bit or PowerPC: ppc, powerpc
  • universal: the correct combination of the above

I can determine the installed architecture, if not universal, from the directory name in ${texlive_mactex_texdistdir} and manually fix the 64-bit Intel case, but this does not work for the universal case. Is there a simple way to determine which architectures were installed in the universal case?

comment:9 Changed 7 years ago by mojca (Mojca Miklavec)

Are you sure that the script checks for uname -p? That sounds stupid to me, but it's also true that it might not have seen any changes for years and nobody bothered.

There might be one more thing. I'm almost sure that picking a different symlink won't have any effect if one builds universal binaries. This would probably only change the behaviour if we had a different set of, say, 32-bit binaries elsewhere. You may ask those who wrote the software or on one of the Mac-specific TUG mailing lists. For that reason it might be useless to set those other symlinks.

comment:10 in reply to:  9 Changed 7 years ago by dliessi (Davide Liessi)

Replying to mojca:

Are you sure that the script checks for uname -p? That sounds stupid to me, but it's also true that it might not have seen any changes for years and nobody bothered.

I'd like to resume the work on texlive-texdist, starting with fixing the problem of the architecture detection in the texdist script (maybe with your help). Then I'd like texlive-texdist to install also the texdist script along with the directory structure.

I sent email to Richard Koch some days ago asking whether a public repository of the texdist script is avaliable, where I could file bug reports and provide patches and from where I could instruct the Portfile to download and install the script. He hasn't replied yet, but in the meantime I saw that you set up this repository, which contains the texdist script, originally by Gerben Wierda and licensed (apparently) as BSD. Is this a new "official" public location for the texdist script (even though the description of the repository says "legacy Macs")? Is there any other public repository?

comment:11 Changed 7 years ago by mojca (Mojca Miklavec)

Cc: koch@… added

comment:12 Changed 7 years ago by mojca (Mojca Miklavec)

First of all: I'm not even sure if the above link will stay under that name. There might be better project names than TeXLive-M. https://github.com/texlive or https://github.com/MacTeX or whatever (I don't know who owns those project names).

But let me first explain what exactly the repository on the link above is about. This is more or less a tiny fraction of what MacTeX provides. I made some minor changes in the scripts based on what Richard Koch sent me.

"Legacy" in the name stands for the fact that MacTeX will no longer support anything beyond officially supported versions, so MacTeX 2017 won't work on 10.9 and below, MacTeX 2018 won't work on 10.10 and below ... The package above is meant as "replacement", so that users of legacy systems will still be able to switch between different distributions.

The texdist script in the above repository is not the upstream version. It's just a copy. I have no clue where the "upstream" version would reside, if anywhere at all.

Here's the link with PrefPane (semi-abandoned):

And a local version of PrefPane:

But keep in mind that the PrefPane no longer works on the latest OSes and that the version on older OSes is buggy enough to not even support TL 2017 where the name of the bin folder was slightly modified. It was removed from MacTeX in any case and nowadays you would get an advice to use TeX Live Utility for switching between distributions.

comment:13 Changed 7 years ago by dliessi (Davide Liessi)

Does TeX Live Utility use the texdist script to switch between distribution?

comment:14 Changed 7 years ago by mojca (Mojca Miklavec)

See also Is texdistmgr no longer needed on macOS? on StackExchange.

comment:15 in reply to:  13 ; Changed 7 years ago by mojca (Mojca Miklavec)

Replying to dliessi:

Does TeX Live Utility use the texdist script to switch between distribution?

According to Adam it doesn't.

See https://github.com/amaxwell/tlutility/blob/master/texdist/texdist_change_default.sh

comment:16 in reply to:  15 Changed 7 years ago by dliessi (Davide Liessi)

Replying to mojca:

See https://github.com/amaxwell/tlutility/blob/master/texdist/texdist_change_default.sh

That script is much simpler than texdist, since most of the work is done in Objective-C, and as far as I understand also the TeXDist and LocalTeX preference panes do not use the texdist script and implement everything in Objective-C. So, for what concerns MacPorts, I'd still prefer to fix the architecture recognition in texdist and provide that script with texlive-texdist.

I think that the version in https://github.com/TeXLive-M/TeXDist is indeed the last version available, but we would need input by Dick to be sure of this.

Maybe for the moment we can fix texdist there and use that in the Portfile. The changes can then be copied to the upstream repository if and when it will be possible.

comment:17 Changed 7 years ago by mojca (Mojca Miklavec)

I don't know if what you want to do is to provide the structure that explains what exactly is in MacPorts. Or the script that can switch between installations.

You don't need the texdist script nor texdist_change_default.sh for the first goal.

What exactly would you use texdist in MacPorts for? Just curious.

Last edited 7 years ago by mojca (Mojca Miklavec) (previous) (diff)

comment:18 in reply to:  17 Changed 7 years ago by dliessi (Davide Liessi)

Replying to mojca:

I don't know if what you want to do is to provide the structure that explains what exactly is in MacPorts. Or the script that can switch between installations.

The first (and original) goal is to provide the structure. This is done in the attached Portfile, but as we discussed earlier there are some difficulties in providing the architecture-specific links in a sensible way, due also to the (buggy?) way texdist determines the architecture to test if the distribution is usable.

So two things need to be done.

  1. Find a way to know which architetures were installed by texlive-bin: I could simply retrieve the defaults, but it would be better to check what the port actually installed, especially with respect to universal binaries; this means that texlive-texdist should depend on texlive-bin, though, so maybe it would be even better to add everything to the texlive-bin Portfile, which would solve the problem.
  2. Fix the architecture check in texdist upstream (which I understand is in http://tug.org/svn/texlive/trunk/Master/source/mactexdoc.tar.xz).

The problem with texdist lead me to a second goal: given that we will provide the directory structure with MacPorts, I think it wouldn't hurt (and it is little extra work) to provide also texdist.

What exactly would you use texdist in MacPorts for? Just curious.

I have other versions of TeX Live / MacTeX installed, besides MacPorts, and I'd like to use texdist to switch between them. If users installed other distributions using MacTeX they should already have a copy of texdist, but not so if they used the UNIX TeX Live installer, as far as I understand. I understand that few users install both MacPorts' TeX Live and other TeX distributions.

comment:19 Changed 7 years ago by mojca (Mojca Miklavec)

In my opinion the structure should be made by the texlive-bin port itself rather than by an independent port.

So let's concentrate on two independent efforts:

  • adding the structure to texlive-bin
  • potentially fixing texdist, but let's discuss that somewhere else

comment:20 Changed 7 years ago by dliessi (Davide Liessi)

I moved the code for texlive-texdist to texlive-bin and I fixed the architecture symlinks to be meaningful and to accomodate for the architecture test in texdist. Since the installed files change, I also increased the revision.

I pushed the relevant commit to the texdist-in-texlive-bin branch in my fork: https://github.com/dliessi/macports-ports/tree/texdist-in-texlive-bin

Please have a look at it. If you want to test it, you'll probably want to empty the configure, build and destroot phases and delete/comment the lines in post-destroot that precede the long comment on TeXDist, to avoid building all texlive-bin; then you can sudo port destroot and examine the links that are created.

If you think everything is ok, I can open a pull request so that Dan can examine it and possibly merge it.

comment:21 Changed 4 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:22 Changed 4 years ago by drkp (Dan Ports)

Resolution: fixed
Status: newclosed

In 73396594cf737f853b78c1c64c410a47450dfb06/macports-ports (master):

texlive: update to TeX Live 2020

  • biblatex-biber: update to 2.14
  • texlive-tlpdb: new port to install TeX Live package database

This is used by some scripts nowadays, including texdoc

  • texlive-bin-extra: add perl dependencies for latexindent
  • texlive-bin: provide TeXDist directory structure

Closes: #60541
Closes: #58615
Closes: #51668

Note: See TracTickets for help on using tickets.