[PC-BSD Pbi-dev] Using OptionsNG with pbi.conf

Ken Moore ken at pcbsd.org
Tue Oct 16 15:51:29 PDT 2012


OK, I have just finished a bunch of testing with using OptionsNG 
settings in pbi.conf, and it does work quite well (with a couple 
caveats). It does work with more than one option set (or unset), since I 
did not see any problems when turning on/off multiple options at a time.

1)
The port that you are setting the options for must support the optionsNG 
format (all ports should be converted to this format sometime in the 
near future, but right now it is a good mix of converted/unconverted 
ports).
This can be done by simply checking to make sure that the string 
"OPTIONS_DEFINE=" exists within the port's Makefile:
[code]
grep -r "OPTIONS_DEFINE=" /usr/ports/<port-category>/<portname>.
[/code]
If this command does not return anything, then it is either not 
converted to optionsNG yet, or does not have any options that can be set 
in the first place.

2)  The format for pbi.conf is as follows :

Old Method:
[code]
PBI_MAKEOPTS="WITH_X=true WITH_Y=true WITHOUT_Z=true"
[/code]

New Method:
[code]
PBI_MAKEOPTS="<portname>_SET= X Y
<portname>_UNSET= Z"
[/code]
(The "unset" options *MUST* be on a different line from the "set" 
options if both "set" and "unset" are used)

****************
I have also discovered that if you are using the package caching option 
when building PBI's, you will need to remove the package for the desired 
port if you are simply rebuilding the PBI with different options.
Example:
1) I convert the port "audio/abcde" into a PBI with all the default options.
2) I realize it is missing a codec, and set a couple of the options for 
those codecs.
3) Before rebuilding the PBI, I need to remove the "abcde-<version>.txz" 
and "abcde-<version>.txz.sha256" files from <home-dir>/EasyPBI/.cache 
(if using EasyPBI). If I do not remove those files (and the port version 
is not different from the last time I built the PBI), it will simply use 
the current package (and options set within that package) to build the 
PBI rather than rebuilding the port with the new options.

*****************
Because of the results of this testing, I am working on a patch to 
EasyPBI for 9.1-[RC3/Release] that will properly convert the 
WITH/WITHOUT options to the OptionsNG format if necessary (the GUI will 
not reflect this however, it is just a change in the backend when 
writing pbi.conf).
The EasyPBI GUI will be modified to reflect this change in the new 
version of EasyPBI for PC-BSD-9.2 (or earlier if you build it from sources).

I am also going to start going through all of our 1000+ PBI modules and 
start converting them over to the new format as soon as possible. This 
should ensure that there are no errors when building our current PBI's 
for the AppCafe.

Please let me know if you run into any issues when implementing these 
changes.

-- 
~~ Ken Moore ~~
PC-BSD/iXsystems



More information about the Pbi-dev mailing list