public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyfox@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Sergei Trofimovich <slyfox@gentoo.org>
Subject: [gentoo-dev] [PATCH 6/6] sys-apps/guix: switch from user.eclass to acct-*/ depends
Date: Sun, 24 Nov 2019 12:46:16 +0000	[thread overview]
Message-ID: <20191124124616.691759-7-slyfox@gentoo.org> (raw)
In-Reply-To: <20191124124616.691759-1-slyfox@gentoo.org>

---
 sys-apps/guix/guix-1.0.1-r2.ebuild | 165 +++++++++++++++++++++++++++++
 1 file changed, 165 insertions(+)
 create mode 100644 sys-apps/guix/guix-1.0.1-r2.ebuild

diff --git a/sys-apps/guix/guix-1.0.1-r2.ebuild b/sys-apps/guix/guix-1.0.1-r2.ebuild
new file mode 100644
index 00000000000..1e8ec136e73
--- /dev/null
+++ b/sys-apps/guix/guix-1.0.1-r2.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools linux-info readme.gentoo-r1 systemd
+
+DESCRIPTION="GNU package manager (nix sibling)"
+HOMEPAGE="https://www.gnu.org/software/guix/"
+
+# taken from gnu/local.mk and gnu/packages/bootstrap.scm
+BOOT_GUILE=(
+	"aarch64-linux  20170217 guile-2.0.14.tar.xz"
+	"armhf-linux    20150101 guile-2.0.11.tar.xz"
+	"i686-linux     20131110 guile-2.0.9.tar.xz"
+	"mips64el-linux 20131110 guile-2.0.9.tar.xz"
+	"x86_64-linux   20131110 guile-2.0.9.tar.xz"
+)
+
+binary_src_uris() {
+	local system_date_guilep uri
+	for system_date_guilep in "${BOOT_GUILE[@]}"; do
+		# $1              $2       $3
+		# "armhf-linux    20150101 guile-2.0.11.tar.xz"
+		set -- ${system_date_guilep}
+		uri="mirror://gnu-alpha/${PN}/bootstrap/$1/$2/$3"
+		# ${uri} -> guix-bootstrap-armhf-linux-20150101-guile-2.0.11.tar.xz.bootstrap
+		echo "${uri} -> guix-bootstrap-$1-$2-$3.bootstrap"
+	done
+}
+
+# copy bootstrap binaries from DISTDIR to ${S}
+copy_boot_guile_binaries() {
+	local system_date_guilep
+	for system_date_guilep in "${BOOT_GUILE[@]}"; do
+		# $1              $2       $3
+		# "armhf-linux    20150101 guile-2.0.11.tar.xz"
+		set -- ${system_date_guilep}
+		cp "${DISTDIR}"/guix-bootstrap-$1-$2-$3.bootstrap gnu/packages/bootstrap/$1/$3 || die
+	done
+}
+
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz
+	$(binary_src_uris)"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RESTRICT=test # complains about size of config.log and refuses to start tests
+
+RDEPEND="
+	dev-libs/libgcrypt:0=
+	>=dev-scheme/guile-2.2:=[regex,networking,threads]
+	dev-scheme/bytestructures
+	dev-scheme/guile-gcrypt
+	>=dev-scheme/guile-git-0.2.0
+	dev-scheme/guile-json
+	dev-scheme/guile-sqlite3
+	net-libs/gnutls[guile]
+	sys-libs/zlib
+	app-arch/bzip2
+	dev-db/sqlite
+	acct-group/guixbuild
+	acct-user/guixbuilder1
+	acct-user/guixbuilder2
+	acct-user/guixbuilder3
+	acct-user/guixbuilder4
+	acct-user/guixbuilder5
+	acct-user/guixbuilder6
+	acct-user/guixbuilder7
+	acct-user/guixbuilder8
+	acct-user/guixbuilder9
+	acct-user/guixbuilder10
+"
+
+DEPEND="${RDEPEND}
+"
+
+PATCHES=("${FILESDIR}"/${PN}-0.16.0-default-daemon.patch)
+
+QA_PREBUILT="usr/share/guile/site/*/gnu/packages/bootstrap/*"
+
+DISABLE_AUTOFORMATTING=yes
+DOC_CONTENTS="Quick start user guide on Gentoo:
+
+[as root] allow binary substitution to be downloaded (optional)
+	# guix archive --authorize < /usr/share/guix/ci.guix.info.pub
+[as root] enable guix-daemon service:
+	[systemd] # systemctl enable guix-daemon
+	[openrc]  # rc-update add guix-daemon
+[as a user] ln -sf /var/guix/profiles/per-user/\$USER/guix-profile \$HOME/.guix-profile
+[as a user] install guix packages:
+	\$ guix package -i hello
+[as a user] configure environment:
+	Somewhere in .bash_profile you might want to set
+	export GUIX_LOCPATH=\$HOME/.guix-profile/lib/locale
+
+Next steps:
+	guix package manager user manual: https://www.gnu.org/software/guix/manual/guix.html
+"
+
+pkg_pretend() {
+	# USER_NS is used to run builders in a default setting in linux
+	# and for 'guix environment --container'.
+	local CONFIG_CHECK="~USER_NS"
+	check_extra_config
+}
+
+src_prepare() {
+	copy_boot_guile_binaries
+
+	default
+	# build system is very eager to run automake itself: bug #625166
+	eautoreconf
+
+	# guile is trying to avoid recompilation by checking if file
+	#     /usr/lib64/guile/2.2/site-ccache/guix/modules.go
+	# is newer than
+	#     guix/modules.scm
+	# In case it is instead of using 'guix/modules.scm' guile
+	# loads system one (from potentially older version of guix).
+	# To work it around we bump last modification timestamp of
+	# '*.scm' files.
+	# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38112
+	find "${S}" -name "*.scm" -exec touch {} + || die
+
+	# Gentoo stores systemd unit files in lib, never in lib64: bug #689772
+	sed -i nix/local.mk \
+		-e 's|systemdservicedir = $(libdir)/systemd/system|systemdservicedir = '"$(systemd_get_systemunitdir)"'|' || die
+}
+
+src_configure() {
+	# to be compatible with guix from /gnu/store
+	econf \
+		--localstatedir="${EPREFIX}"/var
+}
+
+src_compile() {
+	# guile occasionally fails with 'bad address'
+	emake -j1
+}
+
+src_install() {
+	# TODO: emacs highlighter
+	default
+
+	readme.gentoo_create_doc
+
+	keepdir                /etc/guix
+	# TODO: will need a tweak for prefix
+	keepdir                /gnu/store
+	fowners root:guixbuild /gnu/store
+	fperms 1775            /gnu/store
+
+	keepdir                /var/guix/profiles/per-user
+	fperms 1777            /var/guix/profiles/per-user
+
+	newinitd "${FILESDIR}"/guix-daemon.initd guix-daemon
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+}
-- 
2.24.0



  parent reply	other threads:[~2019-11-24 12:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-24 12:46 [gentoo-dev] [PATCH 0/6] nix and guix GID/UID assignments Sergei Trofimovich
2019-11-24 12:46 ` [gentoo-dev] [PATCH 1/6] acct-group/nixbld: new group (GID 30000) Sergei Trofimovich
2019-11-24 12:46 ` [gentoo-dev] [PATCH 2/6] acct-group/guixbuild: new group (GID 31000) Sergei Trofimovich
2019-11-24 12:46 ` [gentoo-dev] [PATCH 3/6] acct-user/nixbld{1..10}: new user (UID {30001..30010) Sergei Trofimovich
2019-11-24 12:46 ` [gentoo-dev] [PATCH 4/6] acct-user/guixbuilder{1..10}: new user (UID {31001..31010) Sergei Trofimovich
2019-11-24 12:46 ` [gentoo-dev] [PATCH 5/6] sys-apps/nix: switch from user.eclass to acct-*/ depends Sergei Trofimovich
2019-11-24 12:46 ` Sergei Trofimovich [this message]
2019-11-24 12:57 ` [gentoo-dev] [PATCH 0/6] nix and guix GID/UID assignments Ulrich Mueller
2019-11-24 13:23   ` Sergei Trofimovich
2019-11-24 16:19     ` Ulrich Mueller
2019-11-24 20:35       ` Sergei Trofimovich
2019-11-25 16:24         ` David Seifert
2019-11-25 20:28           ` Sergei Trofimovich
2019-11-25 20:32             ` Michał Górny
2019-11-25 20:38               ` Sergei Trofimovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191124124616.691759-7-slyfox@gentoo.org \
    --to=slyfox@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox