client = env.Program(
target = '$BUILDDIR/common/client/lyxclient',
- LIBS = env['BOOST_LIBRARIES'] + env['socket_libs'] + ['supports'],
+ LIBS = env['BOOST_LIBRARIES'] + env['SOCKET_LIBS'] + ['supports'],
source = ["$BUILDDIR/common/client/%s" % x for x in Split('''
boost.C
client.C
messages.C
''')]
)
- Alias('client', env.fileCopy('$BUILDDIR/lyxclient', '$BUILDDIR/common/client/lyxclient'))
+ Alias('client', env.Command(os.path.join('$BUILDDIR', os.path.split(str(client[0]))[1]),
+ client, [Copy('$TARGET', '$SOURCE')]))
Alias('client', client)
text.C
''')]
)
- Alias('tex2lyx', env.fileCopy('$BUILDDIR/tex2lyx', '$BUILDDIR/common/tex2lyx/tex2lyx'))
+ Alias('tex2lyx', env.Command(os.path.join('$BUILDDIR', os.path.split(str(tex2lyx[0]))[1]),
+ tex2lyx, [Copy('$TARGET', '$SOURCE')]))
Alias('tex2lyx', tex2lyx)
+
+
+if build_lyx or 'lyxbase' in targets:
#
# src/
#
-
-if build_lyx or 'lyxbase' in targets:
print "Processing files in src"
env['SUBST_KEYS'] = ['PACKAGE_VERSION', 'VERSION_INFO']
''')
if env.has_key('USE_ASPELL') and env['USE_ASPELL']:
- lyx_source_pre.append('aspell.C')
+ lyx_source_post.append('aspell.C')
elif env.has_key('USE_PSPELL') and env['USE_PSPELL']:
- lyx_source_pre.append('pspell.C')
+ lyx_source_post.append('pspell.C')
elif env.has_key('USE_ISPELL') and env['USE_ISPELL']:
- lyx_source_pre.append('ispell.C')
+ lyx_source_post.append('ispell.C')
lyxbase_pre = env.StaticLibrary(
target = '$LOCALLIBPATH/lyxbase_pre',
] +
env['BOOST_LIBRARIES'] +
env['EXTRA_LIBS'] +
+ env['SOCKET_LIBS'] +
env['SYSTEM_LIBS']
)
- Alias('lyx', env.fileCopy('$BUILDDIR/lyx-$frontend', '$BUILDDIR/$frontend/lyx'))
+ # [/path/to/lyx.ext] => lyx-qt3.ext
+ target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx-%s' % frontend)
+ Alias('lyx', env.Command(os.path.join('$BUILDDIR', target_name), lyx,
+ [Copy('$TARGET', '$SOURCE')]))
Alias('lyx', lyx)
# with the hope that scons can finish standarding this soon.
#
import glob
-
+
+ # windows: $PREFIX/Resources
+ # others: $PREDIX/share/lyx
+ share_dir = env['SHARE_DIR']
+ # windows: $PREFIX/Resouces/man/man1
+ # others: $PREFIX/man/man1
+ man_dir = env['MAN_DIR']
+ # windows: $PREFIX/Resources/locale
+ # others: $PREFIX/share/locale
+ locale_dir = env['LOCALE_DIR']
+
def install(dest, src):
''' recusive installation of src '''
# separate file and directory
glob.glob(os.path.join(dir, '*'))) )
return ins_dir
#
- # other targets include client, tex2lyx
+ # executables
env.Install(env['BIN_DIR'], [lyx, tex2lyx, client])
Alias('install', env['BIN_DIR'])
#
- # copy files
- dirs = install(os.path.join(env['PREFIX'], 'share/lyx/'),
+ # share/lyx
+ dirs = install(env['SHARE_DIR'],
[env.subst('$TOP_SRC_DIR/lib/') + file for file in ['configure.py', 'encodings',
'chkconfig.ltx', 'CREDITS', 'external_templates', 'symbols', 'languages',
'lyxrc.example', 'syntax.default', \
'examples', 'kbd', 'lyx2lyx', 'tex', 'clipart', 'doc', 'ui']]
)
Alias('install', dirs)
+ # man
+ env.InstallAs(os.path.join(env['MAN_DIR'], 'lyx.1'),
+ env.subst('$TOP_SRC_DIR/lyx.man'))
+ env.InstallAs(os.path.join(env['MAN_DIR'], 'tex2lyx.1'),
+ env.subst('$TOP_SRC_DIR/src/tex2lyx/tex2lyx.man'))
+ env.InstallAs(os.path.join(env['MAN_DIR'], 'lyxclient.1'),
+ env.subst('$TOP_SRC_DIR/src/client/lyxclient.man'))
+ Alias('install', [os.path.join(env['MAN_DIR'], x) for
+ x in ['lyx.1', 'tex2lyx.1', 'lyxclient.1']])
+
Default('lyx')
# If not specified, boost tries to figure out by itself, but it may fail.
boost_posix = False
packaging_method = 'windows'
+ share_dir = 'Resources'
+ man_dir = 'Resouces/man/man1'
+ locale_dir = 'Resources/locale'
elif os.name == 'posix' and sys.platform != 'cygwin':
platform_name = sys.platform
default_frontend = 'qt3'
default_with_x = True
boost_posix = True
packaging_method = 'posix'
+ share_dir = 'share/lyx'
+ man_dir = 'man/man1'
+ locale_dir = 'share/locale'
elif os.name == 'posix' and sys.platform == 'cygwin':
platform_name = 'cygwin'
default_frontend = 'qt3'
default_with_x = True
boost_posix = True
packaging_method = 'posix'
+ share_dir = 'share/lyx'
+ man_dir = 'man/man1'
+ locale_dir = 'share/locale'
elif os.name == 'darwin':
platform_name = 'mac'
default_frontend = 'qt3'
default_with_x = False
boost_posix = True
packaging_method = 'msc'
+ share_dir = 'Resources'
+ man_dir = 'Resouces/man/man1'
+ locale_dir = 'Resources/locale'
else: # unsupported system
platform_name = 'others'
default_frontend = 'qt3'
default_with_x = True
boost_posix = False
packaging_method = 'posix'
+ share_dir = 'share/lyx'
+ man_dir = 'man/man1'
+ locale_dir = 'share/locale'
#---------------------------------------------------------
# Handling options
env['BIN_DIR'] = env['exec_prefix']
else:
env['BIN_DIR'] = os.path.join(env['PREFIX'], 'bin')
+env['SHARE_DIR'] = os.path.join(env['PREFIX'], share_dir)
+env['MAN_DIR'] = os.path.join(env['PREFIX'], man_dir)
+env['LOCALE_DIR'] = os.path.join(env['PREFIX'], locale_dir)
# speed up source file processing
#env['CPPSUFFIXES'] = ['.C', '.cc', '.cpp']
# under windows, scons is confused by .C/.c and uses gcc instead of
# g++. I am forcing the use of g++ here. This is expected to change
# after lyx renames all .C files to .cpp
-if platform_name == 'cygwin':\r
+#
+# Solaris seems to use gcc for the last step as well, so, to
+# make sure everyone uses a C++ compiler, linker, I do this for
+# all platform
+#
+# just to be safe
+if env.has_key('CXX') and env['CXX'] != '':
+ env['CC'] = env['CXX']
+ env['LINK'] = env['CXX']
+else:
env['CC'] = 'g++'
env['LINK'] = 'g++'
Exit(1)
# check socket libs
-env['SYSTEM_LIBS'] = []
+env['SOCKET_LIBS'] = []
if conf.CheckLib('socket'):
- env['SYSTEM_LIBS'].append('socket')
+ env['SOCKET_LIBS'].append('socket')
# EF: This is the network services library and provides a
# transport-level interface to networking services.
if conf.CheckLib('nsl'):
- env['SYSTEM_LIBS'].append('nsl')
+ env['SOCKET_LIBS'].append('nsl')
# check boost libraries
boost_opt = ARGUMENTS.get('boost', default_boost_opt)
print " QTDIR: ", env['QTDIR']
if platform_name in ['win32', 'cygwin']:\r
- env['SYSTEM_LIBS'] += ['shlwapi', 'z']
+ env['SYSTEM_LIBS'] = ['shlwapi', 'z']
else:
- env['SYSTEM_LIBS'] += ['z']
+ env['SYSTEM_LIBS'] = ['z']
#
# Build parameters CPPPATH etc
def env_filecopy(target, source, env):
+ ''' target can be a directory '''
shutil.copy(str(source[0]), str(target[0]))
# replace the old SPAWN by the new function
env['SPAWN'] = ls.spawn
-#
-# Install program with permission
-# http://www.scons.org/cgi-sys/cgiwrap/scons/moin.cgi/InstallTargets
-#
-import SCons
-from SCons.Script.SConscript import SConsEnvironment
-
-SConsEnvironment.Chmod = SCons.Action.ActionFactory(os.chmod,
- lambda dest, mode: 'Chmod("%s", 0%o)' % (dest, mode))
-
-def installPerm(target, source, env, perm):
- ''' install program with permission, will copy
- files recursively if needed '''
- # FIXME: mixed use of scons and python interfaces?
- target_dir = str(target[0])
- if os.path.isfile(target_dir):
- print "Target should be a directory: ", target_dir
- return
- if not os.path.isdir(target_dir):
- os.makedirs(target_dir)
- objs = []
- for fnode in source:
- fname = str(fnode)
- print "Installing", fname, "to", target_dir
- if os.path.isfile(fname):
- objs.append(os.path.join(target_dir, fname))
- shutil.copy(fname, target_dir)
- elif os.path.isdir(fname):
- # FIXME: directory permission is not set
- if os.path.isdir(os.path.join(target_dir, fname)):
- shutil.rmtree(os.path.join(target_dir, fname))
- shutil.copytree(fname, target_dir)
- #for i in objs:
- # env.AddPostAction(File(i), env.Chmod(i, perm))
- return target
-
-def env_installProg(target, source, env):
- installPerm(target, source, env, 0755)
-
-def env_installFile(target, source, env):
- installPerm(target, source, env, 0644)
## def DistSources(env, node):
## env.DistFiles(_get_sources(env, node))