From f9ada7fdc4d4dad63a3bbb4a43bbb3f8441f0c60 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 19 Sep 2022 11:17:53 +0300 Subject: gnu: connman: Patch CVE-2022-32392, CVE-2022-32293. * gnu/packages/connman.scm (connman)[source]: Add patches. * gnu/packages/patches/connman-CVE-2022-32292.patch, gnu/packages/patches/connman-CVE-2022-32293-pt1.patch, gnu/packages/patches/connman-CVE-2022-32293-pt1.patch: New files. * gnu/local.mk (dist_patch_DATA): Register them. --- gnu/local.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 542c06e221..0fe6ae4c0b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -979,9 +979,12 @@ dist_patch_DATA = \ %D%/packages/patches/cmake-curl-certificates-3.24.patch \ %D%/packages/patches/coda-use-system-libs.patch \ %D%/packages/patches/collectd-5.11.0-noinstallvar.patch \ - %D%/packages/patches/containerd-create-pid-file.patch \ %D%/packages/patches/combinatorial-blas-awpm.patch \ %D%/packages/patches/combinatorial-blas-io-fix.patch \ + %D%/packages/patches/connman-CVE-2022-32292.patch \ + %D%/packages/patches/connman-CVE-2022-32293-pt1.patch \ + %D%/packages/patches/connman-CVE-2022-32293-pt2.patch \ + %D%/packages/patches/containerd-create-pid-file.patch \ %D%/packages/patches/cool-retro-term-wctype.patch \ %D%/packages/patches/coreutils-gnulib-tests.patch \ %D%/packages/patches/coq-fix-envvars.patch \ -- cgit v1.2.3 From 96c78878645f33b64b4b60fe8e1399c902b7facd Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Mon, 19 Sep 2022 20:51:13 +0200 Subject: gnu: gnome-todo: Update to "Endeavour" 42.0. * gnu/packages/gnome.scm (gnome-todo): Deprecate and rename to... (endeavour): ... this. [source]: Use git origin. * gnu/packages/patches/gnome-todo-libportal.patch: Deleted file. * gnu/local.mk (dist_patch_DATA): Update accordingly. --- gnu/local.mk | 1 - gnu/packages/gnome.scm | 20 ++++----- gnu/packages/patches/gnome-todo-libportal.patch | 54 ------------------------- 3 files changed, 11 insertions(+), 64 deletions(-) delete mode 100644 gnu/packages/patches/gnome-todo-libportal.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 0fe6ae4c0b..238fb72bc5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1219,7 +1219,6 @@ dist_patch_DATA = \ %D%/packages/patches/gnome-online-miners-tracker-3.patch \ %D%/packages/patches/gnome-settings-daemon-gc.patch \ %D%/packages/patches/gnome-session-support-elogind.patch \ - %D%/packages/patches/gnome-todo-libportal.patch \ %D%/packages/patches/gnome-tweaks-search-paths.patch \ %D%/packages/patches/gnupg-CVE-2022-34903.patch \ %D%/packages/patches/gnupg-default-pinentry.patch \ diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index c8a49040f4..9229abb41d 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -10252,19 +10252,18 @@ (define-public gnome-calendar desktop. It supports multiple calendars, month, week and year view.") (license license:gpl3+))) -(define-public gnome-todo +(define-public endeavour (package - (name "gnome-todo") - (version "41.0") + (name "endeavour") + (version "42.0") (source (origin - (method url-fetch) - (uri (string-append "mirror://gnome/sources/" name "/" - (version-major version) "/" - name "-" version ".tar.xz")) + (method git-fetch) + (uri (git-reference + (url "https://gitlab.gnome.org/World/Endeavour") + (commit (string-append "v" version)))) (sha256 (base32 - "1r94880d4khbjhhfnhaba3y3d4hv2bri82rzfzxn27s5iybpqras")) - (patches (search-patches "gnome-todo-libportal.patch")))) + "0d6by7aq8db35zavzvckcxxxcdi6qnv0mkjndhb0syc8ih15dpak")))) (build-system meson-build-system) (arguments (list @@ -10309,6 +10308,9 @@ (define-public gnome-todo to perfectly fit the GNOME desktop.") (license license:gpl3+))) +(define-public gnome-todo + (deprecated-package "gnome-todo" endeavour)) + (define-public gnome-dictionary (package (name "gnome-dictionary") diff --git a/gnu/packages/patches/gnome-todo-libportal.patch b/gnu/packages/patches/gnome-todo-libportal.patch deleted file mode 100644 index 380c628592..0000000000 --- a/gnu/packages/patches/gnome-todo-libportal.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 3e1f4da8c0e536c09ffaf3b43fe2eb5dc17cc23e Mon Sep 17 00:00:00 2001 -From: Georges Basile Stavracas Neto -Date: Thu, 18 Nov 2021 19:46:13 -0300 -Subject: [PATCH] flatpak: Adjust to libportal changes - ---- - build-aux/flatpak/org.gnome.Todo.json | 3 +++ - src/plugins/background/gtd-plugin-background.c | 2 +- - src/plugins/background/meson.build | 2 +- - 3 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/build-aux/flatpak/org.gnome.Todo.json b/build-aux/flatpak/org.gnome.Todo.json -index 034e200c..44b83d66 100644 ---- a/build-aux/flatpak/org.gnome.Todo.json -+++ b/build-aux/flatpak/org.gnome.Todo.json -@@ -143,6 +143,9 @@ - { - "name" : "libportal", - "buildsystem" : "meson", -+ "config-opts" : [ -+ "-Dbackends=gtk4" -+ ], - "sources" : [ - { - "type" : "git", -diff --git a/src/plugins/background/gtd-plugin-background.c b/src/plugins/background/gtd-plugin-background.c -index cf48786c..f64d07aa 100644 ---- a/src/plugins/background/gtd-plugin-background.c -+++ b/src/plugins/background/gtd-plugin-background.c -@@ -28,7 +28,7 @@ - #include - - #include --#include -+#include - - #define AUTOSTART_NOTIFICATION_ID "Gtd::BackgroundPlugin::autostart_notification" - #define AUTOSTART_NOTIFICATION_TIMEOUT 3 /* seconds */ -diff --git a/src/plugins/background/meson.build b/src/plugins/background/meson.build -index a671a4f3..59d3635f 100644 ---- a/src/plugins/background/meson.build -+++ b/src/plugins/background/meson.build -@@ -1,7 +1,7 @@ - plugins_ldflags += ['-Wl,--undefined=gtd_plugin_background_register_types'] - - plugins_deps += [ -- dependency('libportal'), -+ dependency('libportal-gtk4'), - ] - - plugins_sources += files( --- -GitLab - -- cgit v1.2.3 From 1e3d01dd05f4a06e44a54bb8124e93adf3b8b958 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 20 Sep 2022 10:22:35 +0200 Subject: gnu: r-httpuv: Update to 1.6.6. * gnu/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch: Replace this patch... * gnu/packages/patches/r-httpuv-1.6.6-unvendor-libuv.patch: ...with this. * gnu/local.mk (dist_patch_DATA): Update patch file. * gnu/packages/cran.scm (r-httpuv): Update to 1.6.6. [source]: Update patch. --- gnu/local.mk | 2 +- gnu/packages/cran.scm | 6 +- .../patches/r-httpuv-1.5.5-unvendor-libuv.patch | 73 --------------------- .../patches/r-httpuv-1.6.6-unvendor-libuv.patch | 74 ++++++++++++++++++++++ 4 files changed, 78 insertions(+), 77 deletions(-) delete mode 100644 gnu/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch create mode 100644 gnu/packages/patches/r-httpuv-1.6.6-unvendor-libuv.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 238fb72bc5..ef1bae5f3c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1774,7 +1774,7 @@ dist_patch_DATA = \ %D%/packages/patches/readline-6.2-CVE-2014-2524.patch \ %D%/packages/patches/renpy-use-system-fribidi.patch \ %D%/packages/patches/reposurgeon-add-missing-docbook-files.patch \ - %D%/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch \ + %D%/packages/patches/r-httpuv-1.6.6-unvendor-libuv.patch \ %D%/packages/patches/ri-li-modernize_cpp.patch \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm index 75175e39f7..b02200bdc7 100644 --- a/gnu/packages/cran.scm +++ b/gnu/packages/cran.scm @@ -2393,16 +2393,16 @@ (define-public r-hiddenmarkov (define-public r-httpuv (package (name "r-httpuv") - (version "1.6.5") + (version "1.6.6") (source (origin (method url-fetch) (uri (cran-uri "httpuv" version)) (sha256 (base32 - "0mlilxh2mlrsbbrncla2rg02crr8nnajv649d8whx7ayr8lkdxpm")) + "14qjf7bpl7pay89b7vi2vccl342q8xs6101a9x6qijy54k9myfa1")) ;; Unvendor bundled libraries. As of 1.5.4 the vendored libuv ;; only contains fixes for building on Solaris. - (patches (search-patches "r-httpuv-1.5.5-unvendor-libuv.patch")) + (patches (search-patches "r-httpuv-1.6.6-unvendor-libuv.patch")) (modules '((guix build utils))) ;; Cannot unbundle http-parser, because it contains local ;; modifications. diff --git a/gnu/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch b/gnu/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch deleted file mode 100644 index 30c6425477..0000000000 --- a/gnu/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch +++ /dev/null @@ -1,73 +0,0 @@ -Removes references to bundled libuv. - ---- a/src/Makevars 2020-07-31 11:53:30.576484531 +0200 -+++ b/src/Makevars 2020-07-31 11:54:19.369863118 +0200 -@@ -5,7 +5,7 @@ - - UNAME := $(shell uname) - --PKG_LIBS = ./libuv/.libs/libuv.a ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -+PKG_LIBS = -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread - - ifeq ($(UNAME), Darwin) - PKG_LIBS += -framework CoreServices -@@ -23,7 +23,7 @@ - - PKG_CFLAGS = $(C_VISIBILITY) -DSTRICT_R_HEADERS - PKG_CXXFLAGS = $(CXX_VISIBILITY) -DSTRICT_R_HEADERS --PKG_CPPFLAGS = -Ilibuv/include -pthread -+PKG_CPPFLAGS = -pthread - - # To avoid spurious warnings from `R CMD check --as-cran`, about compiler - # warning flags like -Werror. -@@ -43,49 +43,5 @@ - # PKG_CPPFLAGS += -D_GLIBCXX_ASSERTIONS - - --$(SHLIB): libuv/.libs/libuv.a http-parser/http_parser.o sha1/sha1.o base64/base64.o -+$(SHLIB): http-parser/http_parser.o sha1/sha1.o base64/base64.o - --# We needed to rename lt~obsolete.m4 because the name causes problems with R --# CMD check. Here we rename it back. --libuv/m4/lt~obsolete.m4: libuv/m4/lt_obsolete.m4 -- cp -p -f libuv/m4/lt_obsolete.m4 libuv/m4/lt~obsolete.m4 -- --# Run ./configure to create the Makefile. --# --# On systems that do _not_ have automake installed, we need to make sure that --# configure does not try to run automake, because it will fail. To do that, we --# we need to touch various autotools-related files so it doesn't try to run --# autotools programs again. We also need to make sure configure is executable, --# because on some platforms, calling unzip() in R does not preserve the --# executable bit. --# --# If the system does have automake, then we'll run autogen.sh before configure, --# as per the official build instructions for libuv. autogen.sh will in turn run --# aclocal, autoconf, and automake. --# --# It's VERY IMPORTANT that mtime(aclocal.m4) <= mtime(configure), and also --# mtime(aclocal.m4) <= mtime(Makefile.in). On some platforms, passing multiple --# files to a single touch command gives them all the same time, but on others --# (Solaris and possibly some Fedoras) the timestamps are slightly increasing --# from one to the next, i.e. the order matters. To remove this fragility, we --# use "-r aclocal.m4" to ensure that all three files are guaranteed to have --# precisely the same timestamp value. --libuv/Makefile: libuv/m4/lt~obsolete.m4 -- cd libuv; \ -- if ! command -v automake >/dev/null 2>&1 ; then \ -- echo "automake not found. Touching files so configure will not try to run automake."; \ -- touch aclocal.m4; \ -- touch -r aclocal.m4 configure Makefile.in; \ -- else \ -- echo "automake found. Running autogen.sh."; \ -- sh autogen.sh; \ -- fi; \ -- chmod +x configure; \ -- CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS) $(C_VISIBILITY)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" ./configure $(CONFIGURE_FLAGS) -- --libuv/.libs/libuv.a: libuv/Makefile -- $(MAKE) --directory=libuv \ -- HAVE_DTRACE=0 -- --clean: -- $(MAKE) --directory=libuv distclean diff --git a/gnu/packages/patches/r-httpuv-1.6.6-unvendor-libuv.patch b/gnu/packages/patches/r-httpuv-1.6.6-unvendor-libuv.patch new file mode 100644 index 0000000000..adbacc995f --- /dev/null +++ b/gnu/packages/patches/r-httpuv-1.6.6-unvendor-libuv.patch @@ -0,0 +1,74 @@ +Removes references to bundled libuv. + +--- a/src/Makevars 2022-09-19 23:37:55.067810741 +0200 ++++ b/src/Makevars 2022-09-19 23:39:20.984859770 +0200 +@@ -5,7 +5,7 @@ + + UNAME := $(shell uname) + +-PKG_LIBS = ./libuv/.libs/libuv.a ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread ++PKG_LIBS = -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread + + ifeq ($(UNAME), Darwin) + PKG_LIBS += -framework CoreServices +@@ -23,7 +23,7 @@ + + PKG_CFLAGS = $(C_VISIBILITY) -DSTRICT_R_HEADERS + PKG_CXXFLAGS = $(CXX_VISIBILITY) -DSTRICT_R_HEADERS +-PKG_CPPFLAGS = -Ilibuv/include -pthread ++PKG_CPPFLAGS = -pthread + + # To avoid spurious warnings from `R CMD check --as-cran`, about compiler + # warning flags like -Werror. +@@ -43,50 +43,4 @@ + # PKG_CPPFLAGS += -D_GLIBCXX_ASSERTIONS + + +-$(SHLIB): libuv/.libs/libuv.a http-parser/http_parser.o sha1/sha1.o base64/base64.o +- +-# We needed to rename lt~obsolete.m4 because the name causes problems with R +-# CMD check. Here we rename it back. +-libuv/m4/lt~obsolete.m4: libuv/m4/lt_obsolete.m4 +- cp -p -f libuv/m4/lt_obsolete.m4 libuv/m4/lt~obsolete.m4 +- +-# Run ./configure to create the Makefile. +-# +-# On systems that do _not_ have automake installed, we need to make sure that +-# configure does not try to run automake, because it will fail. To do that, we +-# we need to touch various autotools-related files so it doesn't try to run +-# autotools programs again. We also need to make sure configure is executable, +-# because on some platforms, calling unzip() in R does not preserve the +-# executable bit. +-# +-# If the system does have automake, then we'll run autogen.sh before configure, +-# as per the official build instructions for libuv. autogen.sh will in turn run +-# aclocal, autoconf, and automake. +-# +-# It's VERY IMPORTANT that mtime(aclocal.m4) <= mtime(configure), and also +-# mtime(aclocal.m4) <= mtime(Makefile.in). On some platforms, passing multiple +-# files to a single touch command gives them all the same time, but on others +-# (Solaris and possibly some Fedoras) the timestamps are slightly increasing +-# from one to the next, i.e. the order matters. To remove this fragility, we +-# use "-r aclocal.m4" to ensure that all three files are guaranteed to have +-# precisely the same timestamp value. +-libuv/Makefile: libuv/m4/lt~obsolete.m4 +- cd libuv; \ +- if ! command -v automake >/dev/null 2>&1 ; then \ +- echo "automake not found. Touching files so configure will not try to run automake."; \ +- touch aclocal.m4; \ +- touch -r aclocal.m4 configure Makefile.in; \ +- else \ +- echo "automake found. Running autoupdate and autogen.sh."; \ +- autoupdate; \ +- sh autogen.sh; \ +- fi; \ +- chmod +x configure; \ +- CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS) $(C_VISIBILITY)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" ./configure $(CONFIGURE_FLAGS) +- +-libuv/.libs/libuv.a: libuv/Makefile +- $(MAKE) --directory=libuv \ +- HAVE_DTRACE=0 +- +-clean: +- $(MAKE) --directory=libuv distclean ++$(SHLIB): http-parser/http_parser.o sha1/sha1.o base64/base64.o -- cgit v1.2.3 From 503cfd542124d5e6983c28839953424e44b88244 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 17 Sep 2022 22:34:55 -0400 Subject: gnu: pjproject: Update to 2.12.1. * gnu/packages/telephony.scm (pjproject): Update to 2.12.1. [source]: Delete patches field. [arguments]: Use gexps. * gnu/packages/patches/pjproject-install-libpjsua2.patch: Delete file. * gnu/local.mk (dist_patch_DATA): De-register it. --- gnu/local.mk | 1 - .../patches/pjproject-install-libpjsua2.patch | 19 --- gnu/packages/telephony.scm | 185 +++++++++++---------- 3 files changed, 93 insertions(+), 112 deletions(-) delete mode 100644 gnu/packages/patches/pjproject-install-libpjsua2.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index ef1bae5f3c..b3cf87de97 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1608,7 +1608,6 @@ dist_patch_DATA = \ %D%/packages/patches/password-store-tree-compat.patch \ %D%/packages/patches/pciutils-hurd-configure.patch \ %D%/packages/patches/pciutils-hurd-fix.patch \ - %D%/packages/patches/pjproject-install-libpjsua2.patch \ %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \ %D%/packages/patches/pokerth-boost.patch \ %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch \ diff --git a/gnu/packages/patches/pjproject-install-libpjsua2.patch b/gnu/packages/patches/pjproject-install-libpjsua2.patch deleted file mode 100644 index ef9b0de91f..0000000000 --- a/gnu/packages/patches/pjproject-install-libpjsua2.patch +++ /dev/null @@ -1,19 +0,0 @@ -# Retrieved from upstream: -# https://github.com/pjsip/pjproject/commit/742f7dc252ded778a8b677937791c02e2fbc0dde -diff --git a/Makefile b/Makefile -index 31a6d39d4..74e246a44 100644 ---- a/Makefile -+++ b/Makefile -@@ -121,9 +121,10 @@ cmp_wav: - - install: - mkdir -p $(DESTDIR)$(libdir)/ -- cp -af $(APP_LIB_FILES) $(DESTDIR)$(libdir)/ - if [ "$(PJ_EXCLUDE_PJSUA2)x" = "x" ] ; then \ -- cp -af $(PJ_DIR)/pjsip/lib/libpjsua2-$(LIB_SUFFIX) $(DESTDIR)$(libdir)/; \ -+ cp -af $(APP_LIBXX_FILES) $(DESTDIR)$(libdir)/; \ -+ else \ -+ cp -af $(APP_LIB_FILES) $(DESTDIR)$(libdir)/; \ - fi - mkdir -p $(DESTDIR)$(includedir)/ - for d in pjlib pjlib-util pjnath pjmedia pjsip; do \ diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index 6702155a57..5a7c3821ad 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -17,7 +17,7 @@ ;;; Copyright © 2020 Brett Gilio ;;; Copyright © 2020, 2022 Michael Rohleder ;;; Copyright © 2020 Raghav Gururajan -;;; Copyright © 2020, 2021 Maxim Cournoyer +;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2021 LibreMiami ;;; Copyright © 2021 Sarah Morgensen @@ -723,7 +723,7 @@ (define-public twinkle (define-public pjproject (package (name "pjproject") - (version "2.11.1") + (version "2.12.1") (source (origin (method git-fetch) @@ -733,7 +733,7 @@ (define-public pjproject (file-name (git-file-name name version)) (sha256 (base32 - "04s4bgr2d22ym2ajjk6q507hyqss1p59yp8avyyyf5f8032nbaws")) + "0xrj4sznbaip22y9hclff6y81l285bzkkj1smzifskpk3kiwp00w")) (modules '((guix build utils))) (snippet '(begin @@ -742,99 +742,100 @@ (define-public pjproject (substitute* "aconfigure.ac" (("third_party/build/os-auto.mak") "")) (substitute* "Makefile" - (("third_party/build") "")))) - (patches (search-patches "pjproject-install-libpjsua2.patch")))) + (("third_party/build") "")))))) (build-system gnu-build-system) (outputs '("out" "debug" "static")) (arguments - `(#:test-target "selftest" - #:configure-flags - (list "--enable-shared" - "--with-external-speex" - "--with-external-gsm" - "--with-external-srtp" - "--with-external-pa" - ;; The following flag is Linux specific. - ,@(if (string-contains (or (%current-system) - (%current-target-system)) "linux") - '("--enable-epoll") - '()) - "--with-gnutls" ;disable OpenSSL checks - "--disable-libyuv" ;TODO: add missing package - "--disable-silk" ;TODO: add missing package - "--disable-libwebrtc" ;TODO: add missing package - "--disable-ilbc-codec" ;cannot be unbundled - "--disable-g7221-codec" ;TODO: add missing package - "--enable-libsamplerate" - ;; -DNDEBUG is set to prevent pjproject from raising - ;; assertions that aren't critical, crashing - ;; applications as the result. - "CFLAGS=-DNDEBUG" - ;; Specify a runpath reference to itself, which is missing and - ;; causes the validate-runpath phase to fail. - (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") - "/lib")) - #:phases - (modify-phases %standard-phases - (add-before 'build 'build-dep - (lambda _ (invoke "make" "dep"))) - ;; The check phases is moved after the install phase so to - ;; use the installed shared libraries for the tests. - (delete 'check) - (add-after 'install 'move-static-libraries - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (s (string-append (assoc-ref outputs "static") "/lib"))) - (mkdir-p s) - (with-directory-excursion out - (for-each (lambda (f) - (rename-file f (string-append s "/" (basename f)))) - (find-files "." "\\.a$")))))) - (add-after 'install 'check - (assoc-ref %standard-phases 'check)) - (add-before 'patch-source-shebangs 'autoconf - (lambda _ - (invoke "autoconf" "-v" "-f" "-i" "-o" - "aconfigure" "aconfigure.ac"))) - (add-before 'autoconf 'disable-some-tests - (lambda _ - (substitute* "pjlib/src/pjlib-test/test.h" - ;; Disable network tests which are slow and/or require an - ;; actual network. - (("#define GROUP_NETWORK.*") - "#define GROUP_NETWORK 0\n")) - (substitute* "self-test.mak" - ;; Fails with: pjlib-util-test-x86_64-unknown-linux-gnu: - ;; ../src/pjlib-util-test/resolver_test.c:1501: action2_1: - ;; Assertio n `pj_strcmp2(&pkt->q[0].name, "_sip._udp." - ;; "domain2.com")==0' failed. - ((" pjlib_util_test ") "")) - (substitute* "pjsip/src/test/test.h" - ;; Fails with: Error: unable to acquire TCP transport: - ;; [pj_status_t=120101] Network is unreachable. - (("#define INCLUDE_TCP_TEST.*") - "#define INCLUDE_TCP_TEST 0\n") - ;; The TSX tests takes a very long time to run; skip them. - (("#define INCLUDE_TSX_GROUP.*") - "#define INCLUDE_TSX_GROUP 0\n")) - (substitute* "pjsip/src/test/dns_test.c" - ;; The round_robin_test fails non-deterministically (depending - ;; on load); skip it (see: - ;; https://github.com/pjsip/pjproject/issues/2500). - (("round_robin_test(pool)") 0)) - (substitute* "pjmedia/src/test/test.h" - ;; The following tests require a sound card. - (("#define HAS_MIPS_TEST.*") - "#define HAS_MIPS_TEST 0\n") - (("#define HAS_JBUF_TEST.*") - "#define HAS_JBUF_TEST 0\n")) - (substitute* "Makefile" - ;; Disable the pjnath and pjsua tests, which require an actual - ;; network and an actual sound card, respectively. - (("pjnath-test pjmedia-test pjsip-test pjsua-test") - "pjmedia-test pjsip-test"))))))) + (list + #:test-target "selftest" + #:configure-flags + #~(list "--enable-shared" + "--with-external-speex" + "--with-external-gsm" + "--with-external-srtp" + "--with-external-pa" + ;; The following flag is Linux specific. + #$@(if (string-contains (or (%current-system) + (%current-target-system)) "linux") + #~("--enable-epoll") + #~()) + "--with-gnutls" ;disable OpenSSL checks + "--disable-libyuv" ;TODO: add missing package + "--disable-silk" ;TODO: add missing package + "--disable-libwebrtc" ;TODO: add missing package + "--disable-ilbc-codec" ;cannot be unbundled + "--disable-g7221-codec" ;TODO: add missing package + "--enable-libsamplerate" + ;; -DNDEBUG is set to prevent pjproject from raising + ;; assertions that aren't critical, crashing + ;; applications as the result. + "CFLAGS=-DNDEBUG" + ;; Specify a runpath reference to itself, which is missing and + ;; causes the validate-runpath phase to fail. + (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")) + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'build-dep + (lambda _ (invoke "make" "dep"))) + ;; The check phases is moved after the install phase so to + ;; use the installed shared libraries for the tests. + (delete 'check) + (add-after 'install 'move-static-libraries + (lambda* (#:key outputs #:allow-other-keys) + (let ((s (string-append #$output:static "/lib"))) + (mkdir-p s) + (with-directory-excursion #$output + (for-each (lambda (f) + (rename-file f (string-append s "/" (basename f)))) + (find-files "." "\\.a$")))))) + (add-after 'install 'check + (assoc-ref %standard-phases 'check)) + (add-before 'patch-source-shebangs 'autoconf + (lambda _ + (invoke "autoconf" "-v" "-f" "-i" "-o" + "aconfigure" "aconfigure.ac"))) + (add-before 'autoconf 'disable-some-tests + (lambda _ + (substitute* "pjlib/src/pjlib-test/test.h" + ;; Disable network tests which are slow and/or require an + ;; actual network. + (("#define GROUP_NETWORK.*") + "#define GROUP_NETWORK 0\n")) + (substitute* "self-test.mak" + ;; Fails with: pjlib-util-test-x86_64-unknown-linux-gnu: + ;; ../src/pjlib-util-test/resolver_test.c:1501: action2_1: + ;; Assertio n `pj_strcmp2(&pkt->q[0].name, "_sip._udp." + ;; "domain2.com")==0' failed. + ((" pjlib_util_test ") "")) + (substitute* "pjsip/src/test/test.h" + ;; Fails with: Error: unable to acquire TCP transport: + ;; [pj_status_t=120101] Network is unreachable. + (("#define INCLUDE_TCP_TEST.*") + "#define INCLUDE_TCP_TEST 0\n") + ;; The TSX tests takes a very long time to run; skip them. + (("#define INCLUDE_TSX_GROUP.*") + "#define INCLUDE_TSX_GROUP 0\n")) + (substitute* "pjsip/src/test/dns_test.c" + ;; The round_robin_test fails non-deterministically (depending + ;; on load); skip it (see: + ;; https://github.com/pjsip/pjproject/issues/2500). + (("round_robin_test(pool)") 0)) + (substitute* "pjmedia/src/test/test.h" + ;; The following tests require a sound card. + (("#define HAS_MIPS_TEST.*") + "#define HAS_MIPS_TEST 0\n") + (("#define HAS_JBUF_TEST.*") + "#define HAS_JBUF_TEST 0\n")) + (substitute* "Makefile" + ;; Disable the pjnath and pjsua tests, which require an actual + ;; network and an actual sound card, respectively. + (("pjnath-test pjmedia-test pjsip-test pjsua-test") + "pjmedia-test pjsip-test"))))))) (native-inputs - (list autoconf automake libtool pkg-config)) + (list autoconf + automake + libtool + pkg-config)) (inputs (list bcg729 gnutls -- cgit v1.2.3 From 84369105d4fc8c6f9399e6157112259deada30b8 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 17 Sep 2022 23:28:45 -0400 Subject: gnu: jami: Update to 20220825.0828.c10f01f. * gnu/packages/jami.scm (jami): Update to 20220825.0828.c10f01f. (%jami-version): Set to latest release. (%jami-sources): Remove jami-fix-esc-bug.patch; add jami-fix-crash-on-block-contact.patch. * gnu/packages/patches/jami-fix-esc-bug.patch: Delete file. * gnu/packages/patches/jami-fix-crash-on-block-contact.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. --- gnu/local.mk | 8 +++--- gnu/packages/jami.scm | 6 ++-- .../patches/jami-fix-crash-on-block-contact.patch | 32 ++++++++++++++++++++++ gnu/packages/patches/jami-fix-esc-bug.patch | 24 ---------------- 4 files changed, 39 insertions(+), 31 deletions(-) create mode 100644 gnu/packages/patches/jami-fix-crash-on-block-contact.patch delete mode 100644 gnu/packages/patches/jami-fix-esc-bug.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index b3cf87de97..d99c650d1a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1325,10 +1325,7 @@ dist_patch_DATA = \ %D%/packages/patches/irrlicht-link-against-needed-libs.patch \ %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ %D%/packages/patches/itk-snap-alt-glibc-compat.patch \ - %D%/packages/patches/jami-fix-esc-bug.patch \ - %D%/packages/patches/json-c-0.13-CVE-2020-12762.patch \ - %D%/packages/patches/json-c-0.12-CVE-2020-12762.patch \ - %D%/packages/patches/jsoncpp-pkg-config-version.patch \ + %D%/packages/patches/jami-fix-crash-on-block-contact.patch \ %D%/packages/patches/jamvm-1.5.1-aarch64-support.patch \ %D%/packages/patches/jamvm-1.5.1-armv7-support.patch \ %D%/packages/patches/jamvm-2.0.0-aarch64-support.patch \ @@ -1350,6 +1347,9 @@ dist_patch_DATA = \ %D%/packages/patches/jfsutils-add-sysmacros.patch \ %D%/packages/patches/jfsutils-gcc-compat.patch \ %D%/packages/patches/jfsutils-include-systypes.patch \ + %D%/packages/patches/json-c-0.13-CVE-2020-12762.patch \ + %D%/packages/patches/json-c-0.12-CVE-2020-12762.patch \ + %D%/packages/patches/jsoncpp-pkg-config-version.patch \ %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ %D%/packages/patches/julia-tracker-16-compat.patch \ %D%/packages/patches/julia-allow-parallel-build.patch \ diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index 95c0052841..26081910ff 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -66,7 +66,7 @@ (define-module (gnu packages jami) #:use-module (guix packages) #:use-module (guix utils)) -(define %jami-version "20220726.1515.da8d1da") +(define %jami-version "20220825.0828.c10f01f") (define %jami-sources ;; Return an origin object of the tarball release sources archive of the @@ -90,8 +90,8 @@ (define %jami-sources "plugins")))) (sha256 (base32 - "1zx0i9aw8jsba3bjc5r4pkkybm8c0lyz420ciq89vsswd48gfdhg")) - (patches (search-patches "jami-fix-esc-bug.patch")))) + "1iv06jb66g206qxm75v7rc3mqvrml1028avflsj11chj8jh63j14")) + (patches (search-patches "jami-fix-crash-on-block-contact.patch")))) ;; Jami maintains a set of patches for some key dependencies (currently ;; pjproject and ffmpeg) of Jami that haven't yet been integrated upstream. diff --git a/gnu/packages/patches/jami-fix-crash-on-block-contact.patch b/gnu/packages/patches/jami-fix-crash-on-block-contact.patch new file mode 100644 index 0000000000..60dab79296 --- /dev/null +++ b/gnu/packages/patches/jami-fix-crash-on-block-contact.patch @@ -0,0 +1,32 @@ +From 673dc5f525c9d478fc22f8ea0a50d9849a81f6c8 Mon Sep 17 00:00:00 2001 +From: Kateryna Kostiuk +Date: Fri, 2 Sep 2022 13:32:10 -0400 +Subject: [PATCH] conversation: fix crash when block contact + +This patch fixes crash that happened when block contact +for not active account. + +GitLab: #758 +Change-Id: I5347394a67cdffe0d95c9ee03aedf9d2618cec55 +--- + src/jamidht/jamiaccount.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/daemon/src/jamidht/jamiaccount.cpp b/daemon/src/jamidht/jamiaccount.cpp +index fe15eedb2..9d0a5ee68 100644 +--- a/daemon/src/jamidht/jamiaccount.cpp ++++ b/daemon/src/jamidht/jamiaccount.cpp +@@ -1129,7 +1129,9 @@ JamiAccount::loadAccount(const std::string& archive_password, + if (auto convModule = shared->convModule()) + convModule->removeContact(uri, banned); + // Remove current connections with contact +- shared->connectionManager_->closeConnectionsWith(uri); ++ if (shared->connectionManager_) { ++ shared->connectionManager_->closeConnectionsWith(uri); ++ } + // Update client. + emitSignal(shared->getAccountID(), + uri, +-- +2.37.3 + diff --git a/gnu/packages/patches/jami-fix-esc-bug.patch b/gnu/packages/patches/jami-fix-esc-bug.patch deleted file mode 100644 index 6d78542f1e..0000000000 --- a/gnu/packages/patches/jami-fix-esc-bug.patch +++ /dev/null @@ -1,24 +0,0 @@ -This fixes the issue where pressing the ESC key would hide the Jami -GUI on systems lacking a notification tray. - -From 47fd4c38ddd8bd350319ce9bb750ca496826e655 Mon Sep 17 00:00:00 2001 -From: Sébastien Blin -Date: Fri, 29 Jul 2022 21:24:01 -0400 -Subject: [PATCH] layoutmanager: fix popFullScreenItem - -Change-Id: I79780d4ad570846e6f3c52734dd627bcd0e11327 ---- - -diff --git a/src/app/LayoutManager.qml b/src/app/LayoutManager.qml -index 98516ce..87f13ac 100644 ---- a/client-qt/src/app/LayoutManager.qml -+++ b/client-qt/src/app/LayoutManager.qml -@@ -176,7 +176,7 @@ - - // Only leave fullscreen mode if our window isn't in fullscreen - // mode already. -- if (priv.fullScreenItems.length === 0) { -+ if (priv.fullScreenItems.length === 0 && priv.windowedVisibility !== Window.Hidden) { - // Simply recall the last visibility state. - visibility = priv.windowedVisibility - } -- cgit v1.2.3 From d68721c55ae683d5939d1cf88f15081aa97c2b2b Mon Sep 17 00:00:00 2001 From: Simon Streit Date: Mon, 8 Aug 2022 16:56:41 +0200 Subject: services: Add samba service. * gnu/services/samba.scm: New file. * gnu/tests/samba.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add them. * po/guix/POTFILES.in Add 'gnu/services/samba.scm'. * doc/guix.texi: Document it. Signed-off-by: Lars-Dominik Braun --- doc/guix.texi | 53 ++++++++++++++ gnu/local.mk | 2 + gnu/services/samba.scm | 182 +++++++++++++++++++++++++++++++++++++++++++++++++ gnu/tests/samba.scm | 158 ++++++++++++++++++++++++++++++++++++++++++ po/guix/POTFILES.in | 1 + 5 files changed, 396 insertions(+) create mode 100644 gnu/services/samba.scm create mode 100644 gnu/tests/samba.scm (limited to 'gnu/local.mk') diff --git a/doc/guix.texi b/doc/guix.texi index eb12efa85e..bfc01d6d2c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -106,6 +106,7 @@ Copyright @copyright{} 2022 Philip M@sup{c}Grath@* Copyright @copyright{} 2022 Karl Hallsby@* Copyright @copyright{} 2022 Justin Veilleux@* Copyright @copyright{} 2022 Reily Siegel@* +Copyright @copyright{} 2022 Simon Streit@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -385,6 +386,7 @@ Services * DNS Services:: DNS daemons. * VPN Services:: VPN daemons. * Network File System:: NFS related services. +* Samba Services:: Samba services. * Continuous Integration:: Cuirass and Laminar services. * Power Management Services:: Extending battery life. * Audio Services:: The MPD. @@ -17516,6 +17518,7 @@ declaration. * DNS Services:: DNS daemons. * VPN Services:: VPN daemons. * Network File System:: NFS related services. +* Samba Services:: Samba services. * Continuous Integration:: Cuirass and Laminar services. * Power Management Services:: Extending battery life. * Audio Services:: The MPD. @@ -31297,6 +31300,56 @@ The verbosity level of the daemon. @end table @end deftp +@node Samba Services, Continuous Integration, Network File System, Services +@subsection Samba Services + +@cindex Samba +@cindex SMB +The @code{(gnu services samba)} module provides service definitions for +Samba as well as additional helper services. Currently it provides the +following services. + +@subsubheading Samba + +@uref{https://www.samba.org, Samba} provides network shares for folders +and printers using the SMB/CIFS protocol commonly used on Windows. It +can also act as an Active Directory Domain Controller (AD DC) for other +hosts in an heterougenious network with different types of Computer +systems. + +@defvar {Scheme variable} samba-service-type + +The service type to enable the samba services @code{samba}, @code{nmbd}, +@code{smbd} and @code{winbindd}. By default this service type does not +run as an AD DC, hence @code{samba} remains disabled. + +@end defvar + +@deftp{Data Type} samba-service-configuration +Configuration record for the Samba suite. + +@table @asis +@item @code{package} (default: @code{samba}) +The samba package to use. + +@item @code{config-file} (default: @code{#f}) +The config file to use. + +@item @code{enable-samba?} (default: @code{#f}) +Manually enable the @code{samba} daemon. + +@item @code{enable-smbd?} (default: @code{#f}) +Manually enable the @code{smbd} daemon. + +@item @code{enable-nmbd?} (default: @code{#f}) +Manually enable the @code{nmbd} daemon. + +@item @code{enable-winbindd?} (default: @code{#f}) +Manually enable the @code{winbindd} daemon. + +@end table +@end deftp + @node Continuous Integration @subsection Continuous Integration diff --git a/gnu/local.mk b/gnu/local.mk index d99c650d1a..140845a7c6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -682,6 +682,7 @@ GNU_SYSTEM_MODULES = \ %D%/services/herd.scm \ %D%/services/pm.scm \ %D%/services/rsync.scm \ + %D%/services/samba.scm \ %D%/services/sddm.scm \ %D%/services/spice.scm \ %D%/services/ssh.scm \ @@ -761,6 +762,7 @@ GNU_SYSTEM_MODULES = \ %D%/tests/package-management.scm \ %D%/tests/reconfigure.scm \ %D%/tests/rsync.scm \ + %D%/tests/samba.scm \ %D%/tests/security.scm \ %D%/tests/security-token.scm \ %D%/tests/singularity.scm \ diff --git a/gnu/services/samba.scm b/gnu/services/samba.scm new file mode 100644 index 0000000000..2c9e52a0b0 --- /dev/null +++ b/gnu/services/samba.scm @@ -0,0 +1,182 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Simon Streit +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services samba) + + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages admin) + #:use-module (gnu packages samba) + + #:use-module (gnu services) + #:use-module (gnu services configuration) + #:use-module (gnu services shepherd) + #:use-module (gnu services base) + #:use-module (gnu system shadow) + + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix modules) + #:use-module (guix records) + + #:use-module (ice-9 format) + #:use-module (ice-9 match) + #:use-module (ice-9 textual-ports) + #:use-module (srfi srfi-1) + + #:export (samba-service-type + samba-configuration + samba-smb-conf)) + +(define %smb-conf + (plain-file "smb.conf" "[global] + workgroup = WORKGROUP + server string = Samba Server + server role = standalone server + log file = /var/log/samba/log.%m + logging = file +")) + +(define-record-type* + samba-configuration + make-samba-configuration + samba-configuration? + (package samba-configuration-package + (default samba)) + (config-file samba-configuration-config-file + (default #f)) + (enable-samba? samba-configuration-enable-samba? + (default #f)) + (enable-smbd? samba-configuration-enable-smbd? + (default #t)) + (enable-nmbd? samba-configuration-enable-nmbd? + (default #t)) + (enable-winbindd? samba-configuration-enable-winbindd? + (default #t))) + +(define (samba-activation config) + (let ((package (samba-configuration-package config)) + (config-file (samba-configuration-config-file config))) + (with-imported-modules '((guix build utils)) + (let ((lib-dir "/var/lib/samba") + (log-dir "/var/log/samba") + (run-dir "/var/run/samba") + (lock-dir "/var/lock/samba") + (cache-dir "/var/cache/samba") + (etc-dir "/etc/samba") + (smb.conf "/etc/samba/smb.conf")) + #~(begin + (use-modules (guix build utils)) + (mkdir-p #$etc-dir) + (mkdir-p #$lib-dir) + (mkdir-p/perms (string-append #$lib-dir "/private") + (getpwnam "root") #o700) + (mkdir-p #$log-dir) + (mkdir-p #$run-dir) + (mkdir-p #$lock-dir) + (mkdir-p #$cache-dir) + (copy-file #$config-file #$smb.conf) + (invoke #$(file-append package "/bin/testparm") + "--suppress-prompt" #$smb.conf)))))) + +(define (samba-samba-shepherd-service config) + (let ((package (samba-configuration-package config)) + (config-file (samba-configuration-config-file config))) + (list (shepherd-service + (documentation "Run Samba") + (provision '(samba-samba)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/sbin/samba") + (string-append "--configfile=" #$config-file) + "--foreground" + "--no-process-group"))) + (stop #~(make-kill-destructor)))))) + +(define (samba-nmbd-shepherd-service config) + (let ((package (samba-configuration-package config)) + (config-file (samba-configuration-config-file config))) + (list (shepherd-service + (documentation "Run NMBD") + (provision '(samba-nmbd)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/sbin/nmbd") + (string-append "--configfile=" #$config-file) + "--foreground" + "--no-process-group"))) + (stop #~(make-kill-destructor)))))) + +(define (samba-smbd-shepherd-service config) + (let ((package (samba-configuration-package config)) + (config-file (samba-configuration-config-file config))) + (list (shepherd-service + (documentation "Run SMBD") + (provision '(samba-smbd)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/sbin/smbd") + (string-append "--configfile=" #$config-file) + "--foreground" + "--no-process-group"))) + (stop #~(make-kill-destructor)))))) + +(define (samba-winbindd-shepherd-service config) + (let ((package (samba-configuration-package config)) + (config-file (samba-configuration-config-file config))) + (list (shepherd-service + (documentation "Run Winnbindd for Name Service Switch") + (provision '(samba-winbindd)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/sbin/winbindd") + (string-append "--configfile=" #$config-file) + "--foreground" + "--no-process-group"))) + (stop #~(make-kill-destructor)))))) + +(define (samba-shepherd-services config) + (append (if (samba-configuration-enable-samba? config) + (samba-samba-shepherd-service config) + '()) + (if (samba-configuration-enable-nmbd? config) + (samba-nmbd-shepherd-service config) + '()) + (if (samba-configuration-enable-smbd? config) + (samba-smbd-shepherd-service config) + '()) + (if (samba-configuration-enable-winbindd? config) + (samba-winbindd-shepherd-service config) + '()))) + +(define samba-service-type + (service-type + (name 'samba) + (description "Run @uref{https://www.samba.org/, Samba}, a network file and +print service for all clients using the SMB/CIFS protocol. Samba is an +important component to seamlessly integrate Linux/Unix Servers and Desktops +into Active Directory environments. It can function both as a domain +controller or as a regular domain member.") + (extensions + (list (service-extension shepherd-root-service-type + samba-shepherd-services) + (service-extension activation-service-type + samba-activation) + (service-extension profile-service-type + (compose list samba-configuration-package)))) + (default-value (samba-configuration)))) diff --git a/gnu/tests/samba.scm b/gnu/tests/samba.scm new file mode 100644 index 0000000000..27d7ea49c3 --- /dev/null +++ b/gnu/tests/samba.scm @@ -0,0 +1,158 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Simon Streit +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu tests samba) + #:use-module (gnu tests) + #:use-module (gnu system) + #:use-module (gnu system vm) + #:use-module (gnu services) + #:use-module (gnu services networking) + #:use-module (gnu services samba) + #:use-module (gnu packages samba) + #:use-module (guix gexp) + #:use-module (guix store) + #:export (%test-samba)) + + +;;; +;;; The Samba service. +;;; + +(define %samba-os + (let ((base-os (simple-operating-system + (simple-service 'create-target-directory activation-service-type + #~(begin + (mkdir-p "/srv/samba/guest") + (chown "/srv/samba/guest" + (passwd:uid (getpw "nobody")) + (passwd:gid (getpw "nobody"))))) + (service dhcp-client-service-type) + (service samba-service-type + (samba-configuration + (config-file (plain-file "smb.conf" " +[global] + workgroup = WORKGROUP + server string = Samba Server + server role = standalone server + log file = /var/log/samba/log.%m + logging = file + +[guest] + path = /srv/samba/guest + read only = no + guest ok = yes + guest only = yes +"))))))) + (operating-system + (inherit base-os) + (packages (cons samba (operating-system-packages base-os)))))) + +(define* (run-samba-test) + "Return a test of an OS running Samba service." + + (define vm + (virtual-machine + (operating-system (marionette-operating-system + %samba-os + #:imported-modules '((gnu services herd)))) + (port-forwardings '((8135 . 135) + (8137 . 137) + (8138 . 138) + (8445 . 445))))) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (gnu build marionette) + (srfi srfi-26) + (srfi srfi-64)) + + (define marionette + (make-marionette '(#$vm))) + + (test-runner-current (system-test-runner #$output)) + (test-begin "samba") + + (test-assert "samba-smbd running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'samba-smbd)) + marionette)) + + (test-assert "samba-nmbd running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'samba-nmbd)) + marionette)) + + (test-assert "samba-winbindd running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'samba-winbindd)) + marionette)) + + (test-assert "smbd service process id" + (let ((pid + (number->string (wait-for-file "/var/run/samba/smbd.pid" + marionette)))) + (marionette-eval `(file-exists? (string-append "/proc/" ,pid)) + marionette))) + + (test-assert "nmbd service process id" + (let ((pid + (number->string (wait-for-file "/var/run/samba/nmbd.pid" + marionette)))) + (marionette-eval `(file-exists? (string-append "/proc/" ,pid)) + marionette))) + + (test-assert "winbindd service process id" + (let ((pid + (number->string (wait-for-file "/var/run/samba/winbindd.pid" + marionette)))) + (marionette-eval `(file-exists? (string-append "/proc/" ,pid)) + marionette))) + + (test-assert "samba-smbd is listening for peers" + (wait-for-tcp-port 445 marionette)) + + (test-equal "smbclient connect" + 0 + (marionette-eval + '(system* #$(file-append samba "/bin/smbclient") + "--list=localhost" "--no-pass") + marionette)) + + (test-equal "smbclient connect" + 0 + (marionette-eval + '(system* #$(file-append samba "/bin/smbclient") + "--list=localhost" "--no-pass") + marionette)) + + (test-end)))) + + (gexp->derivation "samba-test" test)) + +(define %test-samba + (system-test + (name "samba") + (description "Connect to a running Samba daemon.") + (value (run-samba-test)))) diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in index c27bc74afc..4050a4c7ae 100644 --- a/po/guix/POTFILES.in +++ b/po/guix/POTFILES.in @@ -6,6 +6,7 @@ gnu/services.scm gnu/system.scm gnu/services/configuration.scm gnu/services/shepherd.scm +gnu/services/samba.scm gnu/home/services.scm gnu/home/services/ssh.scm gnu/home/services/symlink-manager.scm -- cgit v1.2.3 From ebe9d660a55629f2506db124b0e016885fc61e5c Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 12 Sep 2022 08:31:36 +0200 Subject: gnu: Add compression module. Move the compression record to a dedicated module so that it can be used outside (guix scripts pack) module. * guix/scripts/pack.scm (, %compressors, lookup-compressor): Move it to ... * gnu/compression.scm: ... this new file. * gnu/ci.scm: Adapt it. * local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/ci.scm | 3 ++- gnu/compression.scm | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ gnu/local.mk | 1 + guix/scripts/pack.scm | 46 ++-------------------------------- 4 files changed, 74 insertions(+), 45 deletions(-) create mode 100644 gnu/compression.scm (limited to 'gnu/local.mk') diff --git a/gnu/ci.scm b/gnu/ci.scm index 2c51ea7387..19a48bdbf1 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -39,9 +39,10 @@ (define-module (gnu ci) #:select (gpl3+ license? license-name)) #:use-module ((guix utils) #:select (%current-system)) #:use-module ((guix scripts pack) - #:select (lookup-compressor self-contained-tarball)) + #:select (self-contained-tarball)) #:use-module (gnu bootloader) #:use-module (gnu bootloader u-boot) + #:use-module (gnu compression) #:use-module (gnu image) #:use-module (gnu packages) #:use-module (gnu packages gcc) diff --git a/gnu/compression.scm b/gnu/compression.scm new file mode 100644 index 0000000000..0418e80a15 --- /dev/null +++ b/gnu/compression.scm @@ -0,0 +1,69 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu compression) + #:use-module (guix gexp) + #:use-module (guix ui) + #:use-module ((gnu packages compression) #:hide (zip)) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (ice-9 match) + #:export (compressor + compressor? + compressor-name + compressor-extension + compressor-command + %compressors + lookup-compressor)) + +;; Type of a compression tool. +(define-record-type + (compressor name extension command) + compressor? + (name compressor-name) ;string (e.g., "gzip") + (extension compressor-extension) ;string (e.g., ".lz") + (command compressor-command)) ;gexp (e.g., #~(list "/gnu/store/…/gzip" + ; "-9n" )) + +(define %compressors + ;; Available compression tools. + (list (compressor "gzip" ".gz" + #~(list #+(file-append gzip "/bin/gzip") "-9n")) + (compressor "lzip" ".lz" + #~(list #+(file-append lzip "/bin/lzip") "-9")) + (compressor "xz" ".xz" + #~(append (list #+(file-append xz "/bin/xz") + "-e") + (%xz-parallel-args))) + (compressor "bzip2" ".bz2" + #~(list #+(file-append bzip2 "/bin/bzip2") "-9")) + (compressor "zstd" ".zst" + ;; The default level 3 compresses better than gzip in a + ;; fraction of the time, while the highest level 19 + ;; (de)compresses more slowly and worse than xz. + #~(list #+(file-append zstd "/bin/zstd") "-3")) + (compressor "none" "" #f))) + +(define (lookup-compressor name) + "Return the compressor object called NAME. Error out if it could not be +found." + (or (find (match-lambda + (($ name*) + (string=? name* name))) + %compressors) + (leave (G_ "~a: compressor not found~%") name))) diff --git a/gnu/local.mk b/gnu/local.mk index 140845a7c6..4774be2688 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -81,6 +81,7 @@ GNU_SYSTEM_MODULES = \ %D%/bootloader/u-boot.scm \ %D%/bootloader/depthcharge.scm \ %D%/ci.scm \ + %D%/compression.scm \ %D%/home.scm \ %D%/home/services.scm \ %D%/home/services/desktop.scm \ diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index d3ee69840c..78b6978c92 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -48,6 +48,7 @@ (define-module (guix scripts pack) #:use-module (guix scripts build) #:use-module (guix transformations) #:use-module ((guix self) #:select (make-config.scm)) + #:use-module (gnu compression) #:use-module (gnu packages) #:use-module (gnu packages bootstrap) #:use-module ((gnu packages compression) #:hide (zip)) @@ -61,13 +62,7 @@ (define-module (guix scripts pack) #:use-module (srfi srfi-26) #:use-module (srfi srfi-37) #:use-module (ice-9 match) - #:export (compressor? - compressor-name - compressor-extension - compressor-command - %compressors - lookup-compressor - self-contained-tarball + #:export (self-contained-tarball debian-archive docker-image squashfs-image @@ -75,34 +70,6 @@ (define-module (guix scripts pack) %formats guix-pack)) -;; Type of a compression tool. -(define-record-type - (compressor name extension command) - compressor? - (name compressor-name) ;string (e.g., "gzip") - (extension compressor-extension) ;string (e.g., ".lz") - (command compressor-command)) ;gexp (e.g., #~(list "/gnu/store/…/gzip" - ; "-9n" )) - -(define %compressors - ;; Available compression tools. - (list (compressor "gzip" ".gz" - #~(list #+(file-append gzip "/bin/gzip") "-9n")) - (compressor "lzip" ".lz" - #~(list #+(file-append lzip "/bin/lzip") "-9")) - (compressor "xz" ".xz" - #~(append (list #+(file-append xz "/bin/xz") - "-e") - (%xz-parallel-args))) - (compressor "bzip2" ".bz2" - #~(list #+(file-append bzip2 "/bin/bzip2") "-9")) - (compressor "zstd" ".zst" - ;; The default level 3 compresses better than gzip in a - ;; fraction of the time, while the highest level 19 - ;; (de)compresses more slowly and worse than xz. - #~(list #+(file-append zstd "/bin/zstd") "-3")) - (compressor "none" "" #f))) - ;; This one is only for use in this module, so don't put it in %compressors. (define bootstrap-xz (compressor "bootstrap-xz" ".xz" @@ -110,15 +77,6 @@ (define bootstrap-xz "-e") (%xz-parallel-args)))) -(define (lookup-compressor name) - "Return the compressor object called NAME. Error out if it could not be -found." - (or (find (match-lambda - (($ name*) - (string=? name* name))) - %compressors) - (leave (G_ "~a: compressor not found~%") name))) - (define not-config? ;; Select (guix …) and (gnu …) modules, except (guix config). (match-lambda -- cgit v1.2.3 From c8112f3bd95269ce4aca12dedbfe61bb6b37acae Mon Sep 17 00:00:00 2001 From: Alex Griffin Date: Sat, 10 Sep 2022 10:03:10 +0200 Subject: system: images: Add wsl2 module. * gnu/system/images/wsl2.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * doc/guix.texi ("System Images"): Document it. Signed-off-by: Mathieu Othacehe --- doc/guix.texi | 13 ++++ gnu/local.mk | 2 + gnu/system/images/wsl2.scm | 170 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 185 insertions(+) create mode 100644 gnu/system/images/wsl2.scm (limited to 'gnu/local.mk') diff --git a/doc/guix.texi b/doc/guix.texi index 6c44c22a32..ba13ebf144 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -41476,6 +41476,8 @@ one or multiple partitions. @item @code{tarball}, a tar.gz image archive. +@item @code{wsl2}, a WSL2 image. + @end itemize @item @code{platform} (default: @code{#false}) @@ -41842,6 +41844,17 @@ Build an image similar to the one built by the @code{hurd-image-type} but with the @code{format} set to @code{'compressed-qcow2}. @end defvr +@defvr {Scheme Variable} wsl2-image-type +Build an image for the @acronym{WSL2, Windows Subsystem for Linux 2}. +It can be imported by running: + +@example +wsl --import Guix ./guix ./wsl2-image.tar.gz +wsl -d Guix +@end example + +@end defvr + So, if we get back to the @code{guix system image} command taking an @code{operating-system} declaration as argument. By default, the @code{efi-raw-image-type} is used to turn the provided diff --git a/gnu/local.mk b/gnu/local.mk index 4774be2688..4e982dc6e3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -53,6 +53,7 @@ # Copyright © 2022 John Kehayias # Copyright © 2022 muradm # Copyright © 2022 Hilton Chain +# Copyright © 2022 Alex Griffin # # This file is part of GNU Guix. # @@ -718,6 +719,7 @@ GNU_SYSTEM_MODULES = \ %D%/system/images/pine64.scm \ %D%/system/images/pinebook-pro.scm \ %D%/system/images/rock64.scm \ + %D%/system/images/wsl2.scm \ \ %D%/machine.scm \ \ diff --git a/gnu/system/images/wsl2.scm b/gnu/system/images/wsl2.scm new file mode 100644 index 0000000000..15cb4f69b8 --- /dev/null +++ b/gnu/system/images/wsl2.scm @@ -0,0 +1,170 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Alex Griffin +;;; Copyright © 2022 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu system images wsl2) + #:use-module (gnu bootloader) + #:use-module (gnu image) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages guile) + #:use-module (gnu packages linux) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu system) + #:use-module (gnu system image) + #:use-module (gnu system shadow) + #:use-module (guix build-system trivial) + #:use-module (guix gexp) + #:use-module (guix packages) + #:export (wsl-boot-program + wsl-os + wsl2-image)) + +(define (wsl-boot-program user) + "Program that runs the system boot script, then starts a login shell as +USER." + (program-file + "wsl-boot-program" + (with-imported-modules '((guix build syscalls)) + #~(begin + (use-modules (guix build syscalls)) + (unless (file-exists? "/run/current-system") + (let ((shepherd-socket "/var/run/shepherd/socket")) + ;; Clean up this file so we can wait for it later. + (when (file-exists? shepherd-socket) + (delete-file shepherd-socket)) + + ;; Child process boots the system and is replaced by shepherd. + (when (zero? (primitive-fork)) + (let* ((system-generation + (readlink "/var/guix/profiles/system")) + (system (readlink + (string-append + (if (absolute-file-name? system-generation) + "" + "/var/guix/profiles/") + system-generation)))) + (setenv "GUIX_NEW_SYSTEM" system) + (execl #$(file-append guile-3.0 "/bin/guile") + "guile" + "--no-auto-compile" + (string-append system "/boot")))) + + ;; Parent process waits for shepherd before continuing. + (while (not (file-exists? shepherd-socket)) + (sleep 1)))) + + (let* ((pw (getpw #$user)) + (shell (passwd:shell pw)) + (sudo #+(file-append sudo "/bin/sudo")) + (args (cdr (command-line)))) + ;; Save the value of $PATH set by WSL. Useful for finding + ;; Windows binaries to run with WSL's binfmt interop. + (setenv "WSLPATH" (getenv "PATH")) + + ;; /run is mounted with the nosuid flag by WSL. This prevents + ;; running the /run/setuid-programs. Remount it without this flag + ;; as a workaround. See: + ;; https://github.com/microsoft/WSL/issues/8716. + (mount #f "/run" #f + MS_REMOUNT + #:update-mtab? #f) + + ;; Start login shell as user. + (apply execl sudo "sudo" + "--preserve-env=WSLPATH" + "-u" #$user + "--" + shell "-l" args)))))) + +(define dummy-package + (package + (name "dummy") + (version "0") + (source #f) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:target #f + #:builder (begin + (use-modules (guix build utils)) + (let* ((out (assoc-ref %outputs "out")) + (dummy (string-append out "/dummy"))) + (mkdir-p out) + (call-with-output-file dummy + (const #t)))))) + (home-page #f) + (synopsis #f) + (description #f) + (license #f))) + +(define dummy-bootloader + (bootloader + (name 'dummy-bootloader) + (package dummy-package) + (configuration-file "/dev/null") + (configuration-file-generator + (lambda (. _rest) + (plain-file "dummy-bootloader" ""))) + (installer #~(const #t)))) + +(define dummy-kernel dummy-package) + +(define (dummy-initrd . _rest) + (plain-file "dummy-initrd" "")) + +(define-public wsl-os + (operating-system + (host-name "gnu") + (timezone "Etc/UTC") + (bootloader + (bootloader-configuration + (bootloader dummy-bootloader))) + (kernel dummy-kernel) + (initrd dummy-initrd) + (initrd-modules '()) + (firmware '()) + (file-systems '()) + (users (cons* (user-account + (name "guest") + (group "users") + (supplementary-groups '("wheel")) ; allow use of sudo + (password "") + (comment "Guest of GNU")) + (user-account + (inherit %root-account) + (shell (wsl-boot-program "guest"))) + %base-user-accounts)) + (services + (list + (service guix-service-type) + (service special-files-service-type + `(("/bin/sh" ,(file-append bash "/bin/bash")) + ("/bin/mount" ,(file-append util-linux "/bin/mount")) + ("/usr/bin/env" ,(file-append coreutils "/bin/env")))))))) + +(define wsl2-image + (image + (inherit + (os->image wsl-os + #:type wsl2-image-type)) + (name 'wsl2-image))) + +wsl2-image -- cgit v1.2.3 From 474d3ef643b68e885fba1f685ebdf04d5aa78bcb Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 26 Sep 2022 11:19:50 -0400 Subject: gnu: qemu: Disable qtest-aarch64/migration-test test. * gnu/packages/patches/qemu-disable-aarch64-migration-test.patch: Add patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/virtualization.scm (qemu): Apply it. --- gnu/local.mk | 1 + .../patches/qemu-disable-aarch64-migration-test.patch | 13 +++++++++++++ gnu/packages/virtualization.scm | 1 + 3 files changed, 15 insertions(+) create mode 100644 gnu/packages/patches/qemu-disable-aarch64-migration-test.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 4e982dc6e3..9b3b199c7c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1749,6 +1749,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-werkzeug-tests.patch \ %D%/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch \ %D%/packages/patches/qemu-build-info-manual.patch \ + %D%/packages/patches/qemu-disable-aarch64-migration-test.patch \ %D%/packages/patches/qemu-glibc-2.27.patch \ %D%/packages/patches/qemu-glibc-2.30.patch \ %D%/packages/patches/qemu-fix-agent-paths.patch \ diff --git a/gnu/packages/patches/qemu-disable-aarch64-migration-test.patch b/gnu/packages/patches/qemu-disable-aarch64-migration-test.patch new file mode 100644 index 0000000000..bf60ed23bb --- /dev/null +++ b/gnu/packages/patches/qemu-disable-aarch64-migration-test.patch @@ -0,0 +1,13 @@ +Disable the qtest-aarch64/migration-test, which sometimes fail non-deterministically. +See: https://gitlab.com/qemu-project/qemu/-/issues/1230. + +--- qemu-7.1.0/tests/qtest/meson.build.old 1969-12-31 19:00:01.000000000 -0500 ++++ qemu-7.1.0/tests/qtest/meson.build 2022-09-26 11:11:05.434209797 -0400 +@@ -219,7 +219,6 @@ + ['arm-cpu-features', + 'numa-test', + 'boot-serial-test', +- 'migration-test', + 'bcm2835-dma-test'] + + qtests_s390x = \ diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 199156dbb9..e14549dcd1 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -169,6 +169,7 @@ (define-public qemu (base32 "1rmvrgqjhrvcmchnz170dxvrrf14n6nm39y8ivrprmfydd9lwqx0")) (patches (search-patches "qemu-build-info-manual.patch" + "qemu-disable-aarch64-migration-test.patch" "qemu-fix-agent-paths.patch")) (modules '((guix build utils))) (snippet -- cgit v1.2.3