Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "remove ancient/unused scripts" #56

Merged
merged 1 commit into from
Jun 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
_build.*
bin/
doc/README.md
etc/
# /
/autom4te.cache
/configure
/config.log
/.sconsign.dblite
/.sconf_temp
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ lsst
This package sets up a basic environment needed to:

1. install packages from the LSST software server
2. build LSST products from git
3. build external software that uses LSST products

For building products, this package provides the following:

* it setups up the base package, which is necessary for properly
loading LSST python modules.

For managing products, this package provides the following:

Expand Down
28 changes: 27 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# -*- python -*-
from lsst.sconsUtils import scripts, env, targets
#
# Setup our environment
#
import glob, os.path, re, os, sys
from lsst.sconsUtils import scripts, env, targets, log

# okay start the standard stuff

scripts.BasicSConstruct.initialize("lsst", versionModuleName=None)

targets["doc"].extend(env.Command("doc/README.md", "README.md", [Copy('$TARGET', '$SOURCE')]))

if "check" in BUILD_TARGETS:
env.Command("configure", "configure.ac", ["autoconf"])
env.Command("check", "configure", ["configure"])

env.Help("""
deploy/lsst: LSST Build Environment Tools

This provides tools for building LSST products and installing them into
the software distribution server. This package relies on the eups capabilities.
""")

scripts.BasicSConstruct.finish(subDirList="bin doc ups".split(),
defaultTargets=["bin", "doc", "tests"])

# this is not doing what I want it to do (removing bin)
env.Clean("bin", "bin")
173 changes: 173 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
dnl -*- sh -*-
dnl A configure.ac script that checks that all of LSST's prerequisites are present
dnl
AC_INIT([LSST], "1.0", [rhl@astro.princeton.edu])

dnl sinclude is m4's include directive
dnl sinclude(configMacros/zlib.m4)

AC_PROG_CC
AC_PROG_CXX

AC_CHECK_PROG(curl, curl, yes)
AC_PROG_FC
AC_PROG_LEX
AC_CHECK_PROG(make, make, yes)
AC_CHECK_PROG(perl, perl, yes)
AC_PROG_YACC
AC_CHECK_PROGS(M4, m4, gm4)

if [[ `uname` = "Linux" ]]; then
:
fi

AC_CHECK_HEADERS(X11/Intrinsic.h)
if [[ `uname` = "Darwin" ]]; then
LDFLAGS="$LDFLAGS -L/usr/X11/lib"
fi
AC_CHECK_LIB(Xt, XtAddActions)

AC_CHECK_HEADERS(curses.h)
AC_CHECK_LIB(curses, cbreak)

AC_CHECK_HEADERS(readline/readline.h)
AC_CHECK_LIB(readline, readline)
# if readline is absent, try editline instead
if [[ $ac_cv_header_readline_readline_h != "yes" ]]; then
AC_CHECK_HEADERS(editline/readline.h)
AC_CHECK_LIB(editline, readline)
ac_cv_header_readline_readline_h=$ac_cv_header_editline_readline_h
ac_cv_lib_readline_readline=$ac_cv_lib_editline_readline
fi

dnl AC_CHECK_HEADERS(ext2fs/ext2_io.h)

AC_CHECK_HEADERS(uuid/uuid.h)
if [[ `uname` = "Darwin" ]]; then
AC_CHECK_LIB(System, uuid_parse)
ac_cv_lib_uuid_uuid_parse=$ac_cv_lib_System_uuid_parse
else
AC_CHECK_LIB(uuid, uuid_parse)
fi

AC_CHECK_HEADERS(zlib.h)
AC_CHECK_LIB(z, zlibVersion)

AC_CHECK_HEADERS(bzlib.h)
AC_CHECK_LIB(bz2, BZ2_bzlibVersion)

dnl
dnl Report what we have found out
dnl
ok=yes
echo ""

dnl AC_MSG_RESULT([N.b. we are not checking for e2fsprogs])

if [[ "$ac_cpp" = "" ]]; then
AC_MSG_WARN([Please install a C compiler (gcc on RHEL6)])
ok=no
fi

if [[ "$ac_ct_CXX" = "" ]]; then
AC_MSG_WARN([Please install a C++ compiler (gcc-c++ on RHEL6)])
ok=no
fi

if [[ "$ac_ct_CXX" = "" ]]; then
AC_MSG_WARN([Please install a C++ compiler (gcc-c++ on RHEL6)])
ok=no
fi

if [[ "$GCC" = "yes" ]]; then
GCC_VERSION="$($CC -dumpversion 2>/dev/null || echo 0.0.0)"
GCC_VERSION_MAJOR=$(echo $GCC_VERSION | cut -d'.' -f1)
GCC_VERSION_MINOR=$(echo $GCC_VERSION | cut -d'.' -f2)
if [[ "$GCC_VERSION_MAJOR" -lt 4 -o \( "$GCC_VERSION_MAJOR" -eq 4 -a "$GCC_VERSION_MINOR" -lt 2 \) ]]; then
AC_MSG_WARN([Your GCC is too old (you have $GCC_VERSION, and need at least g++ 4.2)])
ok=no
fi
fi

