Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/nix/
Date: Tue, 04 Sep 2018 08:19:46
Message-Id: 1536049165.0de6367c771d92bcb28febcb8a1b8574ce43e770.slyfox@gentoo
1 commit: 0de6367c771d92bcb28febcb8a1b8574ce43e770
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 4 07:27:33 2018 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 4 08:19:25 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0de6367c
7
8 sys-apps/nix: bump up to 2.1, unkeyworded
9
10 No keywords as >=dev-libs/boost-1.66 is not
11 keyworded in Gentoo. See bug #630754.
12
13 Bug: https://bugs.gentoo.org/630754
14 Package-Manager: Portage-2.3.49, Repoman-2.3.10
15
16 sys-apps/nix/Manifest | 1 +
17 sys-apps/nix/nix-2.1.ebuild | 135 ++++++++++++++++++++++++++++++++++++++++++++
18 2 files changed, 136 insertions(+)
19
20 diff --git a/sys-apps/nix/Manifest b/sys-apps/nix/Manifest
21 index 336623a0ee9..feacc529328 100644
22 --- a/sys-apps/nix/Manifest
23 +++ b/sys-apps/nix/Manifest
24 @@ -1,2 +1,3 @@
25 DIST nix-2.0.2.tar.xz 796404 BLAKE2B 0906488bf2c800544c0747a6860ef51f667467f50039f725cf6ec05b8389462fe073bddceba106922a7611fd784b58ed5ca321efba0065b0f424aa53d7620990 SHA512 605e2c6dbc814470c25aa4f0aca77bfd11fd6d5c263ef38915cb9b852e77bcff08d515e76de8d929c9eacd02ffeaa5dd5f6b337461d54a1b2648b1fc505c98fa
26 DIST nix-2.0.4.tar.xz 798352 BLAKE2B 0eaf7e507c87e5398ab5967e1f2064a5827038bb84208768aa1c1deadc95e44aab922846b728467e3355d1f25e740590c3d1748ec05dfeae6a171952fd941b77 SHA512 bce3b3a14269d42648a4935770260c36dab25fde3ebcfed730063d1d139603468e1c30acf15eb0cffff617fa36a6b39d4ae31ccfd9cba762f631ecac213fd09a
27 +DIST nix-2.1.tar.xz 814936 BLAKE2B 36cb7cecadb353aa920c873b24ea9b7c6c70b0048ddd664e89e2b3c1736b0fe8057dab02cbb9dfe5b500eea27f6da0dd00532e301e8f190dd3f4bd3ef02911be SHA512 1eddf73680ff59277cddc4c891f026295274ea9bd68b795cb5d1cf9ff993638b066417923c4a0ca8248da982498dca05abe811477eac31dee77bd2dad860e43c
28
29 diff --git a/sys-apps/nix/nix-2.1.ebuild b/sys-apps/nix/nix-2.1.ebuild
30 new file mode 100644
31 index 00000000000..66d217abf09
32 --- /dev/null
33 +++ b/sys-apps/nix/nix-2.1.ebuild
34 @@ -0,0 +1,135 @@
35 +# Copyright 1999-2018 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +inherit autotools flag-o-matic readme.gentoo-r1 user
41 +
42 +DESCRIPTION="A purely functional package manager"
43 +HOMEPAGE="https://nixos.org/nix"
44 +
45 +SRC_URI="http://nixos.org/releases/${PN}/${P}/${P}.tar.xz"
46 +LICENSE="LGPL-2.1"
47 +SLOT="0"
48 +#keywords are blocked by boost-1.66
49 +#KEYWORDS="~amd64 ~x86"
50 +IUSE="+etc_profile +gc doc sodium"
51 +
52 +RDEPEND="
53 + app-arch/brotli
54 + app-arch/bzip2
55 + app-arch/xz-utils
56 + dev-db/sqlite
57 + dev-libs/openssl:0=
58 + >=dev-libs/boost-1.66:0=[context]
59 + net-misc/curl
60 + sys-libs/libseccomp
61 + sys-libs/zlib
62 + gc? ( dev-libs/boehm-gc[cxx] )
63 + doc? ( dev-libs/libxml2
64 + dev-libs/libxslt
65 + app-text/docbook-xsl-stylesheets
66 + )
67 + sodium? ( dev-libs/libsodium:0= )
68 +"
69 +DEPEND="${RDEPEND}
70 + >=sys-devel/bison-2.6
71 + >=sys-devel/flex-2.5.35
72 +"
73 +
74 +PATCHES=(
75 + "${FILESDIR}"/${PN}-1.11.6-systemd.patch
76 + "${FILESDIR}"/${PN}-1.11.6-respect-CXXFLAGS.patch
77 + "${FILESDIR}"/${PN}-1.11.6-respect-LDFLAGS.patch
78 + "${FILESDIR}"/${PN}-2.0-user-path.patch
79 +)
80 +
81 +DISABLE_AUTOFORMATTING=yes
82 +DOC_CONTENTS=" Quick start user guide on Gentoo:
83 +
84 +[as root] enable nix-daemon service:
85 + [systemd] # systemctl enable nix-daemon
86 + [openrc] # rc-update add nix-daemon
87 +[as a user] relogin to get environment and profile update
88 +[as a user] fetch nixpkgs update:
89 + \$ nix-channel --update
90 +[as a user] install nix packages:
91 + \$ nix-env -i mc
92 +[as a user] configure environment:
93 + Somewhere in .bash_profile you might want to set
94 + LOCALE_ARCHIVE=\$HOME/.nix-profile/lib/locale/locale-archive
95 + but please read https://github.com/NixOS/nixpkgs/issues/21820
96 +
97 +Next steps:
98 + nix package manager user manual: http://nixos.org/nix/manual/
99 +"
100 +
101 +pkg_setup() {
102 + enewgroup nixbld
103 + for i in {1..10}; do
104 + # we list 'nixbld' twice to
105 + # both assign a primary group for user
106 + # and add a user to /etc/group
107 + enewuser nixbld${i} -1 -1 /var/empty nixbld,nixbld
108 + done
109 +}
110 +
111 +src_prepare() {
112 + default
113 +
114 + eautoreconf
115 +}
116 +
117 +src_configure() {
118 + econf \
119 + --localstatedir="${EPREFIX}"/nix/var \
120 + $(use_enable gc)
121 +}
122 +
123 +src_compile() {
124 + local make_vars=(
125 + OPTIMIZE=0 # disable hardcoded -O3
126 + V=1 # verbose build
127 + )
128 + emake "${make_vars[@]}"
129 +}
130 +
131 +src_install() {
132 + # TODO: emacs highlighter
133 + default
134 +
135 + readme.gentoo_create_doc
136 +
137 + # here we use an eager variant of something that
138 + # is lazily done by nix-daemon and root nix-env
139 +
140 + # TODO: will need a tweak for prefix
141 + keepdir /nix/store
142 + fowners root:nixbld /nix/store
143 + fperms 1775 /nix/store
144 +
145 + keepdir /nix/var/nix/channel-cache
146 + fperms 0777 /nix/var/nix/channel-cache
147 +
148 + keepdir /nix/var/nix/profiles/per-user
149 + fperms 1777 /nix/var/nix/profiles/per-user
150 +
151 + # setup directories nix-daemon: /etc/profile.d/nix-daemon.sh
152 + keepdir /nix/var/nix/gcroots/per-user
153 + fperms 1777 /nix/var/nix/gcroots/per-user
154 +
155 + newinitd "${FILESDIR}"/nix-daemon.initd nix-daemon
156 +
157 + if ! use etc_profile; then
158 + rm "${ED}"/etc/profile.d/nix.sh || die
159 + rm "${ED}"/etc/profile.d/nix-daemon.sh || die
160 + fi
161 +}
162 +
163 +pkg_postinst() {
164 + if ! use etc_profile; then
165 + ewarn "${EROOT}etc/profile.d/nix.sh was removed (due to USE=-etc_profile)."
166 + fi
167 +
168 + readme.gentoo_print_elog
169 +}