Skip to content
This repository has been archived by the owner on Feb 26, 2025. It is now read-only.

Add recipe for Nix #36

Merged
merged 2 commits into from
Jul 24, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions var/spack/repos/builtin/packages/libseccomp/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
##############################################################################
# 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, [email protected], 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
##############################################################################
from spack import *


class Libseccomp(AutotoolsPackage):
"""Interface to the Linux Kernel's syscall filtering mechanism"""

homepage = "https://github.com/seccomp/libseccomp"
url = "https://github.com/seccomp/libseccomp/releases/download/v2.3.3/libseccomp-2.3.3.tar.gz"

version('2.3.3', 'e6b4e463857fe05c09dc56ec3bcaef84')
31 changes: 31 additions & 0 deletions var/spack/repos/builtin/packages/nix/fix-doc-build.patch
Original file line number Diff line number Diff line change
@@ -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 [email protected]
+ $(trace-gen) $(xmllint) --xinclude $< -o [email protected]
@mv [email protected] $@

$(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
76 changes: 76 additions & 0 deletions var/spack/repos/builtin/packages/nix/package.py
Original file line number Diff line number Diff line change
@@ -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, [email protected], 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")

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this conflict because on bb5 I was using system gcc 4.8.5 and I saw build was failing.

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