aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/lxc-no-static-bin.patch58
-rw-r--r--gnu/packages/virtualization.scm33
3 files changed, 73 insertions, 19 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 2654f6fe81..a092122d22 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1744,6 +1744,7 @@ dist_patch_DATA = \
%D%/packages/patches/lua-5.4-liblua-so.patch \
%D%/packages/patches/lugaru-fix-sound.patch \
%D%/packages/patches/luit-posix.patch \
+ %D%/packages/patches/lxc-no-static-bin.patch \
%D%/packages/patches/mactelnet-remove-init.patch \
%D%/packages/patches/mailutils-variable-lookup.patch \
%D%/packages/patches/make-impure-dirs.patch \
diff --git a/gnu/packages/patches/lxc-no-static-bin.patch b/gnu/packages/patches/lxc-no-static-bin.patch
new file mode 100644
index 0000000000..bad1771f09
--- /dev/null
+++ b/gnu/packages/patches/lxc-no-static-bin.patch
@@ -0,0 +1,58 @@
+init.lxc.static is only used as a fallback and breaks ‘strip-runpath’,
+so let's not build it.
+
+Index: lxc-6.0.1/src/lxc/cmd/meson.build
+===================================================================
+--- lxc-6.0.1.orig/src/lxc/cmd/meson.build
++++ lxc-6.0.1/src/lxc/cmd/meson.build
+@@ -62,19 +62,6 @@ cmd_lxc_update_config = configure_file(
+ output: 'lxc-update-config')
+ install_data(join_paths(project_build_root, 'src/lxc/cmd/lxc-update-config'), install_dir: bindir)
+
+-if sanitize == 'none' and libcap_static_linkable
+- cmd_programs += executable(
+- 'init.lxc.static',
+- cmd_lxc_init_sources,
+- include_directories: liblxc_includes,
+- link_with: [liblxc_static],
+- link_args: ['-static'],
+- c_args: ['-DNO_LXC_CONF'],
+- dependencies: [libcap_static] + liblxc_dependency_headers,
+- install_dir: sbindir,
+- install: true)
+-endif
+-
+ cmd_programs += executable(
+ 'init.lxc',
+ cmd_lxc_init_sources,
+Index: lxc-6.0.1/meson.build
+===================================================================
+--- lxc-6.0.1.orig/meson.build
++++ lxc-6.0.1/meson.build
+@@ -426,26 +426,11 @@ if want_capabilities
+ pkgconfig_libs += libcap
+ liblxc_dependencies += libcap
+
+- libcap_static = dependency('libcap', required: false, static: true)
+- if not libcap_static.found()
+- # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
+- libcap_static = cc.find_library('cap', required: false, static: true)
+- endif
+-
+ code = '''
+ int main(int argc, char *argv[]) { return 0; };
+ '''
+- if libcap_static.found()
+- libcap_static_linkable = cc.links(code, args: '-static', dependencies: libcap_static)
+- else
+- libcap_static_linkable = false
+- endif
+- srcconf.set10('HAVE_STATIC_LIBCAP', libcap_static_linkable)
+ else
+- libcap_static = []
+- libcap_static_linkable = false
+ srcconf.set10('HAVE_LIBCAP', false)
+- srcconf.set10('HAVE_STATIC_LIBCAP', false)
+ endif
+
+ libutil = cc.find_library('util', required: false)
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index eaa7a8a264..4a3cb9be20 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -36,6 +36,7 @@
;;; Copyright © 2024 Raven Hallsby <karl@hallsby.com>
;;; Copyright © 2024 jgart <jgart@dismail.de>
;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Jakob Kirsch <jakob.kirsch@web.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -56,6 +57,7 @@
#:use-module (gnu packages)
#:use-module (gnu packages acl)
#:use-module (gnu packages admin)
+ #:use-module (gnu packages apparmor)
#:use-module (gnu packages assembly)
#:use-module (gnu packages attr)
#:use-module (gnu packages autotools)
@@ -1350,7 +1352,7 @@ all common programming languages. Vala bindings are also provided.")
(define-public lxc
(package
(name "lxc")
- (version "4.0.12")
+ (version "6.0.1")
(source (origin
(method url-fetch)
(uri (string-append
@@ -1358,30 +1360,23 @@ all common programming languages. Vala bindings are also provided.")
version ".tar.gz"))
(sha256
(base32
- "1vyk2j5w9gfyh23w3ar09cycyws16mxh3clbb33yhqzwcs1jy96v"))))
- (build-system gnu-build-system)
+ "1q3p3zzm338pmc97z6ly8cjginkyljxqbk1c37l2xa46vfy8zcyc"))
+ (patches (search-patches "lxc-no-static-bin.patch"))))
+ (build-system meson-build-system)
(native-inputs
(list pkg-config docbook2x))
(inputs
- (list gnutls libcap libseccomp libselinux))
+ (list apparmor dbus gnutls libcap libseccomp libselinux))
(arguments
(list #:configure-flags
- #~(list (string-append "--docdir=" #$output "/share/doc/"
+ #~(list (string-append "-Ddoc-path=" #$output "/share/doc/"
#$name "-" #$version)
- "--sysconfdir=/etc"
- "--localstatedir=/var")
- #:phases
- #~(modify-phases %standard-phases
- (replace 'install
- (lambda _
- (invoke "make" "install"
- (string-append "bashcompdir=" #$output
- "/etc/bash_completion.d")
- ;; Don't install files into /var and /etc.
- "LXCPATH=/tmp/var/lib/lxc"
- "localstatedir=/tmp/var"
- "sysconfdir=/tmp/etc"
- "sysconfigdir=/tmp/etc/default"))))))
+ "-Ddistrosysconfdir=/etc"
+ "-Dinit-script=sysvinit"
+ "-Dinstall-state-dirs=false"
+ "-Dinstall-init-files=false"
+ "-Dspecfile=false"
+ "-Db_lto=false")))
(synopsis "Linux container tools")
(home-page "https://linuxcontainers.org/")
(description