- To build debain package, we need:
apt install fakeroot dpkg-dev build-essential \
devscripts debhelper git # with root
# git for fetching debian salsa repo- make a new directory to place binary package and git repo:
mkdir dpkggmt # named by yourself
cd dpkggmt- Fetch GMT Package on salsa git repo maintained by Debian GIS Project:
git clone https://salsa.debian.org/debian-gis-team/gmt.git gmt-debian
## renamed with gmt-debian in case of cufusing with gmt offical git repo- checkout experimental branch
cd gmt-debian && git checkout experimental- use mk-build-deps to make a virtual package with build dependencies
(more convenient to
autoremove)
mk-build-deps debian/control
apt install --no-install-recommends ./gmt-build-deps_6.0.0~rc2+dfsg-1~exp2_all.deb # with root
apt --fix-broken --no-install-recommends install # with root- start to build package
debuild -b -rfakeroot -us -uc- intsall gmt6
apt install ./gmt_6.0.0~rc2+dfsg-1~exp2_amd64.deb \
./libgmt6_6.0.0~rc2+dfsg-1~exp2_amd64.deb \
./gmt-common_6.0.0~rc2+dfsg-1~exp2_all.deb \
./gmt-doc_6.0.0~rc2+dfsg-1~exp2_all.deb \
./libgmt-dev_6.0.0~rc2+dfsg-1~exp2_amd64.deb # with root- install python3 (>=3.7, default version in buster), virtualenv
apt install virtualenv # with root- make another directory named
pygmt
mkdir pygmt- make virtual environment with
virtualenv
virtualenv -p $(which python3) pygmt- set up gmt library environment path, activate it
cd pygmt
echo 'export GMT_LIBRARY_PATH="/lib/x86_64-linux-gnu"' >> bin/activate
source bin/activate ## enter "deactivate" command to exit the environment- install git version pygmt with pip in virtual environment
#pip insatll pygmt ## there's some problem in PyPI verion
pip install https://github.com/GenericMappingTools/pygmt/archive/master.tar.gz- use python (python3) to test
python>>> import pygmt ## if there's no error message, it works!if advanced test is needed:
curl -LO https://github.com/GenericMappingTools/pygmt/raw/master/requirements-dev.txt
pip install -r requirements-dev.txt
python -c "import pygmt;pygmt.test()"
You can also test with these example in offcial tutorials: https://www.pygmt.org/dev/tutorials/first-figure.html