nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 makeWrapper,
6}:
7
8stdenv.mkDerivation {
9 pname = "rolespec";
10 version = "20161104";
11
12 src = fetchFromGitHub {
13 owner = "nickjj";
14 repo = "rolespec";
15 rev = "d9ee530cd709168882059776c482fc37f46cb743";
16 sha256 = "1jkidw6aqr0zfqwmcvlpi9qa140z2pxcfsd43xm5ikx6jcwjdrzl";
17 };
18
19 nativeBuildInputs = [ makeWrapper ];
20
21 # The default build phase (`make`) runs the test code. It's difficult to do
22 # the test in the build environment because it depends on the system package
23 # managers (apt/yum/pacman). We simply skip this phase since RoleSpec is
24 # shell based.
25 dontBuild = true;
26
27 # Wrap the program because `ROLESPEC_LIB` defaults to
28 # `/usr/local/lib/rolespec`.
29 installPhase = ''
30 make install PREFIX=$out
31 wrapProgram $out/bin/rolespec --set ROLESPEC_LIB $out/lib/rolespec
32 '';
33
34 # Since RoleSpec installs the shell script files in `lib` directory, the
35 # fixup phase shows some warnings. Disable these actions.
36 dontPatchELF = true;
37 dontStrip = true;
38
39 meta = with lib; {
40 homepage = "https://github.com/nickjj/rolespec";
41 description = "Test library for testing Ansible roles";
42 mainProgram = "rolespec";
43 longDescription = ''
44 A shell based test library for Ansible that works both locally and over
45 Travis-CI.
46 '';
47 downloadPage = "https://github.com/nickjj/rolespec";
48 license = licenses.gpl3;
49 maintainers = [ maintainers.dochang ];
50 platforms = platforms.unix;
51 };
52}