nickva commented on code in PR #5626:
URL: https://github.com/apache/couchdb/pull/5626#discussion_r2342144099


##########
src/couch/rebar.config.script:
##########
@@ -151,6 +151,25 @@ ProperConfig = case code:lib_dir(proper) of
     _ -> [{d, 'WITH_PROPER'}]
 end.
 
+DpkgArchitectureCmd = "dpkg-architecture -q DEB_HOST_MULTIARCH".
+GenericMozJSIncludePaths = "-I/usr/include/mozjs-" ++ SMVsn ++ " 
-I/usr/local/include/mozjs-" ++ SMVsn.
+GenericMozJSLibPaths = "-L/usr/local/lib -L/opt/homebrew/lib".
+
+WithDpkgArchitecture = case os:find_executable("dpkg-architecture") of
+    false -> false;
+    _ -> true
+end.
+
+MozJSIncludePath = case WithDpkgArchitecture of
+    false -> GenericMozJSIncludePaths;
+    true -> GenericMozJSIncludePaths ++ " -I/usr/include/" ++ 
string:strip(os:cmd(DpkgArchitectureCmd), right, $\n) ++ "/mozjs-" ++ SMVsn

Review Comment:
   strip is deprecated, use string:trim instead
   
   ```
   string:trim("\n foo \t \n") -> "foo"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to