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

A bit of doc update, and HarBuzz built from source example #172

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

HinTak
Copy link

@HinTak HinTak commented Oct 4, 2018

The "gir-1.0" is not obvious - I needed to run strace to figure that out.

@HinTak
Copy link
Author

HinTak commented Oct 4, 2018

I want to write a bit about virtualenv also, please don't pull yet.

@HinTak HinTak force-pushed the master branch 2 times, most recently from e7531ca to 5944eb3 Compare October 5, 2018 00:51
@HinTak
Copy link
Author

HinTak commented Oct 5, 2018

I can't seem to figure out how to do `pwd` (for the pythonpath part), but this is all I wanted to write. Please review and pull.

@@ -29,6 +29,9 @@ Requirements
Calling ``source ./tools/bootstrap.sh`` will put you in a
virtualenv with all dependencies installed (except graphviz).

Afterwards, you may need to set ``PYTHONPATH`` to
``_venv/lib/python*/site-packages/``, where ``*`` is the
version number of your python installation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something isn't right here, that should be handled by the virtualenv

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I try to run ./tools/build.sh, it says it cannot find "pgi". _venv/bin/activate modifies PATH so there is a private copy of python, etc but still cannot find the libs. By the way python itself is small - there is libpython elsewhere.

I am not familiar with virtualenv, and documentation is poor. Is there any way of checkin what it is supposed to be doing and what it is not?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a bit of digging, and found something curious. If I start python interactively, it can find pgi:

(_venv) [Hin-Tak@localhost pgi-docgen]$ python
Python 3.6.6 (default, Jul 19 2018, 14:25:17) 
[GCC 8.1.1 20180712 (Red Hat 8.1.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pgi
>>> 

and if I just run the content of pgidocgen.py it works:

$ python
Python 3.6.6 (default, Jul 19 2018, 14:25:17) 
[GCC 8.1.1 20180712 (Red Hat 8.1.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> from pgidocgen.main import main
>>> import pgi
>>> main(["pgidocgen.py","create","_docs", "HarfBuzz-0.0"])

but somehow running pgidocgen.py via tools/build.sh does not work.

is in a ``src/.libs`` sub-directory. So you need to create a directory
``gir-1.0`` further inside, copy ``HarfBuzz-0.0.gir`` over there, and set
``$XDG_DATA_DIR`` to the **parent directory** of your newly created ``gir-1.0``,
``$GI_TYPELIB_PATH`` to ``src``, and ``$LD_LIBRARY_PATH`` to ``src/.libs``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an alternative is to install things to a prefix and point things to there, but I guess this will do.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also found that setting $XDG_DATA_DIR does not work; but it is looking for gir's in /home/Hin-Tak/.local/share/flatpak/exports/share/gir-1.0 which at least is one place under my control.

It is looking at gir's at only 4 places:

/home/Hin-Tak/.local/share/flatpak/exports/share/gir-1.0
/var/lib/flatpak/exports/share/gir-1.0
/usr/local/share/gir-1.0
/usr/share/gir-1.0

This suggests that setting prefix probably does not work either?

# which is without cacert.pem .
if [ -f /etc/redhat-release ]; then
pip install --ignore-installed certifi
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh, ok :/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot quite figure out what the code is trying to do, but for each package, it tries to download something from somewhere? The doc for the cert package (from forensics.cert.org) says you should use the system's certificate collection instead, which is located under /etc/pki, I think.

@lazka
Copy link
Member

lazka commented Oct 6, 2018

somewhat related: I've filed #173

@HinTak
Copy link
Author

HinTak commented Oct 6, 2018

Actually pgi-docgen's installation was not not too bad. I was reluctant to run tools/bootstrap.sh for a long time fearing it would download lots of stuff. It only put about 20MB on my hard disk.

Running it was more an issue - as you saw, it took me a bit of time to figure out how to regenerate HarfBuzz's doc from dev source (after I made some gobject annotation changes); the cert package situation was curious though understandable - the packager wants you to use the code but not the bundled certificates (which can get out of date). I also was not expecting it to recurse through my system's GIR directory and regenerating dependent packages' docs when I only asked for one.

As far as this pull goes, I think your only objection is the pythonpath one? I think it is not ideal either, and I like to figure out what's wrong if there is any tips in looking into that.

@HinTak
Copy link
Author

HinTak commented Dec 3, 2020

Apologies, been a while. I'll come back to this and see if there is any more work to be done soon...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants