1{ lib, stdenv, fetchurl, curl, libmrss, podofo, libiconv }:
2
3stdenv.mkDerivation rec {
4 pname = "offrss";
5 version = "1.3";
6
7 installPhase = ''
8 mkdir -p $out/bin
9 cp offrss $out/bin
10 '';
11
12 buildInputs = [ curl libmrss ]
13 ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) podofo
14 ++ lib.optional (!stdenv.isLinux) libiconv;
15
16 # Workaround build failure on -fno-common toolchains:
17 # ld: serve_pdf.o:offrss.h:75: multiple definition of `cgi_url_path';
18 # offrss.o:offrss.h:75: first defined here
19 env.NIX_CFLAGS_COMPILE = "-fcommon";
20
21 configurePhase = ''
22 substituteInPlace Makefile \
23 --replace '$(CC) $(CFLAGS) $(LDFLAGS)' '$(CXX) $(CFLAGS) $(LDFLAGS)'
24 '' + lib.optionalString (!stdenv.isLinux) ''
25 sed 's/#EXTRA/EXTRA/' -i Makefile
26 '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
27 sed 's/^PDF/#PDF/' -i Makefile
28 '';
29
30 src = fetchurl {
31 url = "http://vicerveza.homeunix.net/~viric/soft/offrss/offrss-${version}.tar.gz";
32 sha256 = "1akw1x84jj2m9z60cvlvmz21qwlaywmw18pl7lgp3bj5nw6250p6";
33 };
34
35 meta = with lib; {
36 homepage = "http://vicerveza.homeunix.net/~viric/cgi-bin/offrss";
37 description = "Offline RSS/Atom reader";
38 license = licenses.agpl3Plus;
39 maintainers = with maintainers; [ viric ];
40 platforms = lib.platforms.linux;
41 };
42}