Skip to content
Snippets Groups Projects
Commit ebe0ec02 authored by Maxim Cournoyer's avatar Maxim Cournoyer Committed by Sébastien Blin
Browse files

build: Use guix shell.

The recently introduced 'guix shell' command automatically manages a
cached profile for us; prefer it to 'guix environment', and do away
with a channels file, given fixes in Guix have now been incorporated
in the main branch.

* Makefile (portable-release-tarball)<guix environment>: Replace by
'guix shell'.
* build.py (run_dependencies)[guix]: Likewise, and do not use a
channels.scm file.
(run_install): Likewise, and provide a hint when TARBALLS is not set.
* guix/channels.scm: Delete file.
* guix/manifest.scm: Adjust comment.

Change-Id: I50ca99e51f0ebca136c9bbc5a0ca3063075432b4
parent 1512fb0b
No related branches found
No related tags found
No related merge requests found
......@@ -96,7 +96,7 @@ has-guix-p:
# /etc/ssl/certs.
guix-share-tarball-arg = $${TARBALLS:+"--share=$$TARBALLS"}
portable-release-tarball: has-guix-p
guix environment --container --network \
guix shell --container --network \
--preserve=TARBALLS $(guix-share-tarball-arg) \
--expose=/usr/bin/env \
--expose=$$SSL_CERT_DIR=/etc/ssl/certs \
......
......@@ -306,11 +306,8 @@ def run_dependencies(args):
print("The win32 version does not install dependencies with this script.\nPlease continue with the --install instruction.")
sys.exit(1)
elif args.distribution == 'guix':
print("Building the environment defined in 'guix/manifest.scm'...")
execute_script(['mkdir -p ~/.config/guix/profiles',
('guix time-machine --channels=guix/channels.scm -- '
'package --manifest=guix/manifest.scm '
'--profile=$HOME/.config/guix/profiles/jami')])
print("Building the profile defined in 'guix/manifest.scm'...")
execute_script(['guix shell --manifest=guix/manifest.scm -- true'])
else:
print("Not yet implemented for current distribution (%s). Please continue with the --install instruction. Note: You may need to install some dependencies manually." %
......@@ -421,11 +418,14 @@ def run_install(args):
share_tarballs_args = []
if 'TARBALLS' in os.environ:
share_tarballs_args = ['--preserve=TARBALLS',
f'--share={os.environ["TARBALLS"]}']
f'--share={os.environ["TARBALLS"]}']
else:
print('info: consider setting the TARBALLS environment variable '
'to a stable writable location to avoid loosing '
'cached tarballs')
# Note: we must expose /gnu/store because /etc/ssl/certs
# contains certs that are symlinks to store items.
command = ['guix', 'time-machine', '-C', 'guix/channels.scm', '--',
'environment', '--manifest=guix/manifest.scm',
command = ['guix', 'shell', '--manifest=guix/manifest.scm',
'--expose=/gnu/store', '--expose=/etc/ssl/certs',
'--expose=/usr/bin/env',
'--container', '--network'] + share_tarballs_args \
......@@ -727,13 +727,12 @@ def main():
print('FIXME: Qt fails loading QML modules due to '
'https://issues.guix.gnu.org/47655')
# Relaunch this script, this time in a pure Guix environment.
guix_args = ['time-machine', '--channels=guix/channels.scm',
'--', 'environment', '--pure',
guix_args = ['shell', '--pure',
# to allow pulseaudio to connect to an existing server
"-E", "XAUTHORITY", "-E", "XDG_RUNTIME_DIR",
'--manifest=guix/manifest.scm', '--']
args = sys.argv + ['--distribution=guix']
print('Running in a guix environment spawned with: guix {}'
print('Running in a guix shell spawned with: guix {}'
.format(str.join(' ', guix_args + args)))
os.execlp('guix', 'guix', *(guix_args + args))
else:
......
(list (channel
(inherit %default-guix-channel)
;; Use the staging branch for now, as it includes more debug
;; symbols and fixes a propagation conflict between
;; gdk-pixbuf+svg and gdk-pixbuf.
(branch "staging")
(commit
"42231bc15df441d6426dec57283aca9ae7a03fcf")))
......@@ -19,7 +19,7 @@
;;;
;;; It can also be invoked directly to spawn a development environment, like so:
;;;
;;; $ guix environment --pure --manifest=guix/manifest.scm
;;; $ guix shell --pure --manifest=guix/manifest.scm
(specifications->manifest
(list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment