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/guix/, sys-apps/guix/files/
Date: Wed, 01 Feb 2017 22:18:33
Message-Id: 1485987496.f7663b92c6722a14a928fde1809e52748cb2e97a.slyfox@gentoo
1 commit: f7663b92c6722a14a928fde1809e52748cb2e97a
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 1 22:18:04 2017 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 1 22:18:16 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7663b92
7
8 sys-apps/guix: new package, the GNU Purely Functional Package Manager
9
10 Internal data model and command UI is a lot like
11 one of sys-apps/nix.
12
13 Package description mechanism is a bit different
14 in both surface syntax (guile vs nix expression language)
15 and evaluation method (compiled versus lazy loaded configs)
16
17 guix (as well as nix) is a source-based package manager with
18 strong support for binary packages. It uses multiple tricks
19 to make package source dependencies robust:
20
21 - guix installs every package into it's own --prefix=.
22 Example: /gnu/store/6np03bm99hg7gprcwmzpbpaj00cka8p8-icecat-45.5.1-gnu1
23 - guix builds packages with PATH (and similar) only including explicitly
24 listed depends. This eliminates automagic dependency.
25 - guix tracks full environment where package was built.
26 Once environment changes new package needs to be built.
27
28 That's how you install firef^Wicecat just for your current user:
29
30 $ guix package --install icecat
31
32 Package-Manager: Portage-2.3.3, Repoman-2.3.1
33
34 sys-apps/guix/Manifest | 1 +
35 sys-apps/guix/files/guix-0.12.0-AR.patch | 8 ++
36 .../guix/files/guix-0.12.0-no-json-crate.patch | 38 +++++++++
37 sys-apps/guix/files/guix-daemon.initd | 16 ++++
38 sys-apps/guix/guix-0.12.0-r1.ebuild | 92 ++++++++++++++++++++++
39 sys-apps/guix/metadata.xml | 8 ++
40 6 files changed, 163 insertions(+)
41
42 diff --git a/sys-apps/guix/Manifest b/sys-apps/guix/Manifest
43 new file mode 100644
44 index 00000000..1cef361
45 --- /dev/null
46 +++ b/sys-apps/guix/Manifest
47 @@ -0,0 +1 @@
48 +DIST guix-0.12.0.tar.gz 15823786 SHA256 6201e21186a7098af256d97562662d95353b1047799b9b216e1dd6e7692dfec9 SHA512 d61cb289d3773977400fa3c49869f30a3feb5e0364368017b9b8eaadee814c5c31897be398d6ff142349337334eb51cb6d0354bee27c0365de69ce1a09e858d3 WHIRLPOOL 9515967a05a449f24da49e95340a60fb91cc471fcc532ce6cfaaea82c9161e3a65a1adc4d95e9997f019565243ca385845edc484981adfc5956112092687a0ec
49
50 diff --git a/sys-apps/guix/files/guix-0.12.0-AR.patch b/sys-apps/guix/files/guix-0.12.0-AR.patch
51 new file mode 100644
52 index 00000000..c9c91c2
53 --- /dev/null
54 +++ b/sys-apps/guix/files/guix-0.12.0-AR.patch
55 @@ -0,0 +1,8 @@
56 +diff --git a/config-daemon.ac b/config-daemon.ac
57 +index 056c939..b04deed 100644
58 +--- a/config-daemon.ac
59 ++++ b/config-daemon.ac
60 +@@ -7,2 +7,3 @@ dnl C++ environment. This macro must be used unconditionnaly.
61 + AC_PROG_CXX
62 ++AM_PROG_AR
63 + AC_LANG([C++])
64
65 diff --git a/sys-apps/guix/files/guix-0.12.0-no-json-crate.patch b/sys-apps/guix/files/guix-0.12.0-no-json-crate.patch
66 new file mode 100644
67 index 00000000..57b4308
68 --- /dev/null
69 +++ b/sys-apps/guix/files/guix-0.12.0-no-json-crate.patch
70 @@ -0,0 +1,38 @@
71 +commit 6023041346c79f7ac4105bba2552a82019fae840
72 +Author: David Thompson <davet@×××.org>
73 +Date: Fri Dec 30 14:15:35 2016 -0500
74 +
75 + import: crate: Do not build when guile-json is not available.
76 +
77 + * Makefile.am (MODULES): Add 'guix/import/crate.scm' and
78 + 'guix/scripts/import/crate.scm' only when HAVE_GUILE_JSON.
79 +
80 +diff --git a/Makefile.am b/Makefile.am
81 +index 15939af12..97629f26e 100644
82 +--- a/Makefile.am
83 ++++ b/Makefile.am
84 +@@ -122,7 +122,6 @@ MODULES = \
85 + guix/import/snix.scm \
86 + guix/import/cabal.scm \
87 + guix/import/cran.scm \
88 +- guix/import/crate.scm \
89 + guix/import/hackage.scm \
90 + guix/import/elpa.scm \
91 + guix/scripts.scm \
92 +@@ -142,7 +141,6 @@ MODULES = \
93 + guix/scripts/lint.scm \
94 + guix/scripts/challenge.scm \
95 + guix/scripts/import/cran.scm \
96 +- guix/scripts/import/crate.scm \
97 + guix/scripts/import/gnu.scm \
98 + guix/scripts/import/nix.scm \
99 + guix/scripts/import/hackage.scm \
100 +@@ -162,6 +160,8 @@ if HAVE_GUILE_JSON
101 + MODULES += \
102 + guix/import/github.scm \
103 + guix/import/json.scm \
104 ++ guix/import/crate.scm \
105 ++ guix/scripts/import/crate.scm \
106 + guix/import/pypi.scm \
107 + guix/scripts/import/pypi.scm \
108 + guix/import/cpan.scm \
109
110 diff --git a/sys-apps/guix/files/guix-daemon.initd b/sys-apps/guix/files/guix-daemon.initd
111 new file mode 100644
112 index 00000000..c4f2579
113 --- /dev/null
114 +++ b/sys-apps/guix/files/guix-daemon.initd
115 @@ -0,0 +1,16 @@
116 +#!/sbin/openrc-run
117 +# Copyright 1999-2017 Gentoo Foundation
118 +# Distributed under the terms of the GNU General Public License v2
119 +# $Id$
120 +
121 +start() {
122 + ebegin "Starting ${SVCNAME}"
123 + start-stop-daemon --start --quiet --background --exec /usr/bin/guix-daemon -- --build-users-group=guixbuild
124 + eend ${?}
125 +}
126 +
127 +stop() {
128 + ebegin "Stopping ${SVCNAME}"
129 + start-stop-daemon --stop --quiet --exec /usr/bin/guix-daemon
130 + eend ${?}
131 +}
132
133 diff --git a/sys-apps/guix/guix-0.12.0-r1.ebuild b/sys-apps/guix/guix-0.12.0-r1.ebuild
134 new file mode 100644
135 index 00000000..104b21d
136 --- /dev/null
137 +++ b/sys-apps/guix/guix-0.12.0-r1.ebuild
138 @@ -0,0 +1,92 @@
139 +# Copyright 1999-2017 Gentoo Foundation
140 +# Distributed under the terms of the GNU General Public License v2
141 +# $Id$
142 +
143 +EAPI=6
144 +
145 +inherit autotools readme.gentoo-r1 user
146 +
147 +DESCRIPTION="GNU package manager (nix sibling)"
148 +HOMEPAGE="https://www.gnu.org/software/guix/"
149 +
150 +SRC_URI="mirror://gnu-alpha/${PN}/${P}.tar.gz"
151 +LICENSE="GPL-3"
152 +SLOT="0"
153 +KEYWORDS="~amd64 ~x86"
154 +IUSE=""
155 +
156 +RESTRICT=test # complains about size of config.log and refuses to start tests
157 +
158 +RDEPEND="
159 + dev-libs/libgcrypt:0=
160 + >=dev-scheme/guile-2
161 + sys-libs/zlib
162 + app-arch/bzip2
163 + dev-db/sqlite
164 +"
165 +
166 +DEPEND="${RDEPEND}
167 +"
168 +
169 +QA_PREBUILT="usr/share/guile/site/2.0/gnu/packages/bootstrap/*"
170 +
171 +PATCHES=(
172 + "${FILESDIR}"/${P}-no-json-crate.patch
173 + "${FILESDIR}"/${P}-AR.patch
174 +)
175 +
176 +DISABLE_AUTOFORMATTING=yes
177 +DOC_CONTENTS="Quick start user guide on Gentoo:
178 +
179 +[as root] allow binary substitution to be downloaded (optional)
180 + # guix archive --authorize < /usr/share/guix/hydra.gnu.org.pub
181 +[as root] enable guix-daemon service:
182 + [systemd] # systemctl enable guix-daemon
183 + [openrc] # rc-update add guix-daemon
184 +[as an user] ln -sf /var/guix/profiles/per-user/\$USER/guix-profile \$HOME/.guix-profile
185 +[as an user] install guix packages:
186 + \$ guix package -i hello
187 +[as an user] configure environment:
188 + Somewhere in .bash_profile you might want to set
189 + export GUIX_LOCPATH=\$HOME/.guix-profile/lib/locale
190 +
191 +Next steps:
192 + guix package manager user manual: https://www.gnu.org/software/guix/manual/guix.html
193 +"
194 +
195 +pkg_setup() {
196 + enewgroup guixbuild
197 + for i in {1..10}; do
198 + # we list 'guixbuild' twice to
199 + # both assign a primary group for user
200 + # and add an user to /etc/group
201 + enewuser guixbuilder${i} -1 -1 /var/empty guixbuild,guixbuild
202 + done
203 +}
204 +
205 +src_prepare() {
206 + default
207 +
208 + eautoreconf
209 +}
210 +
211 +src_install() {
212 + # TODO: emacs highlighter
213 + default
214 +
215 + readme.gentoo_create_doc
216 +
217 + # TODO: will need a tweak for prefix
218 + keepdir /gnu/store
219 + fowners root:guixbuild /gnu/store
220 + fperms 1775 /gnu/store
221 +
222 + keepdir /var/guix/profiles/per-user
223 + fperms 1777 /var/guix/profiles/per-user
224 +
225 + newinitd "${FILESDIR}"/guix-daemon.initd guix-daemon
226 +}
227 +
228 +pkg_postinst() {
229 + readme.gentoo_print_elog
230 +}
231
232 diff --git a/sys-apps/guix/metadata.xml b/sys-apps/guix/metadata.xml
233 new file mode 100644
234 index 00000000..b787881
235 --- /dev/null
236 +++ b/sys-apps/guix/metadata.xml
237 @@ -0,0 +1,8 @@
238 +<?xml version="1.0" encoding="UTF-8"?>
239 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
240 +<pkgmetadata>
241 + <maintainer type="project">
242 + <email>haskell@g.o</email>
243 + <name>Gentoo Haskell</name>
244 + </maintainer>
245 +</pkgmetadata>