@@ -0,0 +1,43 @@
1+{ stdenv, fetchurl }:
2+
3+stdenv.mkDerivation rec {
4+ name = "wallabag-${version}";
5+ version = "2.1.2";
6+
7+ # remember to rm -r var/cache/* after a rebuild or unexpected errors will occur
8+
9+ src = fetchurl {
10+ url = "https://framabag.org/wallabag-release-${version}.tar.gz";
11+ sha256 = "01i4xdzw126wwwkxy0d97dizrikvawpzqj95bykd1g25m7jzvb7k";
12+ };
13+
14+ outputs = [ "out" "doc" ];
15+
16+ patchPhase = ''
17+ rm Makefile # use the "shared hosting" package with bundled dependencies
18+ substituteInPlace app/AppKernel.php \
19+ --replace "__DIR__" "getenv('WALLABAG_DATA')"
20+ substituteInPlace var/bootstrap.php.cache \
21+ --replace "\$this->rootDir = \$this->getRootDir()" "\$this->rootDir = getenv('WALLABAG_DATA')"
22+ ''; # exposes $WALLABAG_DATA
23+
24+ installPhase = ''
25+ mv docs $doc/
26+ mkdir $out/
27+ cp -R * $out/
28+ '';
29+
30+ meta = with stdenv.lib; {
31+ description = "Web page archiver";
32+ longDescription = ''
33+ wallabag is a self hostable application for saving web pages.
34+
35+ To use, point the environment variable $WALLABAG_DATA to a directory called `app` that contains the folder `config` with wallabag's configuration files. These need to be updated every package upgrade. In `app`'s parent folder, a directory called `var` containing wallabag's data will be created.
36+ After a package upgrade, empty the `var/cache` folder.
37+ '';
38+ license = licenses.mit;
39+ homepage = http://wallabag.org;
40+ platforms = platforms.all;
41+ };
42+}
43+