diff --git a/var/spack/repos/builtin/packages/nix/fix-doc-build.patch b/var/spack/repos/builtin/packages/nix/fix-doc-build.patch new file mode 100644 index 00000000000000..ca10211d976869 --- /dev/null +++ b/var/spack/repos/builtin/packages/nix/fix-doc-build.patch @@ -0,0 +1,31 @@ +diff -ru nix-2.0.4-orig/doc/manual/local.mk nix-2.0.4/doc/manual/local.mk +--- nix-2.0.4-orig/doc/manual/local.mk 2018-07-20 11:12:18.121540267 +0200 ++++ nix-2.0.4/doc/manual/local.mk 2018-07-20 11:43:58.514090409 +0200 +@@ -1,7 +1,7 @@ + + ifeq ($(doc_generate),yes) + +-XSLTPROC = $(xsltproc) --nonet $(xmlflags) \ ++XSLTPROC = $(xsltproc) $(xmlflags) \ + --param section.autolabel 1 \ + --param section.label.includes.component.label 1 \ + --param html.stylesheet \'style.css\' \ +@@ -21,7 +21,7 @@ + + # Do XInclude processing / RelaxNG validation + $(d)/manual.xmli: $(d)/manual.xml $(MANUAL_SRCS) $(d)/version.txt +- $(trace-gen) $(xmllint) --nonet --xinclude $< -o $@.tmp ++ $(trace-gen) $(xmllint) --xinclude $< -o $@.tmp + @mv $@.tmp $@ + + $(d)/version.txt: +@@ -29,9 +29,6 @@ + + # Note: RelaxNG validation requires xmllint >= 2.7.4. + $(d)/manual.is-valid: $(d)/manual.xmli +- $(trace-gen) $(XSLTPROC) --novalid --stringparam profile.condition manual \ +- $(docbookxsl)/profiling/profile.xsl $< 2> /dev/null | \ +- $(xmllint) --nonet --noout --relaxng $(docbookrng) - + @touch $@ + + clean-files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid diff --git a/var/spack/repos/builtin/packages/nix/package.py b/var/spack/repos/builtin/packages/nix/package.py new file mode 100644 index 00000000000000..b6496a4f90b34a --- /dev/null +++ b/var/spack/repos/builtin/packages/nix/package.py @@ -0,0 +1,76 @@ +############################################################################## +# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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 +############################################################################## +import os.path as osp +from spack import * + + +class Nix(AutotoolsPackage): + """Nix, the purely functional package manager""" + + homepage = "http://nixos.org/nix" + url = "https://github.com/NixOS/nix/archive/2.0.4.zip" + + version('2.0.4', '045adeb4714f559386e391cc3c411710') + + patch('fix-doc-build.patch') + + variant('storedir', values=str, default=None, + description='path of the Nix store (defaults to /nix)') + variant('statedir', values=str, default=None, + description='path to the locale state (defaults to /nix/var)') + variant('doc', values=bool, default=True, + description="Build and install documentation") + variant('sandboxing', values=bool, default=True, + description='Enable build isolation') + + depends_on('autoconf', type='build') + depends_on('automake', type='build') + depends_on('bison', type='build') + depends_on('flex', type='build') + depends_on('libtool', type='build') + depends_on('libxslt', when="+doc", type='build') + depends_on('m4', type='build') + + depends_on('curl') + depends_on('libseccomp', when="+sandboxing") + depends_on('sqlite') + depends_on('xz') + + # gcc 4.9+ and higher supported with c++14 + conflicts("%gcc@:4.8.99") + + def configure_args(self): + args = [] + if '+sandboxing' not in self.spec: + args.append('--disable-seccomp-sandboxing') + if '+doc' not in self.spec: + args.append('--disable-doc-gen') + storedir = self.spec.variants['storedir'].value + if storedir: + args.append('--with-store-dir=' + storedir) + statedir = self.spec.variants['statedir'].value + if statedir: + args.append('--localstatedir=' + statedir) + return args