Skip to content

Commit

Permalink
Merge pull request #34 from hadim/java9
Browse files Browse the repository at this point in the history
Java 9
  • Loading branch information
sodre authored Nov 22, 2018
2 parents b5969d5 + fd659a4 commit f16da87
Show file tree
Hide file tree
Showing 17 changed files with 133 additions and 103 deletions.
6 changes: 3 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ platform:
install:
# If there is a newer build queued for the same PR, cancel this one.
- cmd: |
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/conda-forge/conda-forge-ci-setup-feedstock/master/recipe/ff_ci_pr_build.py', 'ff_ci_pr_build.py')"
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/conda-forge/conda-forge-ci-setup-feedstock/branch2.0/recipe/conda_forge_ci_setup/ff_ci_pr_build.py', 'ff_ci_pr_build.py')"
ff_ci_pr_build -v --ci "appveyor" "%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%" "%APPVEYOR_BUILD_NUMBER%" "%APPVEYOR_PULL_REQUEST_NUMBER%"
del ff_ci_pr_build.py
Expand All @@ -41,7 +41,7 @@ install:
- cmd: conda.exe config --add channels conda-forge

# Configure the VM.
- cmd: conda.exe install -n root --quiet --yes conda-forge-ci-setup=1
- cmd: conda.exe install -n root --quiet --yes conda-forge-ci-setup=2
- cmd: run_conda_forge_build_setup

# Skip .NET project specific build phase.
Expand All @@ -50,4 +50,4 @@ build: off
test_script:
- conda.exe build recipe -m .ci_support\%CONFIG%.yaml --quiet
deploy_script:
- cmd: upload_or_check_non_existence .\recipe conda-forge --channel=main -m .ci_support\%CONFIG%.yaml
- cmd: upload_package .\ .\recipe .ci_support\%CONFIG%.yaml
8 changes: 8 additions & 0 deletions .ci_support/linux_.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
build_number_decrement:
- '0'
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
curl:
- '7.59'
docker_image:
- condaforge/linux-anvil
pin_run_as_build:
curl:
max_pin: x
8 changes: 8 additions & 0 deletions .ci_support/osx_.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
MACOSX_DEPLOYMENT_TARGET:
- '10.9'
build_number_decrement:
- '0'
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
curl:
- '7.59'
docker_image:
- condaforge/linux-anvil
macos_machine:
- x86_64-apple-darwin13.4.0
macos_min_version:
Expand Down
4 changes: 4 additions & 0 deletions .ci_support/win_.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
curl:
- '7.59'
pin_run_as_build:
Expand Down
25 changes: 16 additions & 9 deletions .circleci/build_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,34 @@

set -xeuo pipefail
export PYTHONUNBUFFERED=1
export FEEDSTOCK_ROOT=/home/conda/feedstock_root
export RECIPE_ROOT=/home/conda/recipe_root
export CI_SUPPORT=/home/conda/feedstock_root/.ci_support
export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml"

cat >~/.condarc <<CONDARC
channels:
- conda-forge
- defaults
conda-build:
root-dir: /home/conda/feedstock_root/build_artifacts
show_channel_urls: true
CONDARC

conda install --yes --quiet conda-forge::conda-forge-ci-setup=2 conda-build

# set up the condarc
setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}"

# A lock sometimes occurs with incomplete builds. The lock file is stored in build_artifacts.
conda clean --lock

conda install --yes --quiet conda-forge-ci-setup=1 conda-build
source run_conda_forge_build_setup

conda build /home/conda/recipe_root -m /home/conda/feedstock_root/.ci_support/${CONFIG}.yaml --quiet
upload_or_check_non_existence /home/conda/recipe_root conda-forge --channel=main -m /home/conda/feedstock_root/.ci_support/${CONFIG}.yaml
# make the build number clobber
make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}"

conda build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \
--clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" --quiet

upload_package "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}"

touch "/home/conda/feedstock_root/build_artifacts/conda-forge-build-done-${CONFIG}"
2 changes: 1 addition & 1 deletion .circleci/fast_finish_ci_pr_build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

curl https://raw.githubusercontent.com/conda-forge/conda-forge-ci-setup-feedstock/master/recipe/ff_ci_pr_build.py | \
curl https://raw.githubusercontent.com/conda-forge/conda-forge-ci-setup-feedstock/branch2.0/recipe/conda_forge_ci_setup/ff_ci_pr_build.py | \
python - -v --ci "circle" "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" "${CIRCLE_BUILD_NUM}" "${CIRCLE_PR_NUMBER}"
7 changes: 5 additions & 2 deletions .circleci/run_docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
set -xeuo pipefail

FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;)
RECIPE_ROOT=$FEEDSTOCK_ROOT/recipe
RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe"

docker info

Expand All @@ -29,6 +29,9 @@ if [ -z "$CONFIG" ]; then
exit 1
fi

pip install shyaml
DOCKER_IMAGE=$(cat "${FEEDSTOCK_ROOT}/.ci_support/${CONFIG}.yaml" | shyaml get-value docker_image.0 condaforge/linux-anvil )

mkdir -p "$ARTIFACTS"
DONE_CANARY="$ARTIFACTS/conda-forge-build-done-${CONFIG}"
rm -f "$DONE_CANARY"
Expand All @@ -39,7 +42,7 @@ docker run -it \
-e CONFIG \
-e BINSTAR_TOKEN \
-e HOST_USER_ID \
condaforge/linux-anvil \
$DOCKER_IMAGE \
bash \
/home/conda/feedstock_root/.circleci/build_steps.sh

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Checklist
* [ ] Used a fork of the feedstock to propose changes
* [ ] Bumped the build number (if the version is unchanged)
* [ ] Reset the build number to `0` (if the version changed)
* [ ] [Re-rendered]( https://conda-forge.org/docs/conda_smithy.html#how-to-re-render ) with the latest `conda-smithy`
* [ ] [Re-rendered]( https://conda-forge.org/docs/conda_smithy.html#how-to-re-render ) with the latest `conda-smithy` (Use the phrase <code>@<space/>conda-forge-admin, please rerender</code> in a comment in this PR for automated rerendering)
* [ ] Ensured the license file is being packaged.

<!--
Expand Down
22 changes: 13 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
before_install:
# Fast finish the PR.
- |
(curl https://raw.githubusercontent.com/conda-forge/conda-forge-ci-setup-feedstock/master/recipe/ff_ci_pr_build.py | \
(curl https://raw.githubusercontent.com/conda-forge/conda-forge-ci-setup-feedstock/branch2.0/recipe/conda_forge_ci_setup/ff_ci_pr_build.py | \
python - -v --ci "travis" "${TRAVIS_REPO_SLUG}" "${TRAVIS_BUILD_NUMBER}" "${TRAVIS_PULL_REQUEST}") || exit 1
# Remove homebrew.
Expand Down Expand Up @@ -46,14 +46,18 @@ install:
echo ""
echo "Configuring conda."
source /Users/travis/miniconda3/bin/activate root
conda config --remove channels defaults
conda config --add channels defaults
conda config --add channels conda-forge
conda config --set show_channel_urls true
conda install --yes --quiet conda-forge-ci-setup=1
conda install --yes --quiet conda-forge::conda-forge-ci-setup=2
setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml
source run_conda_forge_build_setup
script:
- conda build ./recipe -m ./.ci_support/${CONFIG}.yaml
# compiler cleanup
- |
mangle_compiler ./ ./recipe ./.ci_support/${CONFIG}.yaml
- upload_or_check_non_existence ./recipe conda-forge --channel=main -m ./.ci_support/${CONFIG}.yaml
script:
# generate the build number clobber
- make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml
- conda build ./recipe -m ./.ci_support/${CONFIG}.yaml --clobber-file ./.ci_support/clobber_${CONFIG}.yaml
- upload_package ./ ./recipe ./.ci_support/${CONFIG}.yaml
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ for each of the installable packages. Such a repository is known as a *feedstock
A feedstock is made up of a conda recipe (the instructions on what and how to build
the package) and the necessary configurations for automatic building using freely
available continuous integration services. Thanks to the awesome service provided by
[CircleCI](https://circleci.com/), [AppVeyor](http://www.appveyor.com/)
[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/)
and [TravisCI](https://travis-ci.org/) it is possible to build and upload installable
packages to the [conda-forge](https://anaconda.org/conda-forge)
[Anaconda-Cloud](http://docs.anaconda.org/) channel for Linux, Windows and OSX respectively.
[Anaconda-Cloud](https://anaconda.org/) channel for Linux, Windows and OSX respectively.

To manage the continuous integration and simplify feedstock maintenance
[conda-smithy](http://github.com/conda-forge/conda-smithy) has been developed.
[conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed.
Using the ``conda-forge.yml`` within this repository, it is possible to re-render all of
this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``.

Expand Down Expand Up @@ -101,7 +101,7 @@ build distinct package versions.

In order to produce a uniquely identifiable distribution:
* If the version of a package **is not** being increased, please add or increase
the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string).
the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string).
* If the version of a package **is** being increased, please remember to return
the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string)
back to 0.
the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string)
back to 0.
31 changes: 19 additions & 12 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
MOVE bin\* %LIBRARY_BIN%
MOVE include\* %LIBRARY_INC%
MOVE jre %LIBRARY_PREFIX%\jre
MOVE lib\* %LIBRARY_LIB%
MOVE src.zip %LIBRARY_PREFIX%\jre\src.zip

:: ensure that JAVA_HOME is set correctly
mkdir %PREFIX%\etc\conda\activate.d
echo set "JAVA_HOME_CONDA_BACKUP=%%JAVA_HOME%%" > "%PREFIX%\etc\conda\activate.d\java_home.bat"
echo set "JAVA_HOME=%%CONDA_PREFIX%%\Library" >> "%PREFIX%\etc\conda\activate.d\java_home.bat"
mkdir %PREFIX%\etc\conda\deactivate.d
echo set "JAVA_HOME=%%JAVA_HOME_CONDA_BACKUP%%" > "%PREFIX%\etc\conda\deactivate.d\java_home.bat"
setlocal EnableDelayedExpansion

XCOPY bin\* %LIBRARY_BIN% /s /i /y
if errorlevel 1 exit 1

XCOPY include\* %LIBRARY_INC% /s /i /y
if errorlevel 1 exit 1

XCOPY lib\* %LIBRARY_LIB% /s /i /y
if errorlevel 1 exit 1

:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
:: This will allow them to be run on environment activation.
FOR %%F IN (activate deactivate) DO (
if not exist %PREFIX%\etc\conda\%%F.d MKDIR %PREFIX%\etc\conda\%%F.d
if errorlevel 1 exit 1
copy %RECIPE_DIR%\scripts\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
if errorlevel 1 exit 1
)
40 changes: 16 additions & 24 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
#!/bin/bash -euo

chmod +x bin/*
chmod +x jre/bin/*
mv bin/* $PREFIX/bin/
ls -la $PREFIX/bin

mv include/* $PREFIX/include
if [ -e jre/lib/jspawnhelper ]; then
chmod +x jre/lib/jspawnhelper
if [ -e ./lib/jspawnhelper ]; then
chmod +x ./lib/jspawnhelper
fi

if [[ `uname` == "Linux" ]]
then
mv lib/amd64/jli/*.so lib
mv lib/amd64/*.so lib
rm -r lib/amd64
# libnio.so does not find this within jre/lib/amd64 subdirectory
cp jre/lib/amd64/libnet.so lib
mv lib/jli/*.so lib/

# include dejavu fonts to allow java to work even on minimal cloud images where these fonts are missing
# (thanks to @chapmanb)
mkdir -p jre/lib/fonts
cd jre/lib/fonts
curl -L -O -C - http://sourceforge.net/projects/dejavu/files/dejavu/2.36/dejavu-fonts-ttf-2.36.tar.bz2
tar -xjvpf dejavu-fonts-ttf-2.36.tar.bz2
mv dejavu-fonts-ttf-*/ttf/* .
rm -rf dejavu-fonts-ttf-*
cd ../../../
# Include dejavu fonts to allow java to work even on minimal cloud
# images where these fonts are missing (thanks to @chapmanb)
mkdir -p lib/fonts
mv ./fonts/ttf/* ./lib/fonts/
rm -rf ./fonts
fi

mv jre $PREFIX/
mv lib/* $PREFIX/lib
mv src.zip $PREFIX/jre/

# ensure that JAVA_HOME is set correctly
mkdir -p $PREFIX/etc/conda/activate.d
mkdir -p $PREFIX/etc/conda/deactivate.d
cp $RECIPE_DIR/scripts/activate.sh $PREFIX/etc/conda/activate.d/java_home.sh
cp $RECIPE_DIR/scripts/deactivate.sh $PREFIX/etc/conda/deactivate.d/java_home.sh
# Copy the [de]activate scripts to $PREFIX/etc/conda/[de]activate.d.
# This will allow them to be run on environment activation.
for CHANGE in "activate" "deactivate"
do
mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
cp "${RECIPE_DIR}/scripts/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
done
37 changes: 20 additions & 17 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
# Based on recipes from birdhouse and anaconda channel.

{% set name = "openjdk" %}
{% set version = "8.0.144" %}
{% set zulu_build = "8.23.0.3" %}
{% set build_number = 2 %}
{% set sha256_linux = "7e6284739c0e5b7142bc7a9adc61ced70dc5bb26b130b582b18e809013bcb251" %}
{% set sha256_osx = "ff533364c9cbd3b271ab5328efe28e2dd6d7bae5b630098a5683f742ecf0709d" %}
{% set sha256_win = "f1d9d3341ef7c8c9baff3597953e99a6a7c64f8608ee62c03fdd7574b7655c02" %}
{% set version = "9.0.7" %}
{% set zulu_build = "9.0.7.1" %}
{% set build_number = 0 %}

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

source:
url: https://cdn.azul.com/zulu/bin/zulu{{ zulu_build }}-jdk{{ version }}-linux_x64.tar.gz # [linux64]
url: https://cdn.azul.com/zulu/bin/zulu{{ zulu_build }}-jdk{{ version }}-macosx_x64.zip # [osx]
url: https://cdn.azul.com/zulu/bin/zulu{{ zulu_build }}-jdk{{ version }}-win_x64.zip # [win64]
sha256: {{ sha256_linux }} # [linux64]
sha256: {{ sha256_osx }} # [osx]
sha256: {{ sha256_win }} # [win64]
- url: https://cdn.azul.com/zulu/bin/zulu{{ zulu_build }}-jdk{{ version }}-linux_x64.tar.gz # [linux64]
sha256: 45f2dfbee93b91b1468cf81d843fc6d9a47fef1f831c0b7ceff4f1eb6e6851c8 # [linux64]

- url: https://cdn.azul.com/zulu/bin/zulu{{ zulu_build }}-jdk{{ version }}-macosx_x64.zip # [osx]
sha256: 4b1f8529ff3a8bebc974e2a22395cb27ad8750e386c8c4d1b0a1b16f89cfcf66 # [osx]

- url: https://cdn.azul.com/zulu/bin/zulu{{ zulu_build }}-jdk{{ version }}-win_x64.zip # [win64]
sha256: 75f76c53c6a1f12b1a571b86bd9708ab75adf582d689dddc94fdd77dcc0f3f5c # [win64]

- url: https://github.com/dejavu-fonts/dejavu-fonts/releases/download/version_2_37/dejavu-fonts-ttf-2.37.zip # [linux64]
sha256: 7576310b219e04159d35ff61dd4a4ec4cdba4f35c00e002a136f00e96a908b0a # [linux64]
folder: fonts # [linux64]

build:
number: {{ build_number }}
Expand All @@ -29,19 +32,18 @@ build:

requirements:
build:
- curl

- curl # [unix]

test:
files:
- test-jni # [not win]
- test-jni # [not win]
- test-jni.sh # [not win]
- test-nio
commands:
- java -version
- ./test-jni.sh # [not win]
- ./test-jni.sh # [not win]
- conda inspect linkages -p ${PREFIX} openjdk # [linux]
- conda inspect objects -p ${PREFIX} openjdk # [osx]
- conda inspect objects -p ${PREFIX} openjdk # [osx]

about:
home: https://www.azul.com/products/zulu/
Expand All @@ -55,3 +57,4 @@ extra:
- johanneskoester
- sodre
- mingwandroid
- hadim
1 change: 1 addition & 0 deletions recipe/run_test.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
IF NOT "%JAVA_HOME%" == "%PREFIX%\Library" exit 1

pushd test-nio
java -version
javac TestFilePaths.java
jar cfm TestFilePaths.jar manifest.mf TestFilePaths.class
java -jar TestFilePaths.jar TestFilePaths.java
Expand Down
9 changes: 1 addition & 8 deletions recipe/scripts/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,4 @@ export JAVA_HOME_CONDA_BACKUP=${JAVA_HOME:-}
export JAVA_HOME=$CONDA_PREFIX

export JAVA_LD_LIBRARY_PATH_BACKUP=${JAVA_LD_LIBRARY_PATH:-}

os=$(uname -s | tr '[:upper:]' '[:lower:]')
if [[ $os == 'darwin' ]]; then
export JAVA_LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/server
else
export JAVA_LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server
fi

export JAVA_LD_LIBRARY_PATH=$JAVA_HOME/lib/server
1 change: 1 addition & 0 deletions recipe/scripts/deactivate.bat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set "JAVA_HOME=%JAVA_HOME_CONDA_BACKUP%"
set "JAVA_HOME_CONDA_BACKUP="
Loading

1 comment on commit f16da87

@conda-forge-linter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! This is the friendly automated conda-forge-webservice.

I updated the Github team because of this commit.

  • @hadim was added to this feedstock maintenance team.

You should get push access to this feedstock and CI services.

Feel free to join the community chat room.

NOTE: Please make sure to not push to the repository directly.
Use branches in your fork for any changes and send a PR.
More details here

Please sign in to comment.