Re: MacPorts vs Homebrew on MacOS

Bill Deegan <bill-cJFiu+DHMVC5azolltMz9laTQe2KTcn/@public.gmane.org>
Newsgroups gmane.comp.programming.tools.scons.devel
Message-ID <CAEyG4CHWHSVEBCPDehoOxRxNfC3Voenq8sSxth7C11g3nZyjJQ@mail.gmail.com>
Rob,

Also I extended the logic as follows (in default branch currently, but not
in prior releases)

def generate(env):
    posix.generate(env)
    env['SHLIBSUFFIX'] = '.dylib'
    # put macports paths at front to override Apple's versions, fink
path is after
    # For now let people who want Macports or Fink tools specify it!
    # env['ENV']['PATH'] = '/opt/local/bin:/opt/local/sbin:' +
env['ENV']['PATH'] + ':/sw/bin'

    # Store extra system paths in env['ENV']['PATHOSX']

    filelist = ['/etc/paths',]
    # make sure this works on Macs with Tiger or earlier
    try:
        dirlist = os.listdir('/etc/paths.d')
    except:
        dirlist = []

    for file in dirlist:
        filelist.append('/etc/paths.d/'+file)

    for file in filelist:
        if os.path.isfile(file):
            f = open(file, 'r')
            lines = f.readlines()
            for line in lines:
                if line:
                    env.AppendENVPath('PATHOSX', line.strip('\n'))
            f.close()



*    # Not sure why this wasn't the case all along?    if
env['ENV'].get('PATHOSX', False) and
os.environ.get('SCONS_USE_MAC_PATHS', False):
env.AppendENVPath('PATH',env['ENV']['PATHOSX'])*

previously it would process /etc/paths.d but then not use them, now I've
added an environment variable:
SCONS_USE_MAC_PATHS

To enable using the paths in /etc/paths.d.  The code in red is the new
code..

Since one of SCons's goals is to prevent differences in machine or user
PATH or other environment from producing a different build without explicit
user or build script instruction, defaulting to off seems to be correct.

Though perhaps I should also allow setting this variable in Environment()?

-Bill




On Sun, Jun 18, 2017 at 11:13 AM, Managan, Rob <[email protected]> wrote:

> Going from memory here so I may get this slightly wrong.
> On OSX back in those versions I learned that the way the Latex
> installation was done was not in a standard directory but works since OSX
> adds directories to the standard that are in the file /etc/paths.d and also
> in files in /etc/paths/ .  We extended the darwin.py initialization routine
> to add these directories to the ones searched. Not sure if Detect uses
> those but pretty sure exists() does.
>
> Hope this helps
> Rob Managan
>
> Sent from my iPad
>
> > On Jun 17, 2017, at 6:53 AM, Russel Winder <[email protected]> wrote:
> >
> > Well technically OSX since my MBP is still on El Capitan as Apple will
> > not upgrade it.
> >
> > Homebrew puts all it's stuff into (effectively) /usr/local.
> >
> > MacPorts puts all its stuff (definitely) into /opt/local.
> >
> > env.Detect() searches in /usr/local but not in /opt/local. SCons thus
> > discrimiates for Homebrew and against MacPorts. Is this acceptable?
> >
> > --
> > Russel.
> > ============================================================
> =================
> > Dr Russel Winder      t: +44 20 7585 2200   voip:
> sip:[email protected]
> > 41 Buckmaster Road    m: +44 7770 465 077   xmpp: [email protected]
> > London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> > _______________________________________________
> > Scons-dev mailing list
> > [email protected]
> > https://pairlist2.pair.net/mailman/listinfo/scons-dev
> _______________________________________________
> Scons-dev mailing list
> [email protected]
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>

_______________________________________________
Scons-dev mailing list
[email protected]
https://pairlist2.pair.net/mailman/listinfo/scons-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.