cmake: remove propagatedBuildInput ps and patch to use an abspath
This would be an approprate patch on all platforms, but it seems to trigger infinite recursion.
This commit is contained in:
committed by
Alyssa Ross
parent
11f90585cd
commit
ffb781820b
@@ -0,0 +1,41 @@
|
||||
diff -ur a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
|
||||
--- a/Source/kwsys/ProcessUNIX.c 2024-04-11 07:12:19.000000000 -0700
|
||||
+++ b/Source/kwsys/ProcessUNIX.c 2024-05-15 10:41:00.286160616 -0700
|
||||
@@ -2501,20 +2501,20 @@
|
||||
have two integers to store: the pid and then the ppid. */
|
||||
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
|
||||
defined(__OpenBSD__) || defined(__GLIBC__) || defined(__GNU__)
|
||||
-# define KWSYSPE_PS_COMMAND "ps axo pid,ppid"
|
||||
+# define KWSYSPE_PS_COMMAND "@ps@ axo pid,ppid"
|
||||
# define KWSYSPE_PS_FORMAT "%d %d\n"
|
||||
#elif defined(__sun) && (defined(__SVR4) || defined(__svr4__)) /* Solaris */
|
||||
-# define KWSYSPE_PS_COMMAND "ps -e -o pid,ppid"
|
||||
+# define KWSYSPE_PS_COMMAND "@ps@ -e -o pid,ppid"
|
||||
# define KWSYSPE_PS_FORMAT "%d %d\n"
|
||||
#elif defined(__hpux) || defined(__sun__) || defined(__sgi) || \
|
||||
defined(_AIX) || defined(__sparc)
|
||||
-# define KWSYSPE_PS_COMMAND "ps -ef"
|
||||
+# define KWSYSPE_PS_COMMAND "@ps@ -ef"
|
||||
# define KWSYSPE_PS_FORMAT "%*s %d %d %*[^\n]\n"
|
||||
#elif defined(__QNX__)
|
||||
-# define KWSYSPE_PS_COMMAND "ps -Af"
|
||||
+# define KWSYSPE_PS_COMMAND "@ps@ -Af"
|
||||
# define KWSYSPE_PS_FORMAT "%*d %d %d %*[^\n]\n"
|
||||
#elif defined(__CYGWIN__)
|
||||
-# define KWSYSPE_PS_COMMAND "ps aux"
|
||||
+# define KWSYSPE_PS_COMMAND "@ps@ aux"
|
||||
# define KWSYSPE_PS_FORMAT "%d %d %*[^\n]\n"
|
||||
#endif
|
||||
|
||||
diff -ur a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
|
||||
--- a/Source/kwsys/SystemInformation.cxx 2024-04-11 07:12:19.000000000 -0700
|
||||
+++ b/Source/kwsys/SystemInformation.cxx 2024-05-15 10:40:00.901059278 -0700
|
||||
@@ -3884,7 +3884,7 @@
|
||||
long long memUsed = 0;
|
||||
pid_t pid = getpid();
|
||||
std::ostringstream oss;
|
||||
- oss << "ps -o rss= -p " << pid;
|
||||
+ oss << "@ps@ -o rss= -p " << pid;
|
||||
FILE* file = popen(oss.str().c_str(), "r");
|
||||
if (file == nullptr) {
|
||||
return -1;
|
||||
@@ -1,6 +1,7 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, substituteAll
|
||||
, buildPackages
|
||||
, bzip2
|
||||
, curlMinimal
|
||||
@@ -66,7 +67,13 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# Derived from https://github.com/curl/curl/commit/31f631a142d855f069242f3e0c643beec25d1b51
|
||||
++ lib.optional (stdenv.isDarwin && isMinimalBuild) ./005-remove-systemconfiguration-dep.diff
|
||||
# On Darwin, always set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG.
|
||||
++ lib.optional stdenv.isDarwin ./006-darwin-always-set-runtime-c-flag.diff;
|
||||
++ lib.optional stdenv.isDarwin ./006-darwin-always-set-runtime-c-flag.diff
|
||||
# On platforms where ps is not part of stdenv, patch the invocation of ps to use an absolute path.
|
||||
++ lib.optional (stdenv.isDarwin || stdenv.isFreeBSD) (
|
||||
substituteAll {
|
||||
src = ./007-darwin-bsd-ps-abspath.diff;
|
||||
ps = lib.getExe ps;
|
||||
});
|
||||
|
||||
outputs = [ "out" ] ++ lib.optionals buildDocs [ "man" "info" ];
|
||||
separateDebugInfo = true;
|
||||
@@ -101,8 +108,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
++ lib.optional stdenv.isDarwin CoreServices
|
||||
++ lib.optional (stdenv.isDarwin && !isMinimalBuild) SystemConfiguration;
|
||||
|
||||
propagatedBuildInputs = lib.optional (stdenv.isDarwin || stdenv.isFreeBSD) ps;
|
||||
|
||||
preConfigure = ''
|
||||
fixCmakeFiles .
|
||||
substituteInPlace Modules/Platform/UnixPaths.cmake \
|
||||
|
||||
Reference in New Issue
Block a user