1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 kernel,
6 klibc,
7}:
8
9let
10 pversion = "0.1.10";
11in
12stdenv.mkDerivation {
13 pname = "v86d";
14 version = "${pversion}-${kernel.version}";
15
16 src = fetchFromGitHub {
17 owner = "mjanusz";
18 repo = "v86d";
19 rev = "v86d-${pversion}";
20 hash = "sha256-95LRzVbO/DyddmPwQNNQ290tasCGoQk7FDHlst6LkbA=";
21 };
22
23 patchPhase = ''
24 patchShebangs configure
25 '';
26
27 configureFlags = [
28 "--with-klibc"
29 "--with-x86emu"
30 ];
31
32 hardeningDisable = [ "stackprotector" ];
33
34 makeFlags = [
35 "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
36 "DESTDIR=$(out)"
37 ];
38
39 configurePhase = ''
40 ./configure $configureFlags
41 '';
42
43 buildInputs = [ klibc ];
44
45 meta = with lib; {
46 description = "Daemon to run x86 code in an emulated environment";
47 mainProgram = "v86d";
48 homepage = "https://github.com/mjanusz/v86d";
49 license = licenses.gpl2Only;
50 maintainers = with maintainers; [ codyopel ];
51 platforms = [
52 "i686-linux"
53 "x86_64-linux"
54 ];
55 };
56}