Skip to content

Commit

Permalink
Merge 965c10a into a51ec7a
Browse files Browse the repository at this point in the history
  • Loading branch information
jbboehr committed May 25, 2020
2 parents a51ec7a + 965c10a commit ba6c364
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ matrix:
allow_failures:
- language: php
php: 'master'
- language: nix
env:
- NIX_CHANNEL=unstable
- NIX_PHP_ATTR=php74
- language: nix
env:
- NIX_CHANNEL=unstable
Expand All @@ -14,6 +18,8 @@ matrix:
php: '7.2'
- language: php
php: '7.3'
- language: php
php: '7.4'
- language: php
php: 'master'
- language: nix
Expand All @@ -28,6 +34,10 @@ matrix:
env:
- NIX_CHANNEL=19.03
- NIX_PHP_ATTR=php73
- language: nix
env:
- NIX_CHANNEL=unstable
- NIX_PHP_ATTR=php74
- language: nix
env:
- NIX_CHANNEL=unstable
Expand Down
48 changes: 48 additions & 0 deletions ci.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
let
generateTestsForPlatform = { pkgs, php, buildPecl, src }:
pkgs.recurseIntoAttrs {
epeg = pkgs.callPackage ./default.nix {
inherit php buildPecl ;
phpEpegSrc = src;
};
};
in
builtins.mapAttrs (k: _v:
let
path = builtins.fetchTarball {
url = https://github.com/NixOS/nixpkgs/archive/release-20.03.tar.gz;
name = "nixpkgs-20.03";
};
pkgs = import (path) { system = k; };

src = builtins.filterSource
(path: type: baseNameOf path != ".idea" && baseNameOf path != ".git" && baseNameOf path != "ci.nix" && baseNameOf path != ".ci")
./.;
in
pkgs.recurseIntoAttrs {
php72 = let
php = pkgs.php72;
in generateTestsForPlatform {
inherit pkgs php src;
buildPecl = pkgs.callPackage "${path}/pkgs/build-support/build-pecl.nix" { inherit php; };
};

php73 = let
php = pkgs.php73;
in generateTestsForPlatform {
inherit pkgs php src;
buildPecl = pkgs.callPackage "${path}/pkgs/build-support/build-pecl.nix" { inherit php; };
};

php74 = let
php = pkgs.php74;
in generateTestsForPlatform {
inherit pkgs php src;
buildPecl = pkgs.callPackage "${path}/pkgs/build-support/build-pecl.nix" { inherit php; };
};
}
) {
x86_64-linux = {};
# Uncomment to test build on macOS too
# x86_64-darwin = {};
}
5 changes: 4 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
pkgs ? import <nixpkgs> {},
php ? pkgs.php,
buildPecl ? pkgs.callPackage <nixpkgs/pkgs/build-support/build-pecl.nix> {
inherit php;
},

phpEpegVersion ? null,
phpEpegSrc ? ./.,
phpEpegSha256 ? null
}:

pkgs.callPackage ./derivation.nix {
inherit php phpEpegVersion phpEpegSrc phpEpegSha256;
inherit php buildPecl phpEpegVersion phpEpegSrc phpEpegSha256;
}

9 changes: 5 additions & 4 deletions derivation.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{ php, stdenv, autoreconfHook, fetchurl, epeg, pkgconfig,
buildPecl ? import <nixpkgs/pkgs/build-support/build-pecl.nix> {
# re2c is required for nixpkgs master, must not be specified for <= 19.03
inherit php stdenv autoreconfHook fetchurl;
},
phpEpegVersion ? null,
phpEpegSrc ? null,
phpEpegSha256 ? null
}:

let
orDefault = x: y: (if (!isNull x) then x else y);
buildPecl = import <nixpkgs/pkgs/build-support/build-pecl.nix> {
inherit php stdenv autoreconfHook fetchurl;
};
in

buildPecl rec {
Expand All @@ -27,6 +28,6 @@ buildPecl rec {

doCheck = true;
checkTarget = "test";
checkFlagsArray = ["REPORT_EXIT_STATUS=1" "NO_INTERACTION=1" "TEST_PHP_DETAILED=1"];
checkFlags = ["REPORT_EXIT_STATUS=1" "NO_INTERACTION=1"];
}

0 comments on commit ba6c364

Please sign in to comment.