diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..ff6e1e2 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,53 @@ +# This file was automatically generated by conda-smithy. To update a component of this +# file, make changes to conda-forge.yml and/or recipe/meta.yaml, and run +# "conda smithy rerender". +# -*- mode: yaml -*- + +environment: + + BINSTAR_TOKEN: + # The BINSTAR_TOKEN secure variable. This is defined canonically in conda-forge.yml. + secure: tumuXLL8PU75WMnRDemRy02ruEq2RpNxeK3dz0MjFssnosPm2v4EFjfNB4PTotA1 + + matrix: + - CONFIG: win_c_compilervs2015python3.6 + CONDA_INSTALL_LOCN: C:\Miniconda36-x64 + + - CONFIG: win_c_compilervs2015python3.7 + CONDA_INSTALL_LOCN: C:\Miniconda36-x64 + + +# We always use a 64-bit machine, but can build x86 distributions +# with the TARGET_ARCH variable. +platform: + - x64 + +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/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 + + # Cygwin's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) + - cmd: rmdir C:\cygwin /s /q + + # Add path, activate `conda` and update conda. + - cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat + - cmd: conda.exe update --yes --quiet conda + + - cmd: set PYTHONUNBUFFERED=1 + + # Configure the VM. + # Tell conda we want an updated version of conda-forge-ci-setup and conda-build + - cmd: conda.exe install -n root -c conda-forge --quiet --yes conda-forge-ci-setup=2 conda-build + - cmd: setup_conda_rc .\ .\recipe .\.ci_support\%CONFIG%.yaml + - cmd: run_conda_forge_build_setup + +# Skip .NET project specific build phase. +build: off + +test_script: + - conda.exe build recipe -m .ci_support\%CONFIG%.yaml +deploy_script: + - cmd: upload_package .\ .\recipe .ci_support\%CONFIG%.yaml \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index eb9811e..f7e243d 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -10,9 +10,6 @@ jobs: strategy: maxParallel: 8 matrix: - linux_python2.7: - CONFIG: linux_python2.7 - UPLOAD_PACKAGES: False linux_python3.6: CONFIG: linux_python3.6 UPLOAD_PACKAGES: False diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index 756bdbb..97779f8 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -10,9 +10,6 @@ jobs: strategy: maxParallel: 8 matrix: - osx_python2.7: - CONFIG: osx_python2.7 - UPLOAD_PACKAGES: False osx_python3.6: CONFIG: osx_python3.6 UPLOAD_PACKAGES: False diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml new file mode 100755 index 0000000..be68acc --- /dev/null +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -0,0 +1,96 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: +- job: win_64 + pool: + vmImage: vs2017-win2016 + timeoutInMinutes: 240 + strategy: + maxParallel: 4 + matrix: + win_c_compilervs2015python3.6: + CONFIG: win_c_compilervs2015python3.6 + CONDA_BLD_PATH: D:\\bld\\ + UPLOAD_PACKAGES: False + win_c_compilervs2015python3.7: + CONFIG: win_c_compilervs2015python3.7 + CONDA_BLD_PATH: D:\\bld\\ + UPLOAD_PACKAGES: False + steps: + # TODO: Fast finish on azure pipelines? + - script: | + ECHO ON + + + - script: | + choco install vcpython27 -fdv -y --debug + condition: contains(variables['CONFIG'], 'vs2008') + displayName: Install vcpython27.msi (if needed) + + # Cygwin's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) + # - script: rmdir C:\cygwin /s /q + # continueOnError: true + + - powershell: | + Set-PSDebug -Trace 1 + + $batchcontent = @" + ECHO ON + SET vcpython=C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0 + + DIR "%vcpython%" + + CALL "%vcpython%\vcvarsall.bat" %* + "@ + + $batchDir = "C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC" + $batchPath = "$batchDir" + "\vcvarsall.bat" + New-Item -Path $batchPath -ItemType "file" -Force + + Set-Content -Value $batchcontent -Path $batchPath + + Get-ChildItem -Path $batchDir + + Get-ChildItem -Path ($batchDir + '\..') + + condition: contains(variables['CONFIG'], 'vs2008') + displayName: Patch vs2008 (if needed) + + - task: CondaEnvironment@1 + inputs: + packageSpecs: 'python=3.6 conda-build conda conda-forge::conda-forge-ci-setup=2' # Optional + installOptions: "-c conda-forge" + updateConda: false + displayName: Install conda-build and activate environment + + - script: set PYTHONUNBUFFERED=1 + + # Configure the VM + - script: setup_conda_rc .\ .\recipe .\.ci_support\%CONFIG%.yaml + + # Configure the VM. + - script: | + run_conda_forge_build_setup + + displayName: conda-forge build setup + + + # Special cased version setting some more things! + - script: | + conda.exe build recipe -m .ci_support\%CONFIG%.yaml --quiet + displayName: Build recipe (vs2008) + env: { + VS90COMNTOOLS: "C:\\Program Files (x86)\\Common Files\\Microsoft\\Visual C++ for Python\\9.0\\VC\\bin", + } + condition: contains(variables['CONFIG'], 'vs2008') + + - script: | + conda.exe build recipe -m .ci_support\%CONFIG%.yaml --quiet + displayName: Build recipe + condition: not(contains(variables['CONFIG'], 'vs2008')) + + - script: | + upload_package .\ .\recipe .ci_support\%CONFIG%.yaml + condition: not(eq(variables['UPLOAD_PACKAGES'], 'False')) diff --git a/.ci_support/linux_python2.7.yaml b/.ci_support/win_c_compilervs2015python3.6.yaml similarity index 80% rename from .ci_support/linux_python2.7.yaml rename to .ci_support/win_c_compilervs2015python3.6.yaml index 1a55d8c..82d08ce 100644 --- a/.ci_support/linux_python2.7.yaml +++ b/.ci_support/win_c_compilervs2015python3.6.yaml @@ -1,11 +1,9 @@ c_compiler: -- gcc +- vs2015 channel_sources: - conda-forge,defaults channel_targets: - conda-forge main -docker_image: -- condaforge/linux-anvil-comp7 glib: - '2.58' libffi: @@ -19,4 +17,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x python: -- '2.7' +- '3.6' +zip_keys: +- - python + - c_compiler diff --git a/.ci_support/osx_python2.7.yaml b/.ci_support/win_c_compilervs2015python3.7.yaml similarity index 66% rename from .ci_support/osx_python2.7.yaml rename to .ci_support/win_c_compilervs2015python3.7.yaml index 8834d0e..1359d38 100644 --- a/.ci_support/osx_python2.7.yaml +++ b/.ci_support/win_c_compilervs2015python3.7.yaml @@ -1,7 +1,5 @@ -MACOSX_DEPLOYMENT_TARGET: -- '10.9' c_compiler: -- clang +- vs2015 channel_sources: - conda-forge,defaults channel_targets: @@ -10,10 +8,6 @@ glib: - '2.58' libffi: - '3.2' -macos_machine: -- x86_64-apple-darwin13.4.0 -macos_min_version: -- '10.9' pin_run_as_build: glib: max_pin: x.x @@ -23,4 +17,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x python: -- '2.7' +- '3.7' +zip_keys: +- - python + - c_compiler diff --git a/.circleci/config.yml b/.circleci/config.yml index 59da584..0e90778 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,23 +5,6 @@ version: 2 jobs: - build_linux_python2.7: - working_directory: ~/test - machine: true - environment: - - CONFIG: "linux_python2.7" - steps: - - checkout - - run: - name: Fast finish outdated PRs and merge PRs - command: | - ./.circleci/fast_finish_ci_pr_build.sh - ./.circleci/checkout_merge_commit.sh - - run: - command: docker pull condaforge/linux-anvil-comp7 - - run: - # Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. - command: ./.circleci/run_docker_build.sh build_linux_python3.6: working_directory: ~/test machine: true @@ -61,6 +44,5 @@ workflows: version: 2 build_and_test: jobs: - - build_linux_python2.7 - build_linux_python3.6 - build_linux_python3.7 diff --git a/.travis.yml b/.travis.yml index 188f1d7..eaa6a46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ osx_image: xcode9.4 env: matrix: - - CONFIG=osx_python2.7 - CONFIG=osx_python3.6 - CONFIG=osx_python3.7 diff --git a/README.md b/README.md index 844d34c..4c557cd 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Current build status [![Linux](https://img.shields.io/circleci/project/github/conda-forge/pygobject-feedstock/master.svg?label=Linux)](https://circleci.com/gh/conda-forge/pygobject-feedstock) [![OSX](https://img.shields.io/travis/conda-forge/pygobject-feedstock/master.svg?label=macOS)](https://travis-ci.org/conda-forge/pygobject-feedstock) -![Windows disabled](https://img.shields.io/badge/Windows-disabled-lightgrey.svg) +[![Windows](https://img.shields.io/appveyor/ci/conda-forge/pygobject-feedstock/master.svg?label=Windows)](https://ci.appveyor.com/project/conda-forge/pygobject-feedstock/branch/master) Current release info ==================== diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 33a441c..e5306da 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,4 +4,5 @@ jobs: - template: ./.azure-pipelines/azure-pipelines-linux.yml - - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file + - template: ./.azure-pipelines/azure-pipelines-osx.yml + - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file diff --git a/recipe/bld.bat b/recipe/bld.bat new file mode 100644 index 0000000..94ee6df --- /dev/null +++ b/recipe/bld.bat @@ -0,0 +1,41 @@ +@ECHO ON + +@REM I cannot for the life of me figure out how Cygwin/MSYS2 figures out its +@REM root directory, which it uses to find the /etc/fstab which *sometimes* +@REM affects the choice of the cygdrive prefix. But, regardless of *why*, +@REM I find that we need this to work: +mkdir %BUILD_PREFIX%\Library\etc +echo none / cygdrive binary,user 0 0 >%BUILD_PREFIX%\Library\etc\fstab +echo none /tmp usertemp binary,posix=0 0 0 >>%BUILD_PREFIX%\Library\etc\fstab + +@REM Here we ditch the -GL flag, which messes up symbol resolution. +set "CFLAGS=-MD" +set "CXXFLAGS=-MD" + +mkdir forgebuild +cd forgebuild + +@REM pkg-config setup +FOR /F "delims=" %%i IN ('cygpath.exe -m "%LIBRARY_PREFIX%"') DO set "LIBRARY_PREFIX_M=%%i" +set PKG_CONFIG_PATH=%LIBRARY_PREFIX_M%/lib/pkgconfig + +@REM NB: We should provide Cairo, but it's a bit tricky on Windows +@REM so we're punting on it for now. +%PYTHON% %PREFIX%\Scripts\meson --buildtype=release --prefix=%LIBRARY_PREFIX_M% --backend=ninja -Dpython=%PYTHON% -Dpycairo=false .. +if errorlevel 1 exit 1 + +ninja -v +if errorlevel 1 exit 1 + +ninja test +if errorlevel 1 exit 1 + +ninja install +if errorlevel 1 exit 1 + +@REM Meson doesn't put the Python files in the right place. +cd %LIBRARY_PREFIX%\lib\python* +cd site-packages +move *.egg-info %PREFIX%\lib\site-packages +move gi %PREFIX%\lib\site-packages\gi +move pygtkcompat %PREFIX%\lib\site-packages\gi diff --git a/recipe/build.sh b/recipe/build.sh index eadfb7e..77aef68 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -ex if [ -n "$OSX_ARCH" ] ; then export LDFLAGS="$LDFLAGS -Wl,-rpath,$PREFIX/lib" @@ -8,7 +8,9 @@ else export LDFLAGS="$LDFLAGS -Wl,-rpath-link,$PREFIX/lib" fi -./configure --with-python=${PYTHON} --prefix="${PREFIX}" -make check TEST_NAMES=test_gi -make install - +mkdir forgebuild +cd forgebuild +meson --buildtype=release --prefix="$PREFIX" --backend=ninja -Dlibdir=lib .. +ninja -v +ninja test +ninja install diff --git a/recipe/macos-tests.patch b/recipe/macos-tests.patch new file mode 100644 index 0000000..c07f2dc --- /dev/null +++ b/recipe/macos-tests.patch @@ -0,0 +1,14 @@ +diff --git a/tests/meson.build b/tests/meson.build +index f72ead0..c500d90 100644 +--- a/tests/meson.build ++++ b/tests/meson.build +@@ -115,6 +115,9 @@ endif + if host_machine.system() == 'linux' + envdata.prepend('LD_LIBRARY_PATH', meson.current_build_dir()) + endif ++if host_machine.system() == 'darwin' ++ envdata.prepend('DYLD_LIBRARY_PATH', meson.current_build_dir()) ++endif + if host_machine.system() == 'windows' + envdata.prepend('PATH', join_paths(get_option('prefix'), get_option('bindir'))) + endif diff --git a/recipe/meson-rpaths.patch b/recipe/meson-rpaths.patch new file mode 100644 index 0000000..a56b5d6 --- /dev/null +++ b/recipe/meson-rpaths.patch @@ -0,0 +1,20 @@ +diff --git a/gi/meson.build b/gi/meson.build +index c1afd68..15a6521 100644 +--- a/gi/meson.build ++++ b/gi/meson.build +@@ -76,6 +76,7 @@ giext = python.extension_module('_gi', sources, + dependencies : [python_ext_dep, glib_dep, gi_dep, ffi_dep], + include_directories: include_directories('..'), + install: true, ++ install_rpath: join_paths(get_option('prefix'), get_option('libdir')), + subdir : 'gi', + c_args: pyext_c_args + main_c_args + ) +@@ -84,6 +85,7 @@ if with_pycairo + gicairoext = python.extension_module('_gi_cairo', ['pygi-foreign-cairo.c'], + dependencies : [python_ext_dep, glib_dep, gi_dep, ffi_dep, pycairo_dep, cairo_dep, cairo_gobject_dep], + install: true, ++ install_rpath: join_paths(get_option('prefix'), get_option('libdir')), + subdir : 'gi', + c_args: pyext_c_args + main_c_args) + endif diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 1a2a566..58c15ce 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,7 +1,9 @@ {% set name = "pygobject" %} -{% set version = "3.28.3" %} +{% set version = "3.30.4" %} {% set majmin = '.'.join(version.split('.', 2)[:2]) %} -{% set sha256 = "3dd3e21015d06e00482ea665fc1733b77e754a6ab656a5db5d7f7bfaf31ad0b0" %} +{% set sha256 = "2dc1a1a444b82955e65b81c2a2511ecf8032404beba4ef1d48144168f2f64c43" %} +{% set posix = 'm2-' if win else '' %} +{% set native = 'm2w64-' if win else '' %} package: name: {{ name|lower }} @@ -11,18 +13,23 @@ source: fn: {{ name }}-{{ version }}.tar.xz url: http://ftp.gnome.org/pub/GNOME/sources/pygobject/{{ majmin }}/{{ name }}-{{ version }}.tar.xz sha256: {{ sha256 }} + patches: + - macos-tests.patch + - meson-rpaths.patch # [linux] build: - number: 1002 - skip: true # [win] + number: 1000 + skip: true # [py<35] requirements: build: - {{ compiler('c') }} - - make - - libtool - - pkg-config + - m2-msys2-runtime # [win] + - ninja + - {{posix}}patch + - {{native}}pkg-config host: + - meson - glib - python - pycairo @@ -39,6 +46,7 @@ requirements: test: imports: - gi + - gi.repository.GLib commands: - conda inspect linkages -p $PREFIX $PKG_NAME # [not win] - conda inspect objects -p $PREFIX $PKG_NAME # [osx]