2023-10-09 19:29:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, ffmpeg-headless
|
|
|
|
, lib
|
|
|
|
, nixosTests
|
2024-04-21 15:54:59 +00:00
|
|
|
, dataDir ? "/var/lib/castopod"
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "castopod";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "1.11.0";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-06-05 15:53:02 +00:00
|
|
|
url = "https://code.castopod.org/adaures/castopod/uploads/0f1fbf6eb849b208e26b53d930b9e22f/castopod-1.11.0.tar.gz";
|
|
|
|
sha256 = "09l4q8v809jnvgx9vpa1fyjhgqdbbrwkyk591kx5k1gg935rmgnx";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontFixup = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# not configurable at runtime unfortunately:
|
|
|
|
substituteInPlace app/Config/Paths.php \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace "__DIR__ . '/../../writable'" "'${dataDir}/writable'"
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
substituteInPlace modules/Admin/Controllers/DashboardController.php \
|
|
|
|
--replace "disk_total_space('./')" "disk_total_space('${dataDir}')"
|
|
|
|
|
|
|
|
# configuration file must be writable, place it to ${dataDir}
|
2023-10-09 19:29:22 +00:00
|
|
|
substituteInPlace modules/Install/Controllers/InstallController.php \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace "ROOTPATH" "'${dataDir}/'"
|
2023-10-09 19:29:22 +00:00
|
|
|
substituteInPlace public/index.php spark \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace "DotEnv(ROOTPATH)" "DotEnv('${dataDir}')"
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
# ffmpeg is required for Video Clips feature
|
|
|
|
substituteInPlace modules/MediaClipper/VideoClipper.php \
|
|
|
|
--replace "ffmpeg" "${ffmpeg-headless}/bin/ffmpeg"
|
|
|
|
substituteInPlace modules/Admin/Controllers/VideoClipsController.php \
|
|
|
|
--replace "which ffmpeg" "echo ${ffmpeg-headless}/bin/ffmpeg"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/castopod
|
|
|
|
cp -r . $out/share/castopod
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.castopod = nixosTests.castopod;
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Open-source hosting platform made for podcasters who want to engage and interact with their audience";
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://castopod.org";
|
|
|
|
license = licenses.agpl3Only;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ alexoundos ];
|
2023-10-09 19:29:22 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|