ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / ca / castopod / package.nix
blob3f098c3653444beedb3b38333c95df38e2870a7e
1 { stdenv
2 , fetchurl
3 , ffmpeg-headless
4 , lib
5 , nixosTests
6 , dataDir ? "/var/lib/castopod"
7 }:
8 stdenv.mkDerivation {
9   pname = "castopod";
10   version = "1.11.0";
12   src = fetchurl {
13     url = "https://code.castopod.org/adaures/castopod/uploads/0f1fbf6eb849b208e26b53d930b9e22f/castopod-1.11.0.tar.gz";
14     sha256 = "09l4q8v809jnvgx9vpa1fyjhgqdbbrwkyk591kx5k1gg935rmgnx";
15   };
17   dontBuild = true;
18   dontFixup = true;
20   postPatch = ''
21     # not configurable at runtime unfortunately:
22     substituteInPlace app/Config/Paths.php \
23       --replace "__DIR__ . '/../../writable'" "'${dataDir}/writable'"
25     substituteInPlace modules/Admin/Controllers/DashboardController.php \
26       --replace "disk_total_space('./')" "disk_total_space('${dataDir}')"
28     # configuration file must be writable, place it to ${dataDir}
29     substituteInPlace modules/Install/Controllers/InstallController.php \
30       --replace "ROOTPATH" "'${dataDir}/'"
31     substituteInPlace public/index.php spark \
32       --replace "DotEnv(ROOTPATH)" "DotEnv('${dataDir}')"
34     # ffmpeg is required for Video Clips feature
35     substituteInPlace modules/MediaClipper/VideoClipper.php \
36       --replace "ffmpeg" "${ffmpeg-headless}/bin/ffmpeg"
37     substituteInPlace modules/Admin/Controllers/VideoClipsController.php \
38       --replace "which ffmpeg" "echo ${ffmpeg-headless}/bin/ffmpeg"
39   '';
41   installPhase = ''
42     mkdir -p $out/share/castopod
43     cp -r . $out/share/castopod
44   '';
46   passthru.tests.castopod = nixosTests.castopod;
47   passthru.updateScript = ./update.sh;
49   meta = with lib; {
50     description = "Open-source hosting platform made for podcasters who want to engage and interact with their audience";
51     homepage = "https://castopod.org";
52     license = licenses.agpl3Only;
53     maintainers = with maintainers; [ alexoundos ];
54     platforms = platforms.all;
55   };