2014-08-02 06:50:43 +08:00
|
|
|
##############################################################################
|
2018-03-25 03:13:52 +08:00
|
|
|
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
|
2014-08-02 06:50:43 +08:00
|
|
|
# Produced at the Lawrence Livermore National Laboratory.
|
|
|
|
#
|
|
|
|
# This file is part of Spack.
|
2016-05-12 12:22:25 +08:00
|
|
|
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
|
2014-08-02 06:50:43 +08:00
|
|
|
# LLNL-CODE-647188
|
|
|
|
#
|
2017-11-05 08:08:04 +08:00
|
|
|
# For details, see https://github.com/spack/spack
|
2017-06-25 13:22:55 +08:00
|
|
|
# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
|
2014-08-02 06:50:43 +08:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
2016-05-12 12:22:25 +08:00
|
|
|
# it under the terms of the GNU Lesser General Public License (as
|
|
|
|
# published by the Free Software Foundation) version 2.1, February 1999.
|
2014-08-02 06:50:43 +08:00
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful, but
|
|
|
|
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
|
2016-05-12 12:22:25 +08:00
|
|
|
# conditions of the GNU Lesser General Public License for more details.
|
2014-08-02 06:50:43 +08:00
|
|
|
#
|
2016-05-12 12:22:25 +08:00
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2014-08-02 06:50:43 +08:00
|
|
|
##############################################################################
|
|
|
|
from spack import *
|
2016-10-06 17:48:05 +08:00
|
|
|
from spack import architecture
|
2014-08-02 06:50:43 +08:00
|
|
|
|
2016-08-10 16:50:00 +08:00
|
|
|
|
2017-04-27 03:59:03 +08:00
|
|
|
class Sqlite(AutotoolsPackage):
|
2014-08-04 03:57:09 +08:00
|
|
|
"""SQLite3 is an SQL database engine in a C library. Programs that
|
|
|
|
link the SQLite3 library can have SQL database access without
|
|
|
|
running a separate RDBMS process.
|
|
|
|
"""
|
2014-08-02 06:50:43 +08:00
|
|
|
homepage = "www.sqlite.org"
|
|
|
|
|
2018-05-21 04:05:11 +08:00
|
|
|
version('3.23.1', '0edbfd75ececb95e8e6448d6ff33df82774c9646',
|
|
|
|
url='https://www.sqlite.org/2018/sqlite-autoconf-3230100.tar.gz')
|
2018-03-07 01:09:09 +08:00
|
|
|
version('3.22.0', '2fb24ec12001926d5209d2da90d252b9825366ac',
|
|
|
|
url='https://www.sqlite.org/2018/sqlite-autoconf-3220000.tar.gz')
|
2017-11-23 23:04:41 +08:00
|
|
|
version('3.21.0', '7913de4c3126ba3c24689cb7a199ea31',
|
|
|
|
url='https://www.sqlite.org/2017/sqlite-autoconf-3210000.tar.gz')
|
2017-08-04 23:46:07 +08:00
|
|
|
version('3.20.0', 'e262a28b73cc330e7e83520c8ce14e4d',
|
|
|
|
url='https://www.sqlite.org/2017/sqlite-autoconf-3200000.tar.gz')
|
2017-04-20 05:15:21 +08:00
|
|
|
version('3.18.0', 'a6687a8ae1f66abc8df739aeadecfd0c',
|
|
|
|
url='https://www.sqlite.org/2017/sqlite-autoconf-3180000.tar.gz')
|
2017-08-04 23:46:07 +08:00
|
|
|
version('3.8.10.2', 'a18bfc015cd49a1e7a961b7b77bc3b37',
|
|
|
|
url='https://www.sqlite.org/2015/sqlite-autoconf-3081002.tar.gz')
|
2014-08-04 03:57:09 +08:00
|
|
|
version('3.8.5', '0544ef6d7afd8ca797935ccc2685a9ed',
|
2016-10-16 07:31:23 +08:00
|
|
|
url='https://www.sqlite.org/2014/sqlite-autoconf-3080500.tar.gz')
|
2014-08-02 06:50:43 +08:00
|
|
|
|
2017-04-27 03:59:03 +08:00
|
|
|
depends_on('readline')
|
|
|
|
|
2017-05-04 19:43:28 +08:00
|
|
|
# On some platforms (e.g., PPC) the include chain includes termios.h which
|
|
|
|
# defines a macro B0. Sqlite has a shell.c source file that declares a
|
|
|
|
# variable named B0 and will fail to compile when the macro is found. The
|
|
|
|
# following patch undefines the macro in shell.c
|
2017-12-20 03:06:39 +08:00
|
|
|
patch('sqlite_b0.patch', when='@3.18.0:3.21.0')
|
2017-05-04 19:43:28 +08:00
|
|
|
|
2017-11-23 23:04:41 +08:00
|
|
|
# Starting version 3.17.0, SQLite uses compiler built-ins
|
|
|
|
# __builtin_sub_overflow(), __builtin_add_overflow(), and
|
|
|
|
# __builtin_mul_overflow(), which are not supported by Intel compiler.
|
|
|
|
# Starting version 3.21.0 SQLite doesn't use the built-ins if Intel
|
|
|
|
# compiler is used.
|
|
|
|
patch('remove_overflow_builtins.patch', when='@3.17.0:3.20%intel')
|
|
|
|
|
2018-06-08 00:34:29 +08:00
|
|
|
variant('functions', default=False,
|
|
|
|
description='Provide mathematical and string extension functions '
|
|
|
|
'for SQL queries using the loadable extensions '
|
|
|
|
'mechanism.')
|
|
|
|
|
|
|
|
resource(name='extension-functions',
|
|
|
|
url='https://sqlite.org/contrib/download/extension-functions.c/download/extension-functions.c?get=25',
|
|
|
|
md5='3a32bfeace0d718505af571861724a43',
|
|
|
|
expand=False,
|
|
|
|
placement={'extension-functions.c?get=25':
|
|
|
|
'extension-functions.c'},
|
|
|
|
when='+functions')
|
|
|
|
|
2016-10-06 17:48:05 +08:00
|
|
|
def get_arch(self):
|
|
|
|
arch = architecture.Arch()
|
|
|
|
arch.platform = architecture.platform()
|
|
|
|
return str(arch.platform.target('default_target'))
|
|
|
|
|
2017-04-27 03:59:03 +08:00
|
|
|
def configure_args(self):
|
|
|
|
args = []
|
|
|
|
|
2016-10-06 17:48:05 +08:00
|
|
|
if self.get_arch() == 'ppc64le':
|
2017-04-27 03:59:03 +08:00
|
|
|
args.append('--build=powerpc64le-redhat-linux-gnu')
|
|
|
|
|
|
|
|
return args
|
2018-06-08 00:34:29 +08:00
|
|
|
|
|
|
|
@run_after('install')
|
|
|
|
def build_libsqlitefunctions(self):
|
|
|
|
if '+functions' in self.spec:
|
|
|
|
libraryname = 'libsqlitefunctions.' + dso_suffix
|
|
|
|
cc = Executable(spack_cc)
|
|
|
|
cc(self.compiler.pic_flag, '-lm', '-shared',
|
|
|
|
'extension-functions.c', '-o', libraryname)
|
|
|
|
install(libraryname, self.prefix.lib)
|