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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,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.


How do I get started?
---------------------
Expand All @@ -43,11 +46,27 @@ The resulting docs can be found in ``_docs/_build``
How do I build docs for private libraries?
------------------------------------------

The following creates docs for the in gnome-music included libgd::
The following creates docs for the libgd bundled and included in gnome-music::

XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share/gnome-music/ \
GI_TYPELIB_PATH=/usr/lib/x86_64-linux-gnu/gnome-music/girepository-1.0/ \
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/gnome-music/ ./build.sh Gd-1.0
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/gnome-music/ ./tools/build.sh Gd-1.0

Explanations:

1) ``$XDG_DATA_DIR/gir-1.0`` (not ``$XDG_DATA_DIR``!) contains ``Gd-1.0.gir``.

2) ``$GI_TYPELIB_PATH`` contains ``Gd-1.0.typelib``.

3) ``$LD_LIBRARY_PATH`` contains ``libgd.so``.

Another example. For the case of HarfBuzz freshly built from source,
``HarfBuzz-0.0.gir``, ``HarfBuzz-0.0.typelib`` are both inside a ``src``
sub-directory in the HarfBuzz source tree, while ``libharfbuzz.so``
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?



Intersphinx
Expand Down
6 changes: 6 additions & 0 deletions tools/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ else
pip install beautifulsoup4
pip install jinja2
pip install cairocffi

# Redhat/Fedora systems may have a certifi package from cert.org,
# 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.

fi