Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JGO_CACHE_DIR to specify cache dir within conda env #4

Merged
merged 1 commit into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions recipe/activate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@set "JGO_CACHE_DIR_CONDA_BACKUP=%JGO_CACHE_DIR%"
@set "JGO_CACHE_DIR=%CONDA_PREFIX%\jgo"
2 changes: 2 additions & 0 deletions recipe/activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export JGO_CACHE_DIR_CONDA_BACKUP="${JGO_CACHE_DIR}"
export JGO_CACHE_DIR="${CONDA_PREFIX}/jgo"
7 changes: 7 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"%PYTHON%" -m pip install . -vvv

FOR %%F IN (activate deactivate) DO (
IF NOT EXIST %PREFIX%\etc\conda\%%F.d MKDIR %PREFIX%\etc\conda\%%F.d
COPY %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
)

7 changes: 7 additions & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"${PYTHON}" -m pip install . -vvv

for CHANGE in "activate" "deactivate"
do
mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
cp "${RECIPE_DIR}/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
done
2 changes: 2 additions & 0 deletions recipe/deactivate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@set "JGO_CACHE_DIR=%JGO_CACHE_DIR_CONDA_BACKUP%"
@set "JGO_CACHE_DIR_CONDA_BACKUP="
6 changes: 6 additions & 0 deletions recipe/deactivate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export JGO_CACHE_DIR="${JGO_CACHE_DIR_CONDA_BACKUP}"
unset JGO_CACHE_DIR_CONDA_BACKUP

if [ -z "${JGO_CACHE_DIR}" ]; then
unset JGO_CACHE_DIR
fi
13 changes: 9 additions & 4 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{% set name = "jgo" %}
{% set version = "0.1.0" %}
{% set version = "0.2.0" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 880d880badc2b3ec88ed15f063be3fe12c83eec5c951b743b182b66d81977188
sha256: 440d23946d5d91b9855b8329373a7b2b66d77231486cbb82542aed7177122a40

build:
number: 1000
script: "{{ PYTHON }} -m pip install . -vvv"
skip: True # [py2k]

requirements:
Expand All @@ -22,14 +21,20 @@ requirements:
- python

test:
requires:
- openjdk
- maven
imports:
- jgo
commands:
- test "${JGO_CACHE_DIR}" = "${CONDA_PREFIX}/jgo" # [unix]
- if not "%JGO_CACHE_DIR%" == "%CONDA_PREFIX%\jgo" exit 1 # [win]

about:
home: https://github.com/scijava/jgo
license: PUBLIC-DOMAIN
license_family: PUBLIC-DOMAIN
summary: 'Launch Java code from the CLI, installation-free. '
summary: 'Launch Java code from the CLI, installation-free.'
doc_url: https://github.com/scijava/jgo
dev_url: https://github.com/scijava/jgo

Expand Down