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-04-21 15:54:59 +00:00
|
|
|
version = "1.10.5";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-04-21 15:54:59 +00:00
|
|
|
url = "https://code.castopod.org/adaures/castopod/uploads/66de724407be8f940af5eb1d633fbbc3/castopod-1.10.5.tar.gz";
|
|
|
|
sha256 = "0ssdgqxqldg2f6ni54k5vlndnjjy9lah47q1crpz5nnkkjgvc96y";
|
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; {
|
|
|
|
description = "An open-source hosting platform made for podcasters who want to engage and interact with their audience";
|
|
|
|
homepage = "https://castopod.org";
|
|
|
|
license = licenses.agpl3Only;
|
|
|
|
maintainers = with maintainers; [ alexoundos misuzu ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|