diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/sqlite/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/sqlite/package.py | 68 |
1 files changed, 44 insertions, 24 deletions
diff --git a/var/spack/repos/builtin/packages/sqlite/package.py b/var/spack/repos/builtin/packages/sqlite/package.py index de949df998..dc14a7b088 100644 --- a/var/spack/repos/builtin/packages/sqlite/package.py +++ b/var/spack/repos/builtin/packages/sqlite/package.py @@ -1,27 +1,8 @@ -############################################################################## -# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. +# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. # -# This file is part of Spack. -# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://github.com/spack/spack -# Please also see the NOTICE and LICENSE files for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License (as -# published by the Free Software Foundation) version 2.1, February 1999. -# -# 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 -# conditions of the GNU Lesser General Public License for more details. -# -# 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 -############################################################################## +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + from spack import * from spack import architecture @@ -33,6 +14,12 @@ class Sqlite(AutotoolsPackage): """ homepage = "www.sqlite.org" + version('3.23.1', '0edbfd75ececb95e8e6448d6ff33df82774c9646', + url='https://www.sqlite.org/2018/sqlite-autoconf-3230100.tar.gz') + version('3.22.0', '2fb24ec12001926d5209d2da90d252b9825366ac', + url='https://www.sqlite.org/2018/sqlite-autoconf-3220000.tar.gz') + version('3.21.0', '7913de4c3126ba3c24689cb7a199ea31', + url='https://www.sqlite.org/2017/sqlite-autoconf-3210000.tar.gz') version('3.20.0', 'e262a28b73cc330e7e83520c8ce14e4d', url='https://www.sqlite.org/2017/sqlite-autoconf-3200000.tar.gz') version('3.18.0', 'a6687a8ae1f66abc8df739aeadecfd0c', @@ -48,7 +35,31 @@ class Sqlite(AutotoolsPackage): # 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 - patch('sqlite_b0.patch', when='@3.18.0') + patch('sqlite_b0.patch', when='@3.18.0:3.21.0') + + # 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') + + 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') + + @property + def libs(self): + return find_libraries('libsqlite3', root=self.prefix.lib) def get_arch(self): arch = architecture.Arch() @@ -62,3 +73,12 @@ class Sqlite(AutotoolsPackage): args.append('--build=powerpc64le-redhat-linux-gnu') return args + + @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) |