about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/emulators/vice/default.nix
blob: 0b6dac32865397119c6c89b729e97cf515079a13 (plain) (blame)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ lib
, stdenv
, fetchurl
, bison
, flex
, perl
, libpng
, giflib
, alsa-lib
, readline
, libGLU
, libGL
, pkg-config
, gtk3
, glew
, SDL
, SDL_image
, dos2unix
, runtimeShell
, xa
, file
, wrapGAppsHook
, xdg-utils
}:

stdenv.mkDerivation rec {
  pname = "vice";
  version = "3.7.1";

  src = fetchurl {
    url = "mirror://sourceforge/vice-emu/vice-${version}.tar.gz";
    sha256 = "sha256-fjgR5gJNsGmL+8MhuzJFckRriFPQG0Bz8JhllXsMq5g=";
  };

  nativeBuildInputs = [
    bison
    dos2unix
    file
    flex
    pkg-config
    wrapGAppsHook
  ];

  buildInputs = [
    alsa-lib
    giflib
    gtk3
    glew
    libGL
    libGLU
    libpng
    perl
    readline
    SDL
    SDL_image
    xa
    xdg-utils
  ];
  dontDisableStatic = true;
  configureFlags = [ "--enable-sdl2ui" "--enable-gtk3ui" "--enable-desktop-files" "--disable-pdf-docs" "--with-gif" ];

  LIBS = "-lGL";

  preBuild = ''
    sed -i -e 's|#!/usr/bin/env bash|${runtimeShell}/bin/bash|' src/arch/gtk3/novte/box_drawing_generate.sh
  '';

  postInstall = ''
    mkdir -p $out/share/applications
    cp src/arch/gtk3/data/unix/vice-org-*.desktop $out/share/applications
  '';

  meta = {
    description = "Emulators for a variety of 8-bit Commodore computers";
    homepage = "https://vice-emu.sourceforge.io/";
    license = lib.licenses.gpl2Plus;
    maintainers = [ lib.maintainers.sander ];
    platforms = lib.platforms.linux;
  };
}