diff --git a/recipe/build.sh b/recipe/build.sh index 228a8fd4..feeae574 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -13,7 +13,5 @@ make -j 4 prefix=${PREFIX} MARCH=core2 sysconfigdir=${PREFIX}/etc NO_GIT=1 \ TAGGED_RELEASE_BANNER="conda-forge-julia release" \ install -mv "$PREFIX/bin/julia" "$PREFIX/bin/julia_" -cp "$RECIPE_DIR/julia-wrapper.sh" "$PREFIX/bin/julia" -chmod +x "$PREFIX/bin/julia" - +# Configure juliarc to use conda environment +cat "${RECIPE_DIR}/juliarc.jl" >> "${PREFIX}/etc/julia/juliarc.jl" diff --git a/recipe/julia-wrapper.sh b/recipe/julia-wrapper.sh deleted file mode 100644 index a7bf6dc2..00000000 --- a/recipe/julia-wrapper.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -JULIA_HOME="$(dirname "${BASH_SOURCE[0]}")" - -# Set JULIA_PKGDIR to $PREFIX/share/julia/site to avoid contaminating -# user's ~/.julia/. This script will modify Pkg.dir() and -# Base.LOAD_CACHE_PATH[1] appropriately. Note that wrapper script is -# used rather than /etc/julia/juliarc.jl because LOAD_CACHE_PATH is -# configured in base/sysimg.jl which is loaded before juliarc.jl. -if [ -z ${JULIA_PKGDIR+x} ] # see: http://stackoverflow.com/a/13864829 -then - JULIA_PKGDIR="$(dirname "$JULIA_HOME")/share/julia/site" - export JULIA_PKGDIR -fi - -# Set JULIA_HISTORY to $PREFIX/.julia_history to avoid saving -# to user's $HOME -if [ -z ${JULIA_HISTORY+x} ] -then - JULIA_HISTORY="$(dirname "$JULIA_HOME")/.julia_history" - export JULIA_HISTORY -fi - -exec "$JULIA_HOME/julia_" "$@" diff --git a/recipe/juliarc.jl b/recipe/juliarc.jl new file mode 100644 index 00000000..544d7d45 --- /dev/null +++ b/recipe/juliarc.jl @@ -0,0 +1,6 @@ +JULIA_PREFIX = abspath(joinpath(Base.source_path(), "..", "..", "..")) + +if !("JULIA_PKGDIR" in keys(ENV)) + ENV["JULIA_PKGDIR"] = joinpath(JULIA_PREFIX, "share", "julia", "site") + Base.LOAD_CACHE_PATH[1] = joinpath(ENV["JULIA_PKGDIR"], "lib", string("v", join(split(string(VERSION), ".")[1:2], "."))) +end diff --git a/recipe/meta.yaml b/recipe/meta.yaml index eccbe4f0..c112f97e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -14,7 +14,7 @@ source: build: skip: True # [osx or win] - number: 0 + number: 1 features: - blas_{{ variant }} diff --git a/recipe/post-link.sh b/recipe/post-link.sh new file mode 100644 index 00000000..af4ccb64 --- /dev/null +++ b/recipe/post-link.sh @@ -0,0 +1 @@ +julia -e 'Pkg.init()'