summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/pc/pcem/package.nix
blob: e0bd9dd80dc795e03eaca2b29553e287f78a5ee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
  stdenv,
  lib,
  fetchzip,
  wxwidgets_3_2,
  coreutils,
  SDL2,
  openal,
  alsa-lib,
  pkg-config,
  gtk3,
  wrapGAppsHook3,
  autoreconfHook,
  withNetworking ? true,
  withALSA ? true,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "pcem";
  version = "17";

  src = fetchzip {
    url = "https://pcem-emulator.co.uk/files/PCemV${finalAttrs.version}Linux.tar.gz";
    stripRoot = false;
    sha256 = "067pbnc15h6a4pnnym82klr1w8qwfm6p0pkx93gx06wvwqsxvbdv";
  };

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
    wrapGAppsHook3
  ];
  buildInputs = [
    wxwidgets_3_2
    coreutils
    SDL2
    openal
    gtk3
  ]
  ++ lib.optional withALSA alsa-lib;

  configureFlags = [
    "--enable-release-build"
  ]
  ++ lib.optional withNetworking "--enable-networking"
  ++ lib.optional withALSA "--enable-alsa";

  # Fix GCC 14 build
  env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types -std=gnu17";

  meta = {
    description = "Emulator for IBM PC computers and clones";
    mainProgram = "pcem";
    homepage = "https://pcem-emulator.co.uk/";
    license = lib.licenses.gpl2Only;
    maintainers = [ lib.maintainers.terin ];
    platforms = lib.platforms.linux ++ lib.platforms.windows;
  };
})