summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules/CC/EXPRESSIONS13
-rw-r--r--rules/CC/RULES4
-rw-r--r--rules/CC/foreign/cmake/EXPRESSIONS7
-rw-r--r--rules/CC/foreign/cmake/RULES15
4 files changed, 33 insertions, 6 deletions
diff --git a/rules/CC/EXPRESSIONS b/rules/CC/EXPRESSIONS
index d7289c9..e97ed76 100644
--- a/rules/CC/EXPRESSIONS
+++ b/rules/CC/EXPRESSIONS
@@ -1710,7 +1710,7 @@
}
}
}
-, "install-with-deps result":
+, "install-with-deps stage":
{ "vars": ["pc-install-dir", "targets", "prefix", "flat-libs", "hdrs-only"]
, "imports":
{ "compile-deps": "compile-deps"
@@ -1932,8 +1932,15 @@
}
]
]
- , "body":
- {"type": "RESULT", "artifacts": {"type": "var", "name": "install-stage"}}
+ , "body": {"type": "var", "name": "install-stage"}
+ }
+ }
+, "install-with-deps result":
+ { "vars": ["pc-install-dir", "targets", "prefix", "flat-libs", "hdrs-only"]
+ , "imports": {"install stage": "install-with-deps stage"}
+ , "expression":
+ { "type": "RESULT"
+ , "artifacts": {"type": "CALL_EXPRESSION", "name": "install stage"}
}
}
}
diff --git a/rules/CC/RULES b/rules/CC/RULES
index d2aeece..96d1db4 100644
--- a/rules/CC/RULES
+++ b/rules/CC/RULES
@@ -790,7 +790,7 @@
[ "Install target's artifacts with transitive dependencies. Depending on"
, "the target, artifacts and dependencies will be installed to"
, "subdirectories \"bin\", \"include\", and \"lib\". For library targets,"
- , "a pkg-config file is generated and provided in \"share/pkgconfig\"."
+ , "a pkg-config file is generated and provided in \"lib/pkgconfig\"."
]
, "config_vars": ["PREFIX"]
, "target_fields": ["targets"]
@@ -823,7 +823,7 @@
, "expression":
{ "type": "let*"
, "bindings":
- [ ["pc-install-dir", "share/pkgconfig"]
+ [ ["pc-install-dir", "lib/pkgconfig"]
, ["targets", {"type": "FIELD", "name": "targets"}]
, [ "prefix"
, { "type": "if"
diff --git a/rules/CC/foreign/cmake/EXPRESSIONS b/rules/CC/foreign/cmake/EXPRESSIONS
index 4c21f4b..88dd8a1 100644
--- a/rules/CC/foreign/cmake/EXPRESSIONS
+++ b/rules/CC/foreign/cmake/EXPRESSIONS
@@ -2,6 +2,7 @@
{ "vars":
[ "source_dir"
, "cmake_subdir"
+ , "localbase_dir"
, "cmake_options"
, "cmake_defines"
, "cmake_jobs"
@@ -180,7 +181,7 @@
, [ "readonly CMAKE_SUBDIR=\"$1\""
, "readonly CMAKE_AR=$(which $2)"
, "shift 2"
- , "cmake \"$@\" -S\"source/${CMAKE_SUBDIR}\" -Bbuild -DCMAKE_AR=${CMAKE_AR} -DCMAKE_INSTALL_PREFIX=./install >configure.log 2>&1 || (cat configure.log && exit 1)"
+ , "cmake \"$@\" -S\"source/${CMAKE_SUBDIR}\" -Bbuild -DCMAKE_AR=${CMAKE_AR} -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_PREFIX_PATH=\"$(pwd)/localbase\" -DPKG_CONFIG_ARGN=--define-prefix --no-warn-unused-cli >configure.log 2>&1 || (cat configure.log && exit 1)"
]
, [ { "type": "join"
, "separator": " "
@@ -225,6 +226,10 @@
, "$1":
[ {"type": "var", "name": "TOOLCHAIN"}
, {"type": "var", "name": "source_dir"}
+ , { "type": "var"
+ , "name": "localbase_dir"
+ , "default": {"type": "empty_map"}
+ }
, {"type": "var", "name": "script"}
]
}
diff --git a/rules/CC/foreign/cmake/RULES b/rules/CC/foreign/cmake/RULES
index a53b92e..4622357 100644
--- a/rules/CC/foreign/cmake/RULES
+++ b/rules/CC/foreign/cmake/RULES
@@ -406,6 +406,7 @@
, "cmake-build": "cmake-build"
, "strip-prefix": ["./", "..", "strip-prefix"]
, "prebuilt result": ["CC/prebuilt", "prebuilt result"]
+ , "install-deps": ["CC", "install-with-deps stage"]
}
, "expression":
{ "type": "let*"
@@ -464,6 +465,20 @@
, "body": {"type": "CALL_EXPRESSION", "name": "stage_field"}
}
]
+ , [ "localbase_dir"
+ , { "type": "to_subdir"
+ , "subdir": "localbase"
+ , "msg": "dependency installation files may not overlap"
+ , "$1":
+ { "type": "let*"
+ , "bindings":
+ [ ["pc-install-dir", "lib/pkgconfig"]
+ , ["targets", {"type": "FIELD", "name": "deps"}]
+ ]
+ , "body": {"type": "CALL_EXPRESSION", "name": "install-deps"}
+ }
+ }
+ ]
, [ "installed_dirs"
, { "type": "foreach"
, "var": "dir_path"