-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
113 additions
and
22,446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,5 @@ cran-comments.md | |
^src/.*\.a$ | ||
^docker$ | ||
.github | ||
|
||
$src/Makevars$ | ||
^cran-comments\.md$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ jq-*.tar.gz | |
jqr_*.tar.gz | ||
notes.md | ||
src/*.dll | ||
src/Makevars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/bash | ||
# Anticonf (tm) script by Jeroen Ooms (2016) | ||
# This script will query 'pkg-config' for the required cflags and ldflags. | ||
# If pkg-config is unavailable or does not find the library, try setting | ||
# INCLUDE_DIR and LIB_DIR manually via e.g: | ||
# R CMD INSTALL --configure-vars='INCLUDE_DIR=/.../include LIB_DIR=/.../lib' | ||
|
||
# Library settings | ||
PKG_CONFIG_NAME="jq" | ||
PKG_DEB_NAME="libjq-dev" | ||
PKG_RPM_NAME="jq-devel" | ||
PKG_CSW_NAME="libjq_dev" | ||
PKG_BREW_NAME="jq" | ||
PKG_TEST_HEADER="<jq.h>" | ||
PKG_LIBS="-ljq" | ||
PKG_LIBS_STATIC="-ljq -lonig" | ||
PKG_CFLAGS="" | ||
|
||
# Use pkg-config if available | ||
if [ $(command -v pkg-config) ]; then | ||
PKGCONFIG_CFLAGS=$(pkg-config --cflags --silence-errors ${PKG_CONFIG_NAME}) | ||
PKGCONFIG_LIBS=$(pkg-config --libs ${PKG_CONFIG_NAME}) | ||
fi | ||
|
||
# Note that cflags may be empty in case of success | ||
if [ "$INCLUDE_DIR" ] || [ "$LIB_DIR" ]; then | ||
echo "Found INCLUDE_DIR and/or LIB_DIR!" | ||
PKG_CFLAGS="-I$INCLUDE_DIR $PKG_CFLAGS" | ||
PKG_LIBS="-L$LIB_DIR $PKG_LIBS" | ||
elif [ "$PKGCONFIG_CFLAGS" ] || [ "$PKGCONFIG_LIBS" ]; then | ||
echo "Found pkg-config cflags and libs!" | ||
PKG_CFLAGS=${PKGCONFIG_CFLAGS} | ||
PKG_LIBS=${PKGCONFIG_LIBS} | ||
elif [[ "$OSTYPE" == "darwin"* ]]; then | ||
if [ $(command -v brew) ]; then | ||
BREWDIR=$(brew --prefix) | ||
else | ||
echo "Auto-brewing $PKG_BREW_NAME..." | ||
BREWDIR="/tmp/homebrew" | ||
rm -Rf $BREWDIR | ||
mkdir -p $BREWDIR | ||
curl -fsSL https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C $BREWDIR | ||
HOMEBREW_CACHE="/tmp" $BREWDIR/bin/brew install $PKG_BREW_NAME 2>&1 | perl -pe 's/Warning/Note/gi' | ||
rm -f $BREWDIR/lib/*.dylib | ||
fi | ||
PKG_CFLAGS="-I$BREWDIR/opt/$PKG_BREW_NAME/include" | ||
PKG_LIBS="-L$BREWDIR/lib $PKG_LIBS_STATIC" | ||
fi | ||
|
||
# For debugging | ||
echo "Using PKG_CFLAGS=$PKG_CFLAGS" | ||
echo "Using PKG_LIBS=$PKG_LIBS" | ||
|
||
# Find compiler | ||
CC=$(${R_HOME}/bin/R CMD config CC) | ||
CFLAGS=$(${R_HOME}/bin/R CMD config CFLAGS) | ||
CPPFLAGS=$(${R_HOME}/bin/R CMD config CPPFLAGS) | ||
|
||
# Test configuration | ||
echo "#include $PKG_TEST_HEADER" | ${CC} ${CPPFLAGS} ${PKG_CFLAGS} ${CFLAGS} -E -xc - >/dev/null 2>&1 || R_CONFIG_ERROR=1; | ||
|
||
# Customize the error | ||
if [ $R_CONFIG_ERROR ]; then | ||
echo "------------------------- ANTICONF ERROR ---------------------------" | ||
echo "Configuration failed because $PKG_CONFIG_NAME was not found. Try installing:" | ||
echo " * deb: $PKG_DEB_NAME (Debian, Ubuntu, etc)" | ||
echo " * rpm: $PKG_RPM_NAME (Fedora, EPEL)" | ||
echo " * csw: $PKG_CSW_NAME (Solaris)" | ||
echo " * brew: $PKG_BREW_NAME (OSX)" | ||
echo "If $PKG_CONFIG_NAME is already installed, check that 'pkg-config' is in your" | ||
echo "PATH and PKG_CONFIG_PATH contains a $PKG_CONFIG_NAME.pc file. If pkg-config" | ||
echo "is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:" | ||
echo "R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'" | ||
echo "--------------------------------------------------------------------" | ||
exit 1; | ||
fi | ||
|
||
# Write to Makevars | ||
sed -e "s|@cflags@|$PKG_CFLAGS|" -e "s|@libs@|$PKG_LIBS|" src/Makevars.in > src/Makevars | ||
|
||
# Success | ||
exit 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PKG_CPPFLAGS=@cflags@ | ||
PKG_LIBS=@libs@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
PKG_CPPFLAGS = -I../windows/jq-1.5/include | ||
PKG_LIBS = -L../windows/jq-1.5/lib${R_ARCH} -ljq -lonig -lshlwapi | ||
|
||
all: clean winlibs | ||
|
||
winlibs: | ||
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" | ||
|
||
clean: | ||
rm -f $(OBJECTS) jqr.dll | ||
|
||
.PHONY: all clean winlibs |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.