Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#44220 closed defect (fixed)

latexml fails in ACTIVATION step. "mktexlsr not found"

Reported by: damon.english@… Owned by: brucemiller (bruce miller)
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: Cc: mojca (Mojca Miklavec)
Port: LaTeXML

Description

Mac OS X 10.9.3, xcode 5.1.1, MacTex (texlive 2014)

All depedencies report proper installation.

:notice:activate
:notice:activate LaTeXML works best with some version of TeX installed.  Please install MacTeX or 'sudo port install texlive' (or other system) first.
:notice:activate
:debug:activate Executing proc-post-org.macports.activate-activate-0
:info:activate sh: mktexlsr: command not found
:info:activate Command failed: mktexlsr
:info:activate Exit code: 127
:error:activate org.macports.activate for port LaTeXML returned: command execution failed
:debug:activate Error code: NONE
:debug:activate Backtrace: command execution failed
    while executing
"proc-post-org.macports.activate-activate-0 org.macports.activate"
    ("eval" body line 1)
    invoked from within
"eval $post $targetname"
:info:activate Warning: targets not executed for LaTeXML: org.macports.activate
:notice:activate Please see the log file for port LaTeXML for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_tex_LaTeXML/LaTeXML/main.log

Attachments (3)

main.log (429.8 KB) - added by damon.english@… 10 years ago.
Portfile (3.3 KB) - added by brucemiller (bruce miller) 10 years ago.
Portfile.diff (4.7 KB) - added by brucemiller (bruce miller) 10 years ago.

Download all attachments as: .zip

Change History (17)

Changed 10 years ago by damon.english@…

Attachment: main.log added

comment:1 Changed 10 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to bruce.miller@…
Port: LaTeXML added

In the future, please fill in the Port field and Cc the port maintainers (port info --maintainers LaTeXML).

comment:2 Changed 10 years ago by brucemiller (bruce miller)

It appears that I have (at least) 2 problems in my Portfile, in trying to deal with installing LaTeXML-specific LaTeX style files into whatever TeX installation is present (it wants to find 2 commands: kpsewhich and mktexlsr). Presumably it works fine if MacPort's texlive is installed (? not yet tested separately). However it fails to detect MacTeX's presence: On my system, MacTeX's binaries ended up in /usr/texbin/, which MacTeX has pushed onto $PATH.

I just now see the documentation on binpath, that the $PATH being used within port is restricted, but it is recommended not to mess with it. Is there a legitimate way to use the user's $PATH? (it wouldn't be very maintainable to explicitly add /usr/texbin/, since that assumes MacTeX with its default installation).

The second problem is the last line of the Portfile:

   post-activate { system "mktexlsr" }

That needs to run after the real (not staged) installation, to freshen TeX's database of installed style files so that it sees LaTeXML's new files. However, it really should be "soft" because we don't know whether there really is a mktexlsr available. Would it be safe to simply recode that as:

   post-activate { system "which mktexlsr && mktexlsr" }

or is there a better way?

Thanks for any help...

comment:3 Changed 10 years ago by brucemiller (bruce miller)

Ah, so the various scripts are TCL, so maybe the following is best:

   post-activate { catch { exec "mktexlsr" } }

After "fixing" that, I discovered that even with a proper Portfile, I still end up with the problem that the executables are installed in /opt/local/libexec/perl5.16/sitebin/, which is not in the typical user's path. Nor does that path get added automatically, as does /opt/local/bin. And frankly, it seems perverse to print a message to the user "Please add /opt/local/libexc/perl6.16/sitebin/ to your $PATH".

From previous discussions here and on the mailing list, I gathered that the "recommended" solution is to add symlinks from /opt/local/bin to the actual installation.

I've made those changes to the Portfile; Please, portfile experts take a look. If it's acceptable, please, @sean, could you commit the change?

Thanks

comment:4 Changed 10 years ago by brucemiller (bruce miller)

I replaced the exec command by system "mktexlsr || true" , as suggested by Joshua Root (it seems a bit cleaner). But I couldn't get PortGroup perl5 to link the binaries, so I left in the explicit links in post-activate (and remove them in post-deactivate).

comment:5 Changed 10 years ago by mojca (Mojca Miklavec)

