From 6ccf1439c9002c3a9429dfee23ede7027e0cca14 Mon Sep 17 00:00:00 2001 From: travankor Date: Sun, 19 Aug 2018 15:50:28 -0700 Subject: [PATCH] nix: update to 2.0.4. --- srcpkgs/nix/files/nix.sh | 65 ++++++++++++++++++---------------- srcpkgs/nix/patches/musl.patch | 10 ------ srcpkgs/nix/template | 36 +++++++++++-------- 3 files changed, 56 insertions(+), 55 deletions(-) delete mode 100644 srcpkgs/nix/patches/musl.patch diff --git a/srcpkgs/nix/files/nix.sh b/srcpkgs/nix/files/nix.sh index b66da0bdd2e..e2f0b270ebe 100644 --- a/srcpkgs/nix/files/nix.sh +++ b/srcpkgs/nix/files/nix.sh @@ -1,40 +1,45 @@ -export NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/$USER +#sync with https://github.com/NixOS/nix/blob/3be58fe1bc781fd39649f616c8ba4e5be672d505/scripts/nix-profile-daemon.sh.in +export NIX_USER_PROFILE_DIR="/nix/var/nix/profiles/per-user/$USER" +export NIX_PROFILES="/nix/var/nix/profiles/default $HOME/.nix-profile" + +# Set up the per-user profile. mkdir -m 0755 -p $NIX_USER_PROFILE_DIR -if test "$(stat --printf '%u' $NIX_USER_PROFILE_DIR)" != "$(id -u)"; then +if ! test -O "$NIX_USER_PROFILE_DIR"; then echo "WARNING: bad ownership on $NIX_USER_PROFILE_DIR" >&2 fi -if ! test -L $HOME/.nix-profile; then - echo "creating $HOME/.nix-profile" >&2 - if test "$USER" != root; then - ln -s $NIX_USER_PROFILE_DIR/profile $HOME/.nix-profile - else - # Root installs in the system-wide profile by default. - ln -s /nix/var/nix/profiles/default $HOME/.nix-profile +if test -w $HOME; then + if ! test -L $HOME/.nix-profile; then + if test "$USER" != root; then + ln -s $NIX_USER_PROFILE_DIR/profile $HOME/.nix-profile + else + # Root installs in the system-wide profile by default. + ln -s /nix/var/nix/profiles/default $HOME/.nix-profile + fi + fi + + # Subscribe the root user to the NixOS channel by default. + if [ "$USER" = root -a ! -e $HOME/.nix-channels ]; then + echo "https://nixos.org/channels/nixpkgs-unstable nixpkgs" > $HOME/.nix-channels + fi + + # Create the per-user garbage collector roots directory. + NIX_USER_GCROOTS_DIR=/nix/var/nix/gcroots/per-user/$USER + mkdir -m 0755 -p $NIX_USER_GCROOTS_DIR + if ! test -O "$NIX_USER_GCROOTS_DIR"; then + echo "WARNING: bad ownership on $NIX_USER_GCROOTS_DIR" >&2 + fi + + # Set up a default Nix expression from which to install stuff. + if [ ! -e $HOME/.nix-defexpr -o -L $HOME/.nix-defexpr ]; then + rm -f $HOME/.nix-defexpr + mkdir -p $HOME/.nix-defexpr + if [ "$USER" != root ]; then + ln -s /nix/var/nix/profiles/per-user/root/channels $HOME/.nix-defexpr/channels_root + fi fi fi export PATH=/nix/var/nix/profiles/default/bin:$PATH export PATH=$HOME/.nix-profile/bin:$PATH - -if [ "$USER" = root -a ! -e $HOME/.nix-channels ]; then - echo "http://nixos.org/channels/nixpkgs-unstable nixpkgs" \ - > $HOME/.nix-channels -fi - -NIX_USER_GCROOTS_DIR=/nix/var/nix/gcroots/per-user/$USER -mkdir -m 0755 -p $NIX_USER_GCROOTS_DIR -if test "$(stat --printf '%u' $NIX_USER_GCROOTS_DIR)" != "$(id -u)"; then - echo "WARNING: bad ownership on $NIX_USER_GCROOTS_DIR" >&2 -fi - -if [ ! -e $HOME/.nix-defexpr -o -L $HOME/.nix-defexpr ]; then - echo "creating $HOME/.nix-defexpr" >&2 - rm -f $HOME/.nix-defexpr - mkdir $HOME/.nix-defexpr - if [ "$USER" != root ]; then - ln -s /nix/var/nix/profiles/per-user/root/channels \ - $HOME/.nix-defexpr/channels_root - fi -fi diff --git a/srcpkgs/nix/patches/musl.patch b/srcpkgs/nix/patches/musl.patch deleted file mode 100644 index 20f8f90c6ea..00000000000 --- a/srcpkgs/nix/patches/musl.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/libutil/affinity.cc.orig 2015-12-19 21:10:00.175521237 +0100 -+++ src/libutil/affinity.cc 2015-12-19 21:10:19.551719833 +0100 -@@ -3,6 +3,7 @@ - #include "affinity.hh" - - #if __linux__ -+#include - #include - #endif - diff --git a/srcpkgs/nix/template b/srcpkgs/nix/template index 7cc6fdcfcf9..8528d4f8b80 100644 --- a/srcpkgs/nix/template +++ b/srcpkgs/nix/template @@ -1,16 +1,14 @@ # Template file for 'nix' pkgname=nix -version=1.11.16 -revision=6 +version=2.0.4 +revision=1 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. +hostmakedepends="autoconf automake curl libtool pkg-config flex" makedepends="bzip2-devel gc-devel libcurl-devel liblzma-devel libressl-devel libsodium-devel pkg-config sqlite-devel libseccomp-devel" -shlib_requires=libperl.so.5.28 +depends="curl" # Default configuration file. conf_files="/etc/nix/nix.conf" # Create required build users/groups. @@ -34,27 +32,35 @@ make_dirs=" /nix/store 1775 root nixbld" short_desc="A purely functional package manager" maintainer="Juan RP " -license="LGPL-2.1" -homepage="http://nixos.org/nix/" -distfiles="http://nixos.org/releases/nix/nix-${version}/nix-${version}.tar.xz" -checksum=0ca5782fc37d62238d13a620a7b4bff6a200bab1bd63003709249a776162357c +license="LGPL-2.1-or-later" +homepage="https://nixos.org/nix/" +changelog="https://nixos.org/releases/${pkgname}/${pkgname}-${version}/manual/#sec-relnotes" +distfiles="https://nixos.org/releases/${pkgname}/${pkgname}-${version}/${pkgname}-${version}.tar.xz" +checksum=166540ff7b8bb41449586b67e5fc6ab9e25525f6724b6c6bcbfb0648fbd6496b + +case "${XBPS_TARGET_MACHINE}" in + armv[56]*) + broken="Not supported upstream (for now at least)"; + ;; +esac 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 + autoreconf -fi } + post_install() { vmkdir etc/nix # Remove unused stuff. - rm -rf ${DESTDIR}/usr/include ${DESTDIR}/nix ${DESTDIR}/etc/init + 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 + 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 + 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 + vinstall "${FILESDIR}"/nix.sh 644 etc/profile.d # runit service vsv nix-daemon }