Scons and DESTDIR support

441 views
Skip to first unread message

Blair Zajac

unread,
Jul 13, 2013, 1:49:57 PM7/13/13
to serf...@googlegroups.com
I'm working on building the 1.3.x branch on MacPorts. Like building
RPM, MacPorts installs into a DESTDIR that mirrors the PREFIX.

However, trying the same commands that mongodb uses to install, which is
also a scons project, fails.

Here's the output from `port -v destroot serf1`:

DEBUG: Executing command line: cd
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_serf1/serf1/work/1.3.x"
&& /opt/local/bin/scons install
--prefix=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_serf1/serf1/work/destroot/opt/local

scons: Reading SConscript files ...
scons: done reading SConscript files.
usage: scons [OPTION] [TARGET] ...

SCons Error: no such option: --prefix

And here's the MacPorts portfile for serf1 that I'm currently using:

https://gist.github.com/blair/5989662

Is there DESTDIR support in serf's SConstruct that I'm not using
correctly? Does it need to be added?

Thanks,
Blair

Bert Huijben

unread,
Jul 13, 2013, 4:28:25 PM7/13/13
to serf...@googlegroups.com
In my script I currently use:

<exec program="${sconsApp}" workingdir="${serfDir}" >
<environment>
<variable name="PYTHONPATH" dir="${sconsPythonPath}" />
</environment>
<arg value="PREFIX=${buildRoot}/${platform}/release" />
<arg value="OPENSSL=../openssl-${opensslVersion}" />
<arg value="ZLIB=../zlib-${zlibVersion}" />
<arg value="APR=../lib" />
<arg value="APU=../lib" />
<arg value="APR_STATIC=yes" if="${static}" />
<arg value="install" />
</exec>

So PREFIX=<path>, in uppercase and no '--' prefix should work

Bert


Blair Zajac

unread,
Jul 14, 2013, 5:19:18 PM7/14/13
to serf...@googlegroups.com
So you do one build with PREFIX=/opt/local and a install with PREFIX=/opt/local/var/macports/build/serf1/destroot?

Blair

Lieven Govaerts

unread,
Jul 27, 2013, 5:34:50 AM7/27/13
to serf...@googlegroups.com
Blair,


On Sun, Jul 14, 2013 at 11:19 PM, Blair Zajac <bl...@orcaware.com> wrote:
> So you do one build with PREFIX=/opt/local and a install with
> PREFIX=/opt/local/var/macports/build/serf1/destroot?

you should be able to do the following:
scons PREFIX=/opt/local
scons install --install-sandbox=/opt/local/var/macports/build/serf1/destroot

The libraries, include files and .pc file will then be installed under
/opt/local/var/macports/build/serf1/destroot/opt/local/[lib|include|lib/pkgconfig]

On Mac OS X you'll need to merge r2080 to fix the shared library id.

Lieven
> --
> You received this message because you are subscribed to the Google Groups
> "Serf Development List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to serf-dev+u...@googlegroups.com.
> To post to this group, send email to serf...@googlegroups.com.
> Visit this group at http://groups.google.com/group/serf-dev.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Blair Zajac

unread,
Jul 27, 2013, 3:04:03 PM7/27/13
to serf...@googlegroups.com, Lieven Govaerts
On 7/27/13 2:34 AM, Lieven Govaerts wrote:
> Blair,
>
>
> On Sun, Jul 14, 2013 at 11:19 PM, Blair Zajac<bl...@orcaware.com> wrote:
>> So you do one build with PREFIX=/opt/local and a install with
>> PREFIX=/opt/local/var/macports/build/serf1/destroot?
>
> you should be able to do the following:
> scons PREFIX=/opt/local
> scons install --install-sandbox=/opt/local/var/macports/build/serf1/destroot
>
> The libraries, include files and .pc file will then be installed under
> /opt/local/var/macports/build/serf1/destroot/opt/local/[lib|include|lib/pkgconfig]
>
> On Mac OS X you'll need to merge r2080 to fix the shared library id.

Thanks, I'm getting further with the build now.

The old system would install /opt/local/lib/libserf-1.0.dylib but it now
installs /opt/local/lib/libserf-1.dylib so it's causing failures for all
packages that depend upon it. How do I tell scons I want to name it
libserf-1.0.dylib?

Blair

Greg Stein

unread,
Jul 27, 2013, 9:20:48 PM7/27/13
to serf...@googlegroups.com
On Sat, Jul 27, 2013 at 3:04 PM, Blair Zajac <bl...@orcaware.com> wrote:
> On 7/27/13 2:34 AM, Lieven Govaerts wrote:
>...
>> you should be able to do the following:
>> scons PREFIX=/opt/local
>> scons install
>> --install-sandbox=/opt/local/var/macports/build/serf1/destroot
>>
>> The libraries, include files and .pc file will then be installed under
>>
>> /opt/local/var/macports/build/serf1/destroot/opt/local/[lib|include|lib/pkgconfig]
>>
>> On Mac OS X you'll need to merge r2080 to fix the shared library id.
>
> Thanks, I'm getting further with the build now.
>
> The old system would install /opt/local/lib/libserf-1.0.dylib but it now
> installs /opt/local/lib/libserf-1.dylib so it's causing failures for all
> packages that depend upon it. How do I tell scons I want to name it
> libserf-1.0.dylib?

I've been reading up on Mac dynamic library support at:
https://developer.apple.com/library/mac/documentation/developertools/conceptual/DynamicLibraries/100-Articles/CreatingDynamicLibraries.html

WIth that and the SHLIBVERSION that Bert mentioned in issue #112... I
think we can get this done up Right.

Cheers,
-g
Reply all
Reply to author
Forward
0 new messages