1{ lib, stdenv, fetchurl, fetchFromGitLab, bash }:
2
3let
4 # Fetch explicitly, otherwise build will try to do so
5 owl = fetchurl {
6 name = "ol.c.gz";
7 url = "https://gitlab.com/owl-lisp/owl/uploads/0d0730b500976348d1e66b4a1756cdc3/ol-0.1.19.c.gz";
8 sha256 = "0kdmzf60nbpvdn8j3l51i9lhcwfi4aw1zj4lhbp4adyg8n8pp4c6";
9 };
10in
11stdenv.mkDerivation rec {
12 pname = "radamsa";
13 version = "0.6";
14
15 src = fetchFromGitLab {
16 owner = "akihe";
17 repo = pname;
18 rev = "v${version}";
19 sha256 = "0mi1mwvfnlpblrbmp0rcyf5p74m771z6nrbsly6cajyn4mlpmbaq";
20 };
21
22 patchPhase = ''
23 substituteInPlace ./tests/bd.sh \
24 --replace "/bin/echo" echo
25
26 ln -s ${owl} ol.c.gz
27
28 patchShebangs tests
29 '';
30
31 makeFlags = [ "PREFIX=${placeholder "out"}" "BINDIR=" ];
32
33 nativeCheckInputs = [ bash ];
34 doCheck = true;
35
36 meta = {
37 description = "A general purpose fuzzer";
38 longDescription = "Radamsa is a general purpose data fuzzer. It reads data from given sample files, or standard input if none are given, and outputs modified data. It is usually used to generate malformed data for testing programs.";
39 homepage = "https://gitlab.com/akihe/radamsa";
40 maintainers = [ ];
41 platforms = lib.platforms.all;
42 };
43}