Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new recipe: dblatex #6078

Merged
merged 3 commits into from
May 21, 2022
Merged

new recipe: dblatex #6078

merged 3 commits into from
May 21, 2022

Conversation

jmairboeck
Copy link
Member

This is a python script to convert DocBook to LaTeX.
It is another (optional) dependency of LilyPond.

Note: this depends on texlive and can therefore not be built as long as that is disabled.

jmairboeck added a commit to jmairboeck/haikuports that referenced this pull request Oct 16, 2021
this is an optional dependency of dblatex (see haikuports#6078)
@jmairboeck jmairboeck mentioned this pull request Oct 16, 2021
@jmairboeck
Copy link
Member Author

I have now updated the recipe to use the split texlive package names from #6229. If that could get merged, we could activate and merge this one too probably.

Maybe I should start writing the actual Lilypond recipe in the meantime ...

@jmairboeck
Copy link
Member Author

I just noticed that this doesn't work correctly when packaged. dblatex --version prints the following error message:

/packages/python3-3.7.12-1/.self/lib/python3.7/vendor-packages> dblatex --version
Traceback (most recent call last):
  File "/bin/dblatex", line 11, in <module>
    dblatex.main(base=package_base)
  File "/packages/python3-3.7.12-1/.self/lib/python3.7/vendor-packages/dbtexmf/dblatex/dblatex.py", line 43, in main
    command.main()
  File "/packages/python3-3.7.12-1/.self/lib/python3.7/vendor-packages/dbtexmf/core/dbtex.py", line 688, in main
    version = run.get_version()
  File "/packages/python3-3.7.12-1/.self/lib/python3.7/vendor-packages/dbtexmf/core/dbtex.py", line 204, in get_version
    f = open(os.path.join(self.topdir, "xsl", "version.xsl"), "rt", encoding="latin-1")
FileNotFoundError: [Errno -2147459069] No such file or directory: '/boot/system/lib/python3.7/vendor-packages/packages/dblatex-0.3.12-1/.self/data/dblatex/xsl/version.xsl'

It seems to use a relative path as base path that should be absolute instead.

@jmairboeck
Copy link
Member Author

the above is just an example, when running it from the home directory, it searches in /boot/home/packages/dblatex-0.3.12-1/.self/data/dblatex/xsl/version.xsl.

Only when running it from the root directory, it works correctly.

This is a python script to convert DocBook to LaTeX.
It is another (optional) dependency of LilyPond.

Note: this depends on texlive and can therefore not be built as long as that is disabled.
@jmairboeck
Copy link
Member Author

the above is just an example, when running it from the home directory, it searches in /boot/home/packages/dblatex-0.3.12-1/.self/data/dblatex/xsl/version.xsl.

Only when running it from the root directory, it works correctly.

I have solved the problem by removing --root=/ from the setup.py install call.

@korli
Copy link
Contributor

korli commented Apr 4, 2022

the above is just an example, when running it from the home directory, it searches in /boot/home/packages/dblatex-0.3.12-1/.self/data/dblatex/xsl/version.xsl.
Only when running it from the root directory, it works correctly.

I have solved the problem by removing --root=/ from the setup.py install call.

The install location should come first in PYTHONPATH, see for instance: https://github.com/haikuports/haikuports/blob/master/dev-python/aiodns/aiodns-2.0.0.recipe#L50

@jmairboeck
Copy link
Member Author

jmairboeck commented Apr 4, 2022

What is the purpose of --root=/ anyway?

The "problem" was the following: the setup.py script of dblatex creates a launcher script that gets installed in $prefix/bin. This uses package_base to find its files. The problematic function here is _strip_root (see here), which removes the root dir if it is a prefix of the package_path, therefore stripping the initial '/' and resulting in an incorrect relative path.

@jmairboeck jmairboeck mentioned this pull request Apr 24, 2022
@Begasus
Copy link
Contributor

Begasus commented Apr 25, 2022

Needs merging for texlive update first: #6818

@Begasus Begasus merged commit 54b4733 into haikuports:master May 21, 2022
@jmairboeck jmairboeck deleted the dblatex branch May 21, 2022 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants