void-packages/srcpkgs/nix/template
Leah Neukirchen 85fc0a2c24 nix: make /etc/profile.d/nix.sh not use word splitting
This will not work e.g. if the script is sourced by zsh.
Instead, just adjust $PATH twice.

Fixes #10336.
2018-01-01 23:25:01 +01:00

60 lines
2.1 KiB
Bash

# Template file for 'nix'
pkgname=nix
version=1.11.16
revision=2
build_style=gnu-configure
# Use /nix/var as suggested by the official Manual.
configure_args="--localstatedir=/nix/var"
depends="curl perl-WWW-Curl perl-DBD-SQLite"
hostmakedepends="automake libtool pkg-config flex ${depends}"
# Extra run-time dependencies.
makedepends="bzip2-devel gc-devel libcurl-devel liblzma-devel libressl-devel
libsodium-devel pkg-config sqlite-devel libseccomp-devel"
shlib_requires="libperl.so.5.26"
# Default configuration file.
conf_files="/etc/nix/nix.conf"
# Create required build users/groups.
system_groups="nixbld"
for f in {1..9}; do
system_accounts+=" nixbld${f}"
eval export nixbld\${f}_pgroup="nixbld"
eval export nixbld\${f}_groups="nixbld"
done
# Create required run-time directories.
make_dirs="
/nix/var/log/nix/drvs 0755 root root
/nix/var/nix/profiles 0755 root root
/nix/var/nix/profiles/per-user 1777 root root
/nix/var/nix/gcroots/per-user 1777 root root
/nix/var/nix/temproots 0755 root root
/nix/var/nix/gcroots 0755 root root
/nix/var/nix/manifests 0755 root root
/nix/var/nix/userpool 0755 root root
/nix/var/nix/db 0755 root root
/nix/store 1775 root nixbld"
short_desc="A purely functional package manager"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="LGPL-2.1"
homepage="http://nixos.org/nix/"
distfiles="http://nixos.org/releases/nix/nix-${version}/nix-${version}.tar.xz"
checksum=0ca5782fc37d62238d13a620a7b4bff6a200bab1bd63003709249a776162357c
pre_configure() {
sed -i '/^CFLAGS=/d;/^CXXFLAGS=/d' configure
sed -i 's/site_perl.*/vendor_perl/g' configure
echo "GLOBAL_LDFLAGS += $LDFLAGS" >>mk/lib.mk
}
post_install() {
vmkdir etc/nix
# Remove unused stuff.
rm -rf ${DESTDIR}/usr/include ${DESTDIR}/nix ${DESTDIR}/etc/init
# Let users interact with the nix-daemon by default.
vmkdir etc/profile.d
echo 'export NIX_REMOTE=daemon' > ${DESTDIR}/etc/profile.d/nix-daemon.sh
# Setup build users.
echo 'build-users-group = nixbld' > ${DESTDIR}/etc/nix/nix.conf
# Install our profile.d/nix for multi-user by default.
vinstall ${FILESDIR}/nix.sh 644 etc/profile.d
# runit service
vsv nix-daemon
}