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