diff --git a/.travis.yml b/.travis.yml index 577c33b..533d134 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ # This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yaml and/or the recipe/meta.yaml. +# update the conda-forge.yml and/or the recipe/meta.yaml. -language: objective-c +language: generic + +os: osx +osx_image: beta-xcode6.1 env: global: @@ -17,12 +20,12 @@ before_install: install: - | - MINICONDA_URL="http://repo.continuum.io/miniconda" + MINICONDA_URL="https://repo.continuum.io/miniconda" MINICONDA_FILE="Miniconda3-latest-MacOSX-x86_64.sh" - curl -O "${MINICONDA_URL}/${MINICONDA_FILE}" + curl -L -O "${MINICONDA_URL}/${MINICONDA_FILE}" bash $MINICONDA_FILE -b - export PATH=/Users/travis/miniconda3/bin:$PATH + source /Users/travis/miniconda3/bin/activate root conda config --add channels conda-forge conda config --set show_channel_urls true conda install --yes --quiet conda-forge-build-setup @@ -31,6 +34,4 @@ install: script: - conda build ./recipe -after_success: - - - ./ci_support/upload_or_check_non_existence.py ./recipe conda-forge --channel=main + - upload_or_check_non_existence ./recipe conda-forge --channel=main diff --git a/README.md b/README.md index cf16853..3cbb822 100644 --- a/README.md +++ b/README.md @@ -3,36 +3,37 @@ About libpng Home: http://www.libpng.org/pub/png/libpng.html -Package license: Zlib +Package license: zlib/libpng Feedstock license: BSD 3-Clause -Summary: PNG reference library +Summary: PNG reference library. Installing libpng ================= -Installing libpng from the conda-forge channel can be achieved by adding conda-forge to your channels with: +Installing `libpng` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with: ``` conda config --add channels conda-forge ``` -Once the conda-forge channel has been enabled, libpng can be installed with: +Once the `conda-forge` channel has been enabled, `libpng` can be installed with: ``` conda install libpng ``` -It is possible to list all of the versions of libpng available on your platform with: +It is possible to list all of the versions of `libpng` available on your platform with: ``` conda search libpng --channel conda-forge ``` + About conda-forge ================= @@ -51,8 +52,8 @@ packages to the [conda-forge](https://anaconda.org/conda-forge) To manage the continuous integration and simplify feedstock maintenance [conda-smithy](http://github.com/conda-forge/conda-smithy) has been developed. -Using the ``conda-forge.yml`` within this repository, it is possible to regenerate all of -this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy regenerate``. +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``. Terminology @@ -70,7 +71,7 @@ Terminology Current build status ==================== -Linux: [![Circle CI](https://circleci.com/gh/conda-forge/libpng-feedstock.svg?style=svg)](https://circleci.com/gh/conda-forge/libpng-feedstock) +Linux: [![Circle CI](https://circleci.com/gh/conda-forge/libpng-feedstock.svg?style=shield)](https://circleci.com/gh/conda-forge/libpng-feedstock) OSX: [![TravisCI](https://travis-ci.org/conda-forge/libpng-feedstock.svg?branch=master)](https://travis-ci.org/conda-forge/libpng-feedstock) Windows: [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/conda-forge/libpng-feedstock?svg=True)](https://ci.appveyor.com/project/conda-forge/libpng-feedstock/branch/master) @@ -83,12 +84,17 @@ Downloads: [![Anaconda-Server Badge](https://anaconda.org/conda-forge/libpng/bad Updating libpng-feedstock ========================= -If you would like to improve the libpng recipe, please take the normal -route of forking this repository and submitting a PR. Upon submission, your changes will -be run on the appropriate platforms to give the reviewer an opportunity to confirm that the -changes result in a successful build. Once merged, the recipe will be re-built and uploaded -automatically to the conda-forge channel, whereupon they will be available for everybody to -install and use. +If you would like to improve the libpng recipe or build a new +package version, please fork this repository and submit a PR. Upon submission, +your changes will be run on the appropriate platforms to give the reviewer an +opportunity to confirm that the changes result in a successful build. Once +merged, the recipe will be re-built and uploaded automatically to the +`conda-forge` channel, whereupon the built conda packages will be available for +everybody to install and use from the `conda-forge` channel. +Note that all branches in the conda-forge/libpng-feedstock are +immediately built and any created packages are uploaded, so PRs should be based +on branches in forks and branches in the main repository should only be used to +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 diff --git a/appveyor.yml b/appveyor.yml index bd534b6..5952400 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ # This file was automatically generated by conda-smithy. To update a component of this -# file, make changes to conda-forge.yaml and/or recipe/meta.yaml, and run +# file, make changes to conda-forge.yml and/or recipe/meta.yaml, and run # "conda smithy rerender". environment: @@ -56,8 +56,18 @@ install: # Cywing's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) - cmd: rmdir C:\cygwin /s /q - - appveyor DownloadFile "https://raw.githubusercontent.com/pelson/Obvious-CI/master/bootstrap-obvious-ci-and-miniconda.py" + - appveyor DownloadFile "https://raw.githubusercontent.com/conda-forge/conda-smithy/e976c7e84bb3c4846e7562afd1a42c4b535b51f5/bootstrap-obvious-ci-and-miniconda.py" - cmd: python bootstrap-obvious-ci-and-miniconda.py %CONDA_INSTALL_LOCN% %TARGET_ARCH% %CONDA_PY:~0,1% --without-obvci + + # Add a hack to switch to `conda` version `4.1.12` before activating. + # This is required to handle a long path activation issue. + # Please see PR ( https://github.com/conda/conda/pull/3349 ). + - cmd: set "OLDPATH=%PATH%" + - cmd: set "PATH=%CONDA_INSTALL_LOCN%\\Scripts;%CONDA_INSTALL_LOCN%\\Library\\bin;%PATH%" + - cmd: conda install --yes --quiet conda=4.1.12 + - cmd: set "PATH=%OLDPATH%" + - cmd: set "OLDPATH=" + - cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat - cmd: set PYTHONUNBUFFERED=1 @@ -73,5 +83,4 @@ build: off test_script: - "%CMD_IN_ENV% conda build recipe --quiet" deploy_script: - - - 'python ci_support\upload_or_check_non_existence.py .\recipe conda-forge --channel=main' + - cmd: upload_or_check_non_existence .\recipe conda-forge --channel=main diff --git a/ci_support/checkout_merge_commit.sh b/ci_support/checkout_merge_commit.sh new file mode 100755 index 0000000..9528e4b --- /dev/null +++ b/ci_support/checkout_merge_commit.sh @@ -0,0 +1,27 @@ +#!/bin/bash + + +# Update PR refs for testing. +if [[ -n "${CIRCLE_PR_NUMBER}" ]] +then + FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/head:pr/${CIRCLE_PR_NUMBER}/head" + FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/${CIRCLE_PR_NUMBER}/merge" +fi + +# Retrieve the refs. +if [[ -n "${CIRCLE_PR_NUMBER}" ]] +then + git fetch -u origin ${FETCH_REFS} +fi + +# Checkout the PR merge ref. +if [[ -n "${CIRCLE_PR_NUMBER}" ]] +then + git checkout -qf "pr/${CIRCLE_PR_NUMBER}/merge" +fi + +# Check for merge conflicts. +if [[ -n "${CIRCLE_PR_NUMBER}" ]] +then + git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null +fi diff --git a/ci_support/run_docker_build.sh b/ci_support/run_docker_build.sh index f79ab1a..f4bad78 100755 --- a/ci_support/run_docker_build.sh +++ b/ci_support/run_docker_build.sh @@ -43,5 +43,5 @@ source run_conda_forge_build_setup # Embarking on 1 case(s). conda build /recipe_root --quiet || exit 1 - /feedstock_root/ci_support/upload_or_check_non_existence.py /recipe_root conda-forge --channel=main || exit 1 + upload_or_check_non_existence /recipe_root conda-forge --channel=main || exit 1 EOF diff --git a/ci_support/upload_or_check_non_existence.py b/ci_support/upload_or_check_non_existence.py deleted file mode 100755 index 681f144..0000000 --- a/ci_support/upload_or_check_non_existence.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function - -import argparse -import hashlib -import os -import subprocess -import sys - -from binstar_client.utils import get_binstar -import binstar_client.errors -import conda.config -from conda_build.metadata import MetaData -from conda_build.build import bldpkg_path - - -def built_distribution_already_exists(cli, meta, owner): - """ - Checks to see whether the built recipe (aka distribution) already - exists on the owner/user's binstar account. - - """ - distro_name = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist()) - fname = bldpkg_path(meta) - try: - dist_info = cli.distribution(owner, meta.name(), meta.version(), - distro_name) - except binstar_client.errors.NotFound: - dist_info = {} - - exists = bool(dist_info) - # Unfortunately, we cannot check the md5 quality of the built distribution, as - # this will depend on fstat information such as modification date (because - # distributions are tar files). Therefore we can only assume that the distribution - # just built, and the one on anaconda.org are the same. -# if exists: -# md5_on_binstar = dist_info.get('md5') -# with open(fname, 'rb') as fh: -# md5_of_build = hashlib.md5(fh.read()).hexdigest() -# -# if md5_on_binstar != md5_of_build: -# raise ValueError('This build ({}), and the build already on binstar ' -# '({}) are different.'.format(md5_of_build, md5_on_binstar)) - return exists - - -def upload(cli, meta, owner, channels): - try: - with open('binstar.token', 'w') as fh: - fh.write(cli.token) - subprocess.check_call(['anaconda', '--quiet', '-t', 'binstar.token', - 'upload', bldpkg_path(meta), - '--user={}'.format(owner), - '--channel={}'.format(channels)], - env=os.environ) - finally: - os.remove('binstar.token') - - -def distribution_exists_on_channel(binstar_cli, meta, owner, channel='main'): - """ - Determine whether a distribution exists on a specific channel. - - Note from @pelson: As far as I can see, there is no easy way to do this on binstar. - - """ - fname = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist()) - distributions_on_channel = [dist['basename'] for dist in - binstar_cli.show_channel(owner=owner, channel=channel)['files']] - return fname in distributions_on_channel - - -def add_distribution_to_channel(binstar_cli, meta, owner, channel='main'): - """ - Add a(n already existing) distribution on binstar to another channel. - - Note - the addition is done based on name and version - no build strings etc. - so if you have a foo-0.1-np18 and foo-0.1-np19 *both* will be added to the channel. - - """ - package_fname = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist()) - binstar_cli.add_channel(channel, owner, meta.name(), meta.version()) - - -def main(): - token = os.environ.get('BINSTAR_TOKEN') - - description = ('Upload or check consistency of a built version of a ' - 'conda recipe with binstar. Note: The existence of the ' - 'BINSTAR_TOKEN environment variable determines ' - 'whether the upload should actually take place.') - parser = argparse.ArgumentParser(description=description) - parser.add_argument('recipe_dir', help='the conda recipe directory') - parser.add_argument('owner', help='the binstar owner/user') - parser.add_argument('--channel', help='the binstar channel', default='main') - args = parser.parse_args() - recipe_dir, owner, channel = args.recipe_dir, args.owner, args.channel - - cli = get_binstar(argparse.Namespace(token=token, site=None)) - meta = MetaData(recipe_dir) - if meta.skip(): - print("No upload to take place - this configuration was skipped in build/skip.") - return - exists = built_distribution_already_exists(cli, meta, owner) - if token: - on_channel = distribution_exists_on_channel(cli, meta, owner, channel) - if not exists: - upload(cli, meta, owner, channel) - print('Uploaded {}'.format(bldpkg_path(meta))) - elif not on_channel: - print('Adding distribution {} to {}\'s {} channel' - ''.format(bldpkg_path(meta), owner, channel)) - add_distribution_to_channel(cli, meta, owner, channel) - else: - print('Distribution {} already \nexists on {}\'s {} channel.' - ''.format(bldpkg_path(meta), owner, channel)) - else: - print("No BINSTAR_TOKEN present, so no upload is taking place. " - "The distribution just built {} already available on {}'s " - "{} channel.".format('is' if exists else 'is not', - owner, channel)) - -if __name__ == '__main__': - main() diff --git a/circle.yml b/circle.yml index 58649fa..0c5dcdf 100644 --- a/circle.yml +++ b/circle.yml @@ -1,3 +1,7 @@ +checkout: + post: + - ./ci_support/checkout_merge_commit.sh + machine: services: - docker diff --git a/recipe/libpng-LICENSE.txt b/recipe/libpng-LICENSE.txt deleted file mode 100644 index fd93b1b..0000000 --- a/recipe/libpng-LICENSE.txt +++ /dev/null @@ -1,112 +0,0 @@ - -This copy of the libpng notices is provided for your convenience. In case of -any discrepancy between this copy and the notices in the file png.h that is -included in the libpng distribution, the latter shall prevail. - -COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: - -If you modify libpng you may insert additional notices immediately following -this sentence. - -This code is released under the libpng license. - -libpng versions 1.0.7, July 1, 2000, through 1.6.21, January 15, 2016, are -Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are -derived from libpng-1.0.6, and are distributed according to the same -disclaimer and license as libpng-1.0.6 with the following individuals -added to the list of Contributing Authors: - - Simon-Pierre Cadieux - Eric S. Raymond - Mans Rullgard - Cosmin Truta - Gilles Vollant - James Yu - -and with the following additions to the disclaimer: - - There is no warranty against interference with your enjoyment of the - library or against infringement. There is no warranty that our - efforts or the library will fulfill any of your particular purposes - or needs. This library is provided with all faults, and the entire - risk of satisfactory quality, performance, accuracy, and effort is with - the user. - -libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are -Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from -libpng-0.96, and are distributed according to the same disclaimer and -license as libpng-0.96, with the following individuals added to the list -of Contributing Authors: - - Tom Lane - Glenn Randers-Pehrson - Willem van Schaik - -libpng versions 0.89, June 1996, through 0.96, May 1997, are -Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, -and are distributed according to the same disclaimer and license as -libpng-0.88, with the following individuals added to the list of -Contributing Authors: - - John Bowler - Kevin Bracey - Sam Bushell - Magnus Holmgren - Greg Roelofs - Tom Tanner - -libpng versions 0.5, May 1995, through 0.88, January 1996, are -Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. - -For the purposes of this copyright and license, "Contributing Authors" -is defined as the following set of individuals: - - Andreas Dilger - Dave Martindale - Guy Eric Schalnat - Paul Schmidt - Tim Wegner - -The PNG Reference Library is supplied "AS IS". The Contributing Authors -and Group 42, Inc. disclaim all warranties, expressed or implied, -including, without limitation, the warranties of merchantability and of -fitness for any purpose. The Contributing Authors and Group 42, Inc. -assume no liability for direct, indirect, incidental, special, exemplary, -or consequential damages, which may result from the use of the PNG -Reference Library, even if advised of the possibility of such damage. - -Permission is hereby granted to use, copy, modify, and distribute this -source code, or portions hereof, for any purpose, without fee, subject -to the following restrictions: - - 1. The origin of this source code must not be misrepresented. - - 2. Altered versions must be plainly marked as such and must not - be misrepresented as being the original source. - - 3. This Copyright notice may not be removed or altered from any - source or altered source distribution. - -The Contributing Authors and Group 42, Inc. specifically permit, without -fee, and encourage the use of this source code as a component to -supporting the PNG file format in commercial products. If you use this -source code in a product, acknowledgment is not required but would be -appreciated. - -END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. - -A "png_get_copyright" function is available, for convenient use in "about" -boxes and the like: - - printf("%s", png_get_copyright(NULL)); - -Also, the PNG logo (in PNG format, of course) is supplied in the -files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). - -Libpng is OSI Certified Open Source Software. OSI Certified Open Source is -a certification mark of the Open Source Initiative. OSI has not addressed -the additional disclaimers inserted at version 1.0.7. - -Glenn Randers-Pehrson -glennrp at users.sourceforge.net -January 15, 2016