about summary refs log tree commit diff
path: root/pkgs/by-name/li/libappimage/package.nix
blob: 8d2a1013aff806a8ad30caa4457e608699dd7294 (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
81
82
83
84
85
86
87
{
  lib,
  stdenv,
  fetchFromGitHub,
  fetchpatch,
  cmake,
  autoconf,
  automake,
  libtool,
  pkg-config,
  boost,
  cairo,
  fuse,
  glib,
  libarchive,
  librsvg,
  squashfuse,
  xdg-utils-cxx,
  zlib,
}:
stdenv.mkDerivation rec {
  pname = "libappimage";
  version = "1.0.4-5";

  src = fetchFromGitHub {
    owner = "AppImageCommunity";
    repo = "libappimage";
    rev = "v${version}";
    hash = "sha256-V9Ilo0zFo9Urke+jCA4CSQB5tpzLC/S5jmon+bA+TEU=";
  };

  patches = [
    # Fix build with GCC 13
    # FIXME: remove in next release
    (fetchpatch {
      url = "https://github.com/AppImageCommunity/libappimage/commit/1e0515b23b90588ce406669134feca56ddcbbe43.patch";
      hash = "sha256-WIMvXNqC1stgPiBTRpXHWq3edIRnQomtRSW2qO52TRo=";
    })
  ];

  postPatch = ''
    substituteInPlace cmake/libappimage.pc.in \
      --replace 'libdir=''${prefix}/@CMAKE_INSTALL_LIBDIR@' 'libdir=@CMAKE_INSTALL_FULL_LIBDIR@' \
      --replace 'includedir=''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@' 'includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@'
  '';

  cmakeFlags = [
    "-DUSE_SYSTEM_BOOST=1"
    "-DUSE_SYSTEM_LIBARCHIVE=1"
    "-DUSE_SYSTEM_SQUASHFUSE=1"
    "-DUSE_SYSTEM_XDGUTILS=1"
    "-DUSE_SYSTEM_XZ=1"
  ];

  nativeBuildInputs = [
    cmake
    autoconf
    automake
    libtool
    pkg-config
  ];

  buildInputs = [
    boost
    fuse
    libarchive
    squashfuse
    xdg-utils-cxx
  ];

  propagatedBuildInputs = [
    cairo
    glib
    librsvg
    zlib
  ];

  strictDeps = true;

  meta = with lib; {
    description = "Implements functionality for dealing with AppImage files";
    homepage = "https://github.com/AppImageCommunity/libappimage/";
    license = licenses.mit;
    maintainers = with maintainers; [ k900 ];
    platforms = platforms.linux;
  };
}