There are a lot of problems with the current approach, but the changes you proposed in the diff (pre-activate and post-deactivate) should be done during the post-destroot phase. Then the symlinks get removed automatically with deactivate.

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

Cc: mojca@… added

Cc Me!

comment:7 Changed 10 years ago by brucemiller (bruce miller)

OK, let's try a completely different approach...

Firstly, I did manage to get PortGroup perl5 to work (noting that it does nothing useful unless you call perl5.setup; that could stand to be documented a bit better in the MacPorts Guide). So the intstallation of executables seems well solved.

To deal with the various possible TeX installations, I created two variants:

  • default: no assumption of there being a TeX installation; doesn't install LaTeXML's style files.
  • +texlive: adds dependency on macport's texlive and installs LaTeXML's style files in texlive's texmf.
  • +mactex: verifies(?) presence of MacTeX, installs LaTeXML's style files in MacTeX's texmf. I've set destroot.violate_mtree to clarify that this is intentional.

This gets pretty close to MacPort's ideal of clean, reproducible installation, since it only mucks around outside macports when you explicitly ask for it. It gives up some "automagic", but I suppose if there are other TeX candidates, they'll need their own variant.

Is this reasonable and/or acceptable?

Changed 10 years ago by brucemiller (bruce miller)

Attachment: Portfile added

Changed 10 years ago by brucemiller (bruce miller)

Attachment: Portfile.diff added

comment:8 Changed 10 years ago by damon.english@…

Could this trouble ticket get some attention please?

comment:9 in reply to:  7 Changed 10 years ago by neverpanic (Clemens Lang)

Resolution: fixed
Status: newclosed

Replying to bruce.miller@…:

Firstly, I did manage to get PortGroup perl5 to work (noting that it does nothing useful unless you call perl5.setup; that could stand to be documented a bit better in the MacPorts Guide). So the intstallation of executables seems well solved.

Yes, I agree documentation of the PortGroups currently lacks.

Is this reasonable and/or acceptable?

Sounds reasonable to me, r122050. This could probably be improved by automatically adding the relevant variant to the default variants if a TeX installation is detected, but I'd rather get this out now than delay it more.

Btw, users that want to use MacTeX are expected to add /usr/texbin to their path in macports.conf manually.

comment:10 Changed 10 years ago by damon.english@…

Thanks for the response. I still get the same error. I tried clean, uninstall, clean, install. Do I need to wait?

Also, where in macports do I add /usr/textbin to the path? To binpath, (seems the logical choice but I would like confirmation please)?

comment:11 Changed 10 years ago by neverpanic (Clemens Lang)

Did you run selfupdate before trying? Also, updates may be delayed by up to 30 minutes, so if it didn't work right away, try again now.

Yes, /usr/texbin needs to be added to binpath in $prefix/etc/macports/macports.conf.

comment:12 Changed 10 years ago by damon.english@…

Ah... no, I had not run selfupdate. Now that I have (as well as 'upgrade outdated'), I get

---> Fetching archive for LaTeXML

---> Attempting to fetch LaTeXML-0.8.0_0.darwin_13.x86_64.tbz2 from http://packages.macports.org/LaTeXML

...[many more repositories attempted here]

---> Attempting to fetch LaTeXML-0.8.0.tar.gz from http://svn.macports.org/repository/macports/distfiles/LaTeXML

Error: org.macports.fetch for port LaTeXML returned: fetch failed

Is this just the 30 minute propagation delay?

comment:13 Changed 10 years ago by neverpanic (Clemens Lang)

Sorry, that was my bad. Fixed in r122061.

comment:14 Changed 10 years ago by damon.english@…

Ok. Well it seems to install, with warnings. Thanks to one and all.

Warning: violation by /usr
Warning: LaTeXML violates the layout of the ports-filesystems!
Warning: Please fix or indicate this misbehavior (if it is intended), it will be an error in future releases!
--->  Installing LaTeXML @0.8.0_0
--->  Activating LaTeXML @0.8.0_0

LaTeXML works best with some version of TeX installed.  Please consider +texlive variant, or PRE-install MacTeX and use +mactex variant.

--->  Cleaning LaTeXML
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  No broken files found.
Note: See TracTickets for help on using tickets.