From 6d1b1e666f9dad062684371453699569aa497cae Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 12 Sep 2017 18:17:46 -0700 Subject: [PATCH] Remove wrapper script (#11) * Removed wrapper script * Bumped build number * Use juliarc (#1) * Add a custom juliarc.jl Needed to ensure packages and other relevant information to the Julia install are tracked in the conda environment. * Install custom juliarc Make sure that that our custom juliarc is available in the standard location. * Create the package directory Make sure that Julia initializes our package directory and includes the standard packages in it. * Bump build number to 1 Needed to repackage after removal of the wrapper script, inclusion of juliarc, and inclusion of the prepopulated package directory. * Removed JULIA_HISTORY setting * Drop package initialization (#2) This does not work correctly as `conda-build` strips out the `.git` directory from `METADATA`. There are no clean fixes for this issue. As we already try to initialize the package directory when Julia starts, this will be handled anyways on the user's machine. In the end, this may be best to avoid having a potentially out-of-date index in the package. * Append juliarc.jl instead of replace * Append juliarc.jl the right way * Added post-link script for Pkg.init() * Removed Pkg.init() from juliarc.jl * Correct setting Base.LOAD_CACHE_PATH * Correct setting Base.LOAD_CACHE_PATH again (cherry picked from commit 19d96fa559582c8162f92896a3047c268a397c58) --- recipe/build.sh | 6 ++---- recipe/julia-wrapper.sh | 24 ------------------------ recipe/juliarc.jl | 6 ++++++ recipe/meta.yaml | 2 +- recipe/post-link.sh | 1 + 5 files changed, 10 insertions(+), 29 deletions(-) delete mode 100644 recipe/julia-wrapper.sh create mode 100644 recipe/juliarc.jl create mode 100644 recipe/post-link.sh 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()'