@@ -13,12 +13,8 @@ import { pkg_exists, step_title, get_source_root } from "./common.ab"
1313///
1414/// ### Arguments:
1515/// - `lib_name`: The library to check for with `pkg-config`
16- /// - `var_name`: The variable to export library locations
17- /// - `lib_prefix`: Where in the source tree the resulting libraries are found
1816/// - `inc_prefix`: Where in the source tree the build headers are found
19- pub fun build_autoconf_dep(lib_name: Text, var_name: Text,
20- lib_prefix: Text = "",
21- inc_prefix: Text = ""): Null?
17+ pub fun build_autoconf_dep(lib_name: Text, inc_prefix: Text = ""): Null?
2218{
2319 let source_root = get_source_root()
2420 let cache_root = get_cache_root()
@@ -32,34 +28,25 @@ pub fun build_autoconf_dep(lib_name: Text, var_name: Text,
3228
3329 pull_source_file(lib_name, my_source)?
3430
35- $(unset C_INCLUDE_PATH CPLUS_INCLUDE_PATH && cd {my_source} && ./configure && make)$?
36-
37- $cp {my_source}/{lib_prefix}/.libs/* {cache_root}/nix-lib/$?
38- trust $rm {cache_root}/nix-lib/*.o$
39-
40- trust env_var_set("{var_name}_LIBS", "{cache_root}/nix-lib")
41- trust env_var_set("{var_name}_CFLAGS", "-I{my_source}/{inc_prefix}/include")
42- trust $export {var_name}_LIBS {var_name}_CFLAGS$
43-
44- trust $export C_INCLUDE_PATH={my_source}/{inc_prefix}:\$C_INCLUDE_PATH$
45- trust $export CPLUS_INCLUDE_PATH={my_source}/{inc_prefix}:\$CPLUS_INCLUDE_PATH$
31+ $( unset C_INCLUDE_PATH CPLUS_INCLUDE_PATH \
32+ && cd {my_source} \
33+ && ./configure --prefix={cache_root}/nix-deps \
34+ && make && make install )$?
4635}
4736
4837main(cmdl)
4938{
5039 if len(cmdl) < 5 {
51- echo "Usage: ./autoconf.sh <package> <var_name> <lib_prefix> < inc_prefix>"
40+ echo "Usage: ./autoconf.sh <package> <inc_prefix>"
5241 echo ""
5342 echo "See builders/autoconf.ab and builders.ab for more info"
5443 exit 1
5544 }
5645
5746 let lib_name = cmdl[1]
58- let var_name = cmdl[2]
59- let lib_prefix = cmdl[3]
60- let inc_prefix = cmdl[4]
47+ let inc_prefix = cmdl[2]
6148
6249 trust env_var_set("_NIXIE_TESTING_SKIP_TARBALL", "1")
6350 trust env_var_set("step_total", "1")
64- build_autoconf_dep(lib_name, var_name, lib_prefix, inc_prefix)?
51+ build_autoconf_dep(lib_name, inc_prefix)?
6552}
0 commit comments