if [[ "$ac_cv_prog_curl" = "" ]]; then
AC_MSG_WARN([Please install curl (curl on RHEL6)])
ok=no
fi

if [[ "$ac_ct_FC" = "" ]]; then
if false; then
AC_MSG_RESULT([I don't see a fortran compiler. This is probably OK])
else
AC_MSG_WARN([Please install a fortran compiler if you're building numpy (gcc-gfortran on RHEL6)])
ok=no
fi
fi

if [[ "$ac_cv_prog_LEX" = "" ]]; then
AC_MSG_WARN([Please install flex (flex on RHEL6)])
ok=no
fi

if [[ "$ac_cv_prog_make" = "" ]]; then
AC_MSG_WARN([Please install make (make on RHEL6)])
ok=no
fi

if [[ "$ac_cv_prog_perl" = "" ]]; then
AC_MSG_WARN([Please install perl (perl on RHEL6)])
ok=no
fi

if [[ "$ac_cv_prog_YACC" = "" ]]; then
AC_MSG_WARN([Please install bison (bison on RHEL6)])
ok=no
fi

if [[ "$ac_cv_prog_M4" = "" ]]; then
AC_MSG_WARN([Please install m4 (m4 on RHEL6)])
ok=no
fi

if [[ $ac_cv_header_X11_Intrinsic_h != "yes" -o ${ac_cv_lib_Xt_XtAddActions} != "yes" ]]; then
AC_MSG_WARN([Please install X11 (libXt-devel on RHEL6)])
ok=no
fi

if [[ $ac_cv_header_curses_h != "yes" -o $ac_cv_lib_curses_cbreak != "yes" ]]; then
AC_MSG_WARN([Please install curses (ncurses-devel on RHEL6)])
ok=no
fi

if [[ $ac_cv_header_readline_readline_h != "yes" -o $ac_cv_lib_readline_readline != "yes" ]]; then
AC_MSG_WARN([Please install readline or editline (readline-devel on RHEL6))])
ok=no
fi

if [[ $ac_cv_header_uuid_uuid_h != "yes" -o $ac_cv_lib_uuid_uuid_parse != "yes" ]]; then
AC_MSG_WARN([Please install libuuid (libuuid-devel on RHEL6)])
ok=no
fi

dnl if [[ $ac_cv_header_ext2fs_ext2_io_h != "yes" ]]; then
dnl AC_MSG_WARN([Please install e2fsprogs (e2fsprogs-devel on RHEL6)])
dnl ok=no
dnl fi

if [[ $ac_cv_header_zlib_h != "yes" -o $ac_cv_lib_z_zlibVersion != "yes" ]]; then
AC_MSG_WARN([Please install zlib (zlib-devel on RHEL6)])
ok=no
fi
if [[ $ac_cv_header_bzlib_h != "yes" -o $ac_cv_lib_bz2_BZ2_bzlibVersion != "yes" ]]; then
AC_MSG_WARN([Please install bzip2 (bzip2-devel on RHEL6)])
ok=no
fi

dnl
dnl Well, are we winning?
dnl
if [[ $ok = "yes" ]]; then
AC_MSG_RESULT([You seem to have all prerequisites installed; congratulations.])
exit 0
fi

exit 1
3 changes: 3 additions & 0 deletions distrib.bld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# build script used with new installs
#
simplescons version=$version
47 changes: 47 additions & 0 deletions scripts/FileFilter.SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- python -*-
from lsst.sconsUtils import env
from lsst.sconsUtils.utils import memberOf
from SCons.Script.SConscript import SConsEnvironment
import os, sys, re

flts = { }
vals = { }

def filter_files(target, source, env):
"""Filter script files, substituting in certain option values.
"""
if len(target) > len(source):
source.extend(map(os.path.basename, map(str, target[len(source):])))
for i in xrange(len(target)):
filter_file(target[i], source[i], flts, vals)
if len(source) > len(target):
print >> sys.stderr, "Don't know where to put extra sources:", \
" ".join(source[len(target):])
return 1
return 0

def filter_file(target, source, flts, vals):
try:
sf = tf = None
sf = open(source.abspath, 'r')
tf = open(target.abspath, 'w')

for line in sf:
for key in flts.keys():
line = flts[key].sub(vals[key], line)
tf.write(line)
finally:
if sf: sf.close()
if tf: tf.close()
os.chmod(str(target), os.stat(str(source))[0])

@memberOf(SConsEnvironment)
def FilterFilesInto(env, targetdir, source):
"""filter a bunch of files and put results into the target directory
"""
targets = map(lambda x: os.path.join(targetdir, x), source);
print targets
print source
env.Command(targets, source, action=filter_files)
return targets

7 changes: 7 additions & 0 deletions scripts/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- python -*-
#
import sys
from lsst.sconsUtils import env, targets
SConscript("FileFilter.SConscript")

targets["bin"] = env.FilterFilesInto("#bin", Split("switcheups style.py noI.py ptest.sh newinstall.sh"))