aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/misc/xteddy/default.nix
blob: 856ddb8ff50c93a9659a44c84c9d01e8c60ce664 (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
{ stdenv, fetchFromGitLab, pkg-config, xorg, imlib2, makeWrapper }:

stdenv.mkDerivation rec {
  pname = "xteddy";
  version = "2.2-5";
  src = fetchFromGitLab {
    domain = "salsa.debian.org";
    owner = "games-team";
    repo = "xteddy";
    rev = "debian%2F${version}"; # %2F = urlquote("/");
    sha256 = "0rm7w78d6qajq4fvi4agyqm0c70f3c1i0cy2jdb6kqql2k8w78qy";
  };

  nativeBuildInputs = [ pkg-config makeWrapper ];
  buildInputs = [ imlib2 xorg.libX11 xorg.libXext ];

  patches = [ "${src}/debian/patches/10_libXext.patch" "${src}/debian/patches/wrong-man-page-section.patch" ];

  postPatch = ''
    sed -i "s:/usr/games/xteddy:$out/bin/xteddy:" xtoys
    sed -i "s:/usr/share/xteddy:$out/share/xteddy:" xtoys
  '';

  postInstall = ''
    cp -R images $out/share/images
    # remove broken test script
    rm $out/bin/xteddy_test
  '';

  postFixup = ''
    # this is needed, because xteddy expects images to reside
    # in the current working directory
    wrapProgram $out/bin/xteddy --run "cd $out/share/images/"
  '';

  meta = with stdenv.lib; {
    description = "Cuddly teddy bear for your X desktop";
    homepage = "https://weber.itn.liu.se/~stegu/xteddy/";
    license = licenses.gpl2;
    maintainers = [ maintainers.xaverdh ];
    platforms = platforms.linux;
  };
}