1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5
6 cmake,
7 gettext,
8 wrapGAppsHook3,
9 pkg-config,
10
11 adwaita-icon-theme,
12 alsa-lib,
13 binutils,
14 glib,
15 gsettings-desktop-schemas,
16 gtk3,
17 gtksourceview4,
18 librsvg,
19 libsndfile,
20 libxml2,
21 libzip,
22 pcre,
23 poppler,
24 portaudio,
25 zlib,
26 # plugins
27 withLua ? true,
28 lua,
29}:
30
31stdenv.mkDerivation rec {
32 pname = "xournalpp";
33 version = "1.2.7";
34
35 src = fetchFromGitHub {
36 owner = "xournalpp";
37 repo = "xournalpp";
38 rev = "v${version}";
39 hash = "sha256-Jum9DEbwTtiT0mlrBCBJ0XHhH+DnhXf/AnthZ+qKSZg=";
40 };
41
42 postPatch = ''
43 substituteInPlace src/util/Stacktrace.cpp \
44 --replace-fail "addr2line" "${binutils}/bin/addr2line"
45 '';
46
47 nativeBuildInputs = [
48 cmake
49 gettext
50 pkg-config
51 wrapGAppsHook3
52 ];
53
54 buildInputs =
55 lib.optionals stdenv.hostPlatform.isLinux [
56 alsa-lib
57 ]
58 ++ [
59 glib
60 gsettings-desktop-schemas
61 gtk3
62 gtksourceview4
63 librsvg
64 libsndfile
65 libxml2
66 libzip
67 pcre
68 poppler
69 portaudio
70 zlib
71 ]
72 ++ lib.optional withLua lua;
73
74 buildFlags = [ "translations" ];
75
76 preFixup = ''
77 gappsWrapperArgs+=(
78 --prefix XDG_DATA_DIRS : "${adwaita-icon-theme}/share"
79 )
80 '';
81
82 meta = {
83 description = "Xournal++ is a handwriting Notetaking software with PDF annotation support";
84 homepage = "https://xournalpp.github.io/";
85 changelog = "https://github.com/xournalpp/xournalpp/blob/v${version}/CHANGELOG.md";
86 license = lib.licenses.gpl2Plus;
87 maintainers = with lib.maintainers; [ sikmir ];
88 platforms = lib.platforms.unix;
89 mainProgram = "xournalpp";
90 };
91}