nixpkgs/pkgs/by-name/ca/castopod/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.8 KiB
Nix
Raw Normal View History

2023-03-13 18:53:59 +00:00
{ stdenv
, fetchurl
, ffmpeg-headless
, lib
2023-04-07 13:36:13 +00:00
, nixosTests
, dataDir ? "/var/lib/castopod"
2023-03-13 18:53:59 +00:00
}:
stdenv.mkDerivation {
pname = "castopod";
2024-04-20 11:22:35 +00:00
version = "1.11.0";
2023-03-13 18:53:59 +00:00
src = fetchurl {
2024-04-20 11:22:35 +00:00
url = "https://code.castopod.org/adaures/castopod/uploads/0f1fbf6eb849b208e26b53d930b9e22f/castopod-1.11.0.tar.gz";
sha256 = "09l4q8v809jnvgx9vpa1fyjhgqdbbrwkyk591kx5k1gg935rmgnx";
2023-03-13 18:53:59 +00:00
};
dontBuild = true;
dontFixup = true;
postPatch = ''
# not configurable at runtime unfortunately:
substituteInPlace app/Config/Paths.php \
--replace "__DIR__ . '/../../writable'" "'${dataDir}/writable'"
2023-03-13 18:53: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-03-13 18:53:59 +00:00
substituteInPlace modules/Install/Controllers/InstallController.php \
--replace "ROOTPATH" "'${dataDir}/'"
2023-03-13 18:53:59 +00:00
substituteInPlace public/index.php spark \
--replace "DotEnv(ROOTPATH)" "DotEnv('${dataDir}')"
2023-03-13 18:53:59 +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
'';
2023-04-07 13:36:13 +00:00
passthru.tests.castopod = nixosTests.castopod;
2023-03-13 18:53:59 +00:00
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "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 ];
2023-03-13 18:53:59 +00:00
platforms = platforms.all;
};
}