Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / graphics / write_stylus / default.nix
blobbe20635c50018c224905a422d35334cfec91a9a2
1 { mkDerivation, stdenv, lib, qtbase, qtsvg, libglvnd, libX11, libXi, fetchurl, makeDesktopItem }:
2 let
3   desktopItem = makeDesktopItem {
4     name = "Write";
5     exec = "Write";
6     comment = "A word processor for handwriting";
7     icon = "write_stylus";
8     desktopName = "Write";
9     genericName = "Write";
10     categories = [ "Office" "Graphics" ];
11   };
13 mkDerivation rec {
14   pname = "write_stylus";
15   version = "300";
17   src = fetchurl {
18     url = "http://www.styluslabs.com/write/write${version}.tar.gz";
19     sha256 = "0h1wf3af7jzp3f3l8mlnshi83d7a4v4y8nfqfai4lmskyicqlz7c";
20   };
22   sourceRoot = ".";
24   dontBuild = true;
26   installPhase = ''
27     mkdir -p $out/bin
28     cp -R Write $out/
29     # symlink the binary to bin/
30     ln -s $out/Write/Write $out/bin/Write
32     # Create desktop item
33     mkdir -p $out/share/applications
34     ln -s ${desktopItem}/share/applications/* $out/share/applications/
35     mkdir -p $out/share/icons
36     ln -s $out/Write/Write144x144.png $out/share/icons/write_stylus.png
37   '';
38   preFixup = let
39     libPath = lib.makeLibraryPath [
40       qtbase            # libQt5PrintSupport.so.5
41       qtsvg             # libQt5Svg.so.5
42       stdenv.cc.cc.lib  # libstdc++.so.6
43       libglvnd          # libGL.so.1
44       libX11            # libX11.so.6
45       libXi             # libXi.so.6
46     ];
47   in ''
48     patchelf \
49       --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
50       --set-rpath "${libPath}" \
51       $out/Write/Write
52   '';
54   meta = with lib; {
55     homepage = "http://www.styluslabs.com/";
56     description = "Write is a word processor for handwriting";
57     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
58     platforms = platforms.linux;
59     license = lib.licenses.unfree;
60     maintainers = with maintainers; [ oyren ];
61   };