1{ lib
2, stdenv
3, fetchurl
4, fetchpatch
5}:
6
7# Point the environment variable $WALLABAG_DATA to a data directory
8# that contains the folder `app` which must be a clone of
9# wallabag's configuration files with your customized `parameters.yml`.
10# In practice you need to copy `${pkgs.wallabag}/app` and the
11# customizzed `parameters.yml` to $WALLABAG_DATA.
12# These need to be updated every package upgrade.
13#
14# After a package upgrade, empty the `var/cache` folder or unexpected
15# error will occur.
16
17let
18 pname = "wallabag";
19 version = "2.5.4";
20in
21stdenv.mkDerivation {
22 inherit pname version;
23
24 # Release tarball includes vendored files
25 src = fetchurl {
26 urls = [
27 "https://static.wallabag.org/releases/wallabag-release-${version}.tar.gz"
28 "https://github.com/wallabag/wallabag/releases/download/${version}/wallabag-${version}.tar.gz"
29 ];
30 hash = "sha256-yVMQXjGB8Yv1klQaHEbDGMZmOtANRocFJnawKn10xhg=";
31 };
32
33 patches = [
34 ./wallabag-data.patch # exposes $WALLABAG_DATA
35
36 # Use sendmail from php.ini instead of FHS path.
37 (fetchpatch {
38 url = "https://github.com/symfony/swiftmailer-bundle/commit/31a4fed8f621f141ba70cb42ffb8f73184995f4c.patch";
39 stripLen = 1;
40 extraPrefix = "vendor/symfony/swiftmailer-bundle/";
41 sha256 = "rxHiGhKFd/ZWnIfTt6omFLLoNFlyxOYNCHIv/UtxCho=";
42 })
43 ];
44
45 dontBuild = true;
46
47 installPhase = ''
48 runHook preInstall
49
50 mkdir $out
51 cp -R * $out/
52
53 runHook postInstall
54 '';
55
56 meta = with lib; {
57 description = "wallabag is a self hostable application for saving web pages";
58 longDescription = ''
59 wallabag is a self-hostable PHP application allowing you to not
60 miss any content anymore. Click, save and read it when you can.
61 It extracts content so that you can read it when you have time.
62 '';
63 license = licenses.mit;
64 homepage = "http://wallabag.org";
65 changelog = "https://github.com/wallabag/wallabag/releases/tag/${version}";
66 maintainers = with maintainers; [ schneefux ];
67 platforms = platforms.all;
68 };
69}