2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeDesktopItem
|
2020-04-24 23:36:52 +00:00
|
|
|
, ghostscript, atk, gtk2, glib, fontconfig, freetype
|
|
|
|
, libgnomecanvas, libgnomeprint, libgnomeprintui
|
|
|
|
, pango, libX11, xorgproto, zlib, poppler
|
2021-02-05 17:12:51 +00:00
|
|
|
, autoconf, automake, libtool, pkg-config}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
isGdkQuartzBackend = (gtk2.gdktarget == "quartz");
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "0.4.8.2016";
|
2022-03-30 09:31:56 +00:00
|
|
|
pname = "xournal";
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2022-03-30 09:31:56 +00:00
|
|
|
url = "mirror://sourceforge/xournal/xournal-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ghostscript atk gtk2 glib fontconfig freetype
|
|
|
|
libgnomecanvas
|
|
|
|
pango libX11 xorgproto zlib poppler
|
2021-01-17 00:15:33 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
2020-04-24 23:36:52 +00:00
|
|
|
libgnomeprint libgnomeprintui
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoconf automake libtool pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
NIX_LDFLAGS = "-lz"
|
2021-01-17 00:15:33 +00:00
|
|
|
+ lib.optionalString (!isGdkQuartzBackend) " -lX11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
2022-03-30 09:31:56 +00:00
|
|
|
name = "xournal-${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
exec = "xournal";
|
|
|
|
icon = "xournal";
|
|
|
|
desktopName = "Xournal";
|
|
|
|
comment = meta.description;
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Office" "Graphics" ];
|
|
|
|
mimeTypes = [ "application/pdf" "application/x-xoj" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
genericName = "PDF Editor";
|
|
|
|
};
|
|
|
|
|
|
|
|
postInstall=''
|
|
|
|
mkdir --parents $out/share/mime/packages
|
|
|
|
cat << EOF > $out/share/mime/packages/xournal.xml
|
|
|
|
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
|
|
|
|
<mime-type type="application/x-xoj">
|
|
|
|
<comment>Xournal Document</comment>
|
|
|
|
<glob pattern="*.xoj"/>
|
|
|
|
</mime-type>
|
|
|
|
</mime-info>
|
|
|
|
EOF
|
|
|
|
cp --recursive ${desktopItem}/share/applications $out/share
|
|
|
|
mkdir --parents $out/share/icons
|
|
|
|
cp $out/share/xournal/pixmaps/xournal.png $out/share/icons
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://xournal.sourceforge.net/";
|
|
|
|
description = "Note-taking application (supposes stylus)";
|
|
|
|
maintainers = [ maintainers.guibert ];
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
};
|
|
|
|
}
|