# Unable to compile gpac-0.6



## shahzaib (Oct 24, 2016)

Hi,

I am trying to compile latest gpac on FreeBSD-10.3 since it comes with gpac-0.5 in ports while we need 0.6 version. So i tried to download latest from github (https://github.com/gpac/gpac.git) but on gmake it gives following error :

http://prntscr.com/cy8hbp

Can i get any help to fix it ?


----------



## SirDice (Oct 24, 2016)

If you look at the port you'll see a bunch of FreeBSD specific patches in the files/ directory. It's likely the new version will also require some patches in order to build correctly.

https://svnweb.freebsd.org/ports/head/multimedia/gpac-libgpac/files/


----------



## shahzaib (Oct 24, 2016)

Hi, thanks for prompt response though can you please explain a bit more ? Do we need to update ports or what ?


----------



## SirDice (Oct 24, 2016)

If you look at the existing port (0.5), there are patches required to make it build properly. You most likely need similar patches to get 0.6 to build correctly. So you'll have to figure out what to patch.


----------



## shahzaib (Oct 24, 2016)

Hi, can you please direct me to some tutorial to learn about it ? I've no idea on how to patch & compile package on FreeBSD


----------



## SirDice (Oct 24, 2016)

There's no ready made tutorial for this as it will be different for each application. 

Porter's Handbook: 4.4. Patching


----------



## marcelbonnet (Oct 24, 2016)

I also suggest you:

- read the INSTALL and README files in source code of the new version you want to port. Sometime it is easier than we think.

then choose one of the two to start (no one is better than the other, it depends too much on the scenario)

Approach 1 : doing things directly

- run ./configure - it will point some problem or not, that you'll need to patch
- run make if it was properly configured. it will also point errors ... missing libs ...

Approach 2 : using the port system

- adjust the old port Makefile to the new one (update VERSION )
- check if any of the files/* patches are still valid (some source files my changed, some not... sometimes it changed but the subject of patch still valid ... like an include that need to be changed, a function call ... so do not trash the old patches yet! )
- run make , it will fail a lot, but you'll start to get some point to fix

And remember to set DEVELOPER=yes  , see the Porter's Handbook for more info on how to do it. You must read that book anyway! You may read it first, in the middle of the process , but you it is a must to.

Hope we helped you to get some fun.


----------

