From c1c722b6b3382f437cf758595f62f244157549d8 Mon Sep 17 00:00:00 2001 From: lucasew Date: Tue, 14 Mar 2023 13:47:26 -0300 Subject: [PATCH] cockpit: 284 -> 287 Signed-off-by: lucasew --- pkgs/servers/monitoring/cockpit/default.nix | 30 ++++++++-------- .../monitoring/cockpit/fix-makefiles.patch | 34 ------------------- .../cockpit/nerf-node-modules.patch | 12 ------- 3 files changed, 15 insertions(+), 61 deletions(-) delete mode 100644 pkgs/servers/monitoring/cockpit/fix-makefiles.patch delete mode 100644 pkgs/servers/monitoring/cockpit/nerf-node-modules.patch diff --git a/pkgs/servers/monitoring/cockpit/default.nix b/pkgs/servers/monitoring/cockpit/default.nix index 3a06ead3756..3fe0c17ded9 100644 --- a/pkgs/servers/monitoring/cockpit/default.nix +++ b/pkgs/servers/monitoring/cockpit/default.nix @@ -47,13 +47,13 @@ in stdenv.mkDerivation rec { pname = "cockpit"; - version = "284"; + version = "287"; src = fetchFromGitHub { owner = "cockpit-project"; repo = "cockpit"; - rev = version; - sha256 = "sha256-iAIW6nVUk1FJD2dQvDMREPVqrq0JkExJ7lVio//ALts="; + rev = "refs/tags/${version}"; + sha256 = "sha256-tIZOI3jiMRaGHMXS1mA1Tom9ij3L/VuxDUJdnEc7SSc="; fetchSubmodules = true; }; @@ -88,23 +88,25 @@ stdenv.mkDerivation rec { udev ]; - patches = [ + postPatch = '' # Instead of requiring Internet access to do an npm install to generate the package-lock.json # it copies the package-lock.json already present in the node_modules folder fetched as a git # submodule. - ./nerf-node-modules.patch + echo "#!/bin/sh" > test/node_modules - # sysconfdir is $(prefix)/etc by default and it breaks the configuration file loading feature - # changing sysconfdir to /etc breaks the build in this part of the makefile because it tries - # to write to /etc inside the sandbox - # this patch redirects it to write to $out/etc instead of /etc - ./fix-makefiles.patch - ]; + substituteInPlace src/tls/cockpit-certificate-helper.in \ + --replace 'COCKPIT_CONFIG="@sysconfdir@/cockpit"' 'COCKPIT_CONFIG=/etc/cockpit' + + substituteInPlace src/tls/cockpit-certificate-ensure.c \ + --replace '#define COCKPIT_SELFSIGNED_PATH PACKAGE_SYSCONF_DIR COCKPIT_SELFSIGNED_FILENAME' '#define COCKPIT_SELFSIGNED_PATH "/etc" COCKPIT_SELFSIGNED_FILENAME' + + substituteInPlace src/common/cockpitconf.c \ + --replace 'const char *cockpit_config_dirs[] = { PACKAGE_SYSCONF_DIR' 'const char *cockpit_config_dirs[] = { "/etc"' - postPatch = '' # instruct users with problems to create a nixpkgs issue instead of nagging upstream directly substituteInPlace configure.ac \ --replace 'devel@lists.cockpit-project.org' 'https://github.com/NixOS/nixpkgs/issues/new?assignees=&labels=0.kind%3A+bug&template=bug_report.md&title=cockpit%25' + patchShebangs \ test/common/pixel-tests \ test/common/run-tests \ @@ -114,7 +116,7 @@ stdenv.mkDerivation rec { tools/make-compile-commands \ tools/node-modules \ tools/termschutz \ - tools/webpack-make + tools/webpack-make.js for f in node_modules/.bin/*; do patchShebangs $(realpath $f) @@ -145,7 +147,6 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-prefix-only=yes" - "--sysconfdir=/etc" "--disable-pcp" # TODO: figure out how to package its dependency "--with-default-session-path=/run/wrappers/bin:/run/current-system/sw/bin" ]; @@ -158,7 +159,6 @@ stdenv.mkDerivation rec { ''; postBuild = '' - find | grep cockpit-bridge chmod +x \ src/systemd/update-motd \ src/tls/cockpit-certificate-helper \ diff --git a/pkgs/servers/monitoring/cockpit/fix-makefiles.patch b/pkgs/servers/monitoring/cockpit/fix-makefiles.patch deleted file mode 100644 index a22eb9f00ea..00000000000 --- a/pkgs/servers/monitoring/cockpit/fix-makefiles.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/src/systemd/Makefile.am b/src/systemd/Makefile.am -index f28ea41df..684b82006 100644 ---- a/src/systemd/Makefile.am -+++ b/src/systemd/Makefile.am -@@ -23,10 +23,10 @@ dist_motd_SCRIPTS = src/systemd/update-motd - - # Automake: 'Variables using ... ‘sysconf’ ... are installed by install-exec.' - install-exec-hook:: -- mkdir -p $(DESTDIR)$(sysconfdir)/motd.d -- ln -sTfr $(DESTDIR)/run/cockpit/motd $(DESTDIR)$(sysconfdir)/motd.d/cockpit -- mkdir -p $(DESTDIR)$(sysconfdir)/issue.d -- ln -sTfr $(DESTDIR)/run/cockpit/motd $(DESTDIR)$(sysconfdir)/issue.d/cockpit.issue -+ mkdir -p $(DESTDIR)$(prefix)$(sysconfdir)/motd.d -+ ln -sTfr $(DESTDIR)$(prefix)/run/cockpit/motd $(DESTDIR)$(prefix)$(sysconfdir)/motd.d/cockpit -+ mkdir -p $(DESTDIR)$(prefix)$(sysconfdir)/issue.d -+ ln -sTfr $(DESTDIR)$(prefix)/run/cockpit/motd $(DESTDIR)$(prefix)$(sysconfdir)/issue.d/cockpit.issue - - tempconfdir = $(prefix)/lib/tmpfiles.d - nodist_tempconf_DATA = src/systemd/cockpit-tempfiles.conf -diff --git a/src/ws/Makefile-ws.am b/src/ws/Makefile-ws.am -index ed4e4363e..77a35b0e5 100644 ---- a/src/ws/Makefile-ws.am -+++ b/src/ws/Makefile-ws.am -@@ -169,8 +169,8 @@ install-tests:: - $(INSTALL_DATA) mock-pam-conv-mod.so $(DESTDIR)$(pamdir)/ - - install-exec-hook:: -- mkdir -p $(DESTDIR)$(sysconfdir)/cockpit/ws-certs.d $(DESTDIR)$(sysconfdir)/cockpit/machines.d -- chmod 755 $(DESTDIR)$(sysconfdir)/cockpit/ws-certs.d $(DESTDIR)$(sysconfdir)/cockpit/machines.d -+ mkdir -p $(DESTDIR)$(prefix)$(sysconfdir)/cockpit/ws-certs.d $(DESTDIR)$(prefix)$(sysconfdir)/cockpit/machines.d -+ chmod 755 $(DESTDIR)$(prefix)$(sysconfdir)/cockpit/ws-certs.d $(DESTDIR)$(prefix)$(sysconfdir)/cockpit/machines.d - - dist_check_DATA += \ - src/ws/mock-combined.crt \ diff --git a/pkgs/servers/monitoring/cockpit/nerf-node-modules.patch b/pkgs/servers/monitoring/cockpit/nerf-node-modules.patch deleted file mode 100644 index 36b0e3861a4..00000000000 --- a/pkgs/servers/monitoring/cockpit/nerf-node-modules.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/tools/node-modules b/tools/node-modules -index 518875d..72b51e0 100755 ---- a/tools/node-modules -+++ b/tools/node-modules -@@ -7,6 +7,7 @@ V="${V-0}" # default to friendly messages - - set -eu - cd "${0%/*}/.." -+exit 0 - . tools/git-utils.sh - - cmd_remove() {