Skip to content

Commit

Permalink
Moving things out autoconf
Browse files Browse the repository at this point in the history
  • Loading branch information
gvegayon committed Oct 17, 2023
1 parent f2394d9 commit ea8b883
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ docker-debug:
--no-docs --build .

install-dev: clean
sed -i -E 's/^useDynLib\([a-zA-Z]+/useDynLib(epiworldRdev/g' NAMESPACE
sed -i -E 's/^Package:.+/Package: epiworldRdev/g' DESCRIPTION
sed -i -E 's/^\\(name|alias|title)\{[a-zA-Z]+/\\\1{epiworldRdev/g' man/epiworldR-package.Rd
sed -i -E 's/^library\([a-zA-Z]+\)/library(epiworldRdev)/g' README.*
EPI_DEV=yes R CMD INSTALL .
$(MAKE) clean

install: clean
sed -i -E 's/^Package:.+/Package: epiworldR/g' DESCRIPTION
sed -i -E 's/^library\([a-zA-Z]+\)/library(epiworldR)/g' README.*
R CMD INSTALL .


Expand All @@ -36,6 +37,12 @@ check: build

clean:
Rscript --vanilla -e 'devtools::clean_dll()'
sed -i -E 's/^useDynLib\([a-zA-Z]+/useDynLib(epiworldR/g' NAMESPACE
sed -i -E 's/^Package:.+/Package: epiworldR/g' DESCRIPTION
sed -i -E 's/^\\(name|alias|title)\{[a-zA-Z]+/\\\1{epiworldR/g' man/epiworldR-package.Rd
sed -i -E 's/^\\(name|alias|title)\{[a-zA-Z]+/\\\1{epiworldR/g' R/epiworldR-package.Rd

sed -i -E 's/^library\([a-zA-Z]+\)/library(epiworldR)/g' README.*

docs:
Rscript --vanilla -e 'devtools::document()'
Expand Down
11 changes: 0 additions & 11 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3385,11 +3385,6 @@ ac_config_files="$ac_config_files src/Makevars R/epiworldR-package.R"
# Use sed to replace the line useDynLib\([a-zA-Z]+ in the NAMESPACE
# file with useDynLib(${epiworldname}
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
Expand Down Expand Up @@ -4515,12 +4510,6 @@ ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
sed -i -E 's/^useDynLib\([a-zA-Z]+/useDynLib('"${epiworldname}"'/g' NAMESPACE
sed -i -E 's/^Package:.+/Package: '"${epiworldname}"'/g' DESCRIPTION
sed -i -E 's/^\\(name|alias|title)\{[a-zA-Z]+/\\\1{'"${epiworldname}"'/g' man/epiworldR-package.Rd
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
Expand Down
11 changes: 0 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,5 @@ AC_CONFIG_FILES([src/Makevars R/epiworldR-package.R])

# Use sed to replace the line useDynLib\([a-zA-Z]+ in the NAMESPACE
# file with useDynLib(${epiworldname}
AC_CONFIG_COMMANDS_POST(
[sed -i -E 's/^useDynLib\([[a-zA-Z]]+/useDynLib('"${epiworldname}"'/g' NAMESPACE]
)

AC_CONFIG_COMMANDS_POST(
[sed -i -E 's/^Package:.+/Package: '"${epiworldname}"'/g' DESCRIPTION]
)

AC_CONFIG_COMMANDS_POST(
[sed -i -E 's/^\\(name|alias|title)\{[[a-zA-Z]]+/\\\1{'"${epiworldname}"'/g' man/epiworldR-package.Rd]
)

AC_OUTPUT

0 comments on commit ea8b883

Please sign in to comment.