From 6d34890bbd5779be8a17a7bf00f6ff38e5343b79 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 5 Nov 2024 14:16:04 +0800 Subject: [PATCH] project-lemonlime: add missing patch for non FHS env --- .../0001-Bind-Nix-Store.patch | 41 +++++++++++++++++++ pkgs/by-name/pr/project-lemonlime/package.nix | 16 ++++++++ 2 files changed, 57 insertions(+) create mode 100644 pkgs/by-name/pr/project-lemonlime/0001-Bind-Nix-Store.patch diff --git a/pkgs/by-name/pr/project-lemonlime/0001-Bind-Nix-Store.patch b/pkgs/by-name/pr/project-lemonlime/0001-Bind-Nix-Store.patch new file mode 100644 index 000000000000..86420dc0916a --- /dev/null +++ b/pkgs/by-name/pr/project-lemonlime/0001-Bind-Nix-Store.patch @@ -0,0 +1,41 @@ +From f404e176e89c5d778363cb0177b44dc1aa5e1fda Mon Sep 17 00:00:00 2001 +From: wxt <3264117476@qq.com> +Date: Tue, 5 Nov 2024 12:53:04 +0800 +Subject: [PATCH] Bind Nix Store + +--- + src/core/judgingthread.cpp | 18 +++--------------- + 1 file changed, 3 insertions(+), 15 deletions(-) + +diff --git a/src/core/judgingthread.cpp b/src/core/judgingthread.cpp +index 7201552..88aee9d 100644 +--- a/src/core/judgingthread.cpp ++++ b/src/core/judgingthread.cpp +@@ -893,21 +893,9 @@ void JudgingThread::runProgram() { + auto *runner = new QProcess(this); + QStringList argumentsList; + +- argumentsList << "--ro-bind" +- << "/usr" +- << "/usr"; +- argumentsList << "--symlink" +- << "/usr/lib" +- << "/lib"; +- argumentsList << "--symlink" +- << "/usr/lib64" +- << "/lib64"; +- argumentsList << "--symlink" +- << "/usr/bin" +- << "/bin"; +- argumentsList << "--symlink" +- << "/usr/sbin" +- << "/sbin"; ++ argumentsList << "--bind" ++ << "/nix/store" ++ << "/nix/store"; + argumentsList << "--tmpfs" + << "/tmp"; + +-- +2.46.1 + diff --git a/pkgs/by-name/pr/project-lemonlime/package.nix b/pkgs/by-name/pr/project-lemonlime/package.nix index c49682b64116..f29a7c671e37 100644 --- a/pkgs/by-name/pr/project-lemonlime/package.nix +++ b/pkgs/by-name/pr/project-lemonlime/package.nix @@ -5,6 +5,9 @@ cmake, qt6, nix-update-script, + bubblewrap, + bash, + diffutils, }: stdenv.mkDerivation (finalAttrs: { @@ -24,6 +27,19 @@ stdenv.mkDerivation (finalAttrs: { qt6.wrapQtAppsHook ]; + patches = [ + ./0001-Bind-Nix-Store.patch + ]; + + postPatch = '' + substituteInPlace src/core/judgingthread.cpp \ + --replace-fail "/usr/bin/bwrap" "${lib.getExe bubblewrap}" + substituteInPlace unix/watcher_unix.cpp \ + --replace-fail "bash" "${lib.getExe bash}" + substituteInPlace src/base/settings.cpp \ + --replace-fail "/usr/bin/diff" "${diffutils}/bin/diff" + ''; + cmakeFlags = [ (lib.cmakeBool "LEMON_QT6" true) ];