Hola Amigos,

Here I am going to show how to setup and install my MacPorts development branch (gsoc15-dependency) and libsolv.

Step 1: Clone my development branch inside ~/Development folder probably so that we do not mess up other folders/files. You are free to do it in your preferred folder too.

If you do not have ~/Development folder you can run:

mkdir ~/Development; cd ~/Development

Now we will clone our svn repository. To do so run:

svn co https://svn.macports.org/repository/macports/branches/gsoc15-dependency
cd base

Note: I will be setting up everything inside ~/Development. If you choose to do it under other folder, do remember to replace ~/Development in the following commands with your folder path.

Step 2: Installing MacPorts Development branch.

As this is a testing branch, we do not want it to install and interfere with our installed MacPorts in ${prefix} i.e. /opt/local (default).

Run the following command to make sure it is installed in ~/Development/mp_libsolv (you can give any name by replacing “mp_libsolv”) and also we will have to –disable-readline (we do not want this development version to be used by default by adding it to our PATH).

PATH=/usr/bin:/bin:/usr/sbin:/sbin ./configure --prefix ~/Development/mp_libsolv

Step 3: Adding alias for this development port.

To run this dev version of port you will have to run using “~/Development/mp_libsolv/bin/port”. So instead we will create a alias in our bash_profile. To do so run the following command.

echo 'alias portgsoc="/Users/JacksonIsaac/Development/mp_libsolv/bin/port"' >> ~/.bash_profile

You can also give some other alias instead of portgsoc and also remember to fix the absolute path i.e. “/Users/JacksonIsaac/Development/mp_libsolv” to your installed folder. You can also get that by running “pwd” inside ~/Development/mp_libsolv folder.

We will have to create a alias for sudo too if we want sudo to recognize this “portgsoc” alias (for installing and updating ports which need root access).

echo 'alias sudo="sudo "' >> ~/.bash_profile

Step 4: Test our development port

Now we will test if our development port is working fine or not. To do so I will be updating the portindex and some port operation.

sudo portgsoc -d selfupdate
portgsoc search libsolv

To add libsolv support to our Development port, we need to build libsolv.

Step 5: Cloning libsolv from upstream.

Libsolv port is available (but the current version is 0.6.10) which does not support Tcl bindings yet. So we will clone the upstream branch for now and build from source against our portgsoc-tclsh.

Under ~/Devlopment run the following commands:

git clone https://github.com/openSUSE/libsolv.git
cd libsolv
mkdir build; cd build

Now we will run cmake inside build/ so that we do not mess up the root folder with make files and if we need to delete this folder and run cmake again if something goes wrong while building.

cmake -DTCL_INCLUDE_PATH=${prefix}/libexec/macports/include -DTCL_LIBRARY=${prefix}/libexec/macports/lib/libtcl8.5.dylib -DTCL_TCLSH=${prefix}/libexec/macports/bin/tclsh8.5 -DENABLE_TCL:BOOL=ON ..

Note: Replace ${prefix} with your installation path i.e. ~/Development/mp_libsolv if you exactly followed the steps above.

Now libsolv is ready to be installed against our portgsoc-tclsh, so run the following make commands (in build/):

sudo make install

Okay so now we are set to use the libsolv feature in our MacPorts libsolv branch. You can test libsolv search feature by using -l option.
Example commands are:

portgsoc -l search libsolv
portgsoc -l search --category math
portgsoc -l search --exact --case-sensitive gcc5

and so on. You can also pass -d for debug options.

Let the Windows be open, and feel the Freedom.


One thought on “[GSoC 2015] Setting up MacPorts libsolv branch

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s