nixpkgs/pkgs/servers/web-apps/mediawiki/default.nix

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

42 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, writeText, nixosTests }:
2019-06-06 01:17:38 +00:00
stdenv.mkDerivation rec {
pname = "mediawiki";
version = "1.39.3";
2019-06-06 01:17:38 +00:00
2022-06-22 18:05:02 +00:00
src = fetchurl {
url = "https://releases.wikimedia.org/mediawiki/${lib.versions.majorMinor version}/mediawiki-${version}.tar.gz";
hash = "sha256-41dpNDh2r0JJbaQ64vRyJPuMd5uPRXBcQUfG/zUizB0=";
2019-06-06 01:17:38 +00:00
};
2022-06-22 18:05:02 +00:00
postPatch = ''
2019-06-06 01:17:38 +00:00
sed -i 's|$vars = Installer::getExistingLocalSettings();|$vars = null;|' includes/installer/CliInstaller.php
'';
2022-06-22 18:05:02 +00:00
installPhase = let
phpConfig = writeText "LocalSettings.php" ''
<?php
return require(getenv('MEDIAWIKI_CONFIG'));
?>
'';
in ''
2019-06-06 01:17:38 +00:00
runHook preInstall
mkdir -p $out/share/mediawiki
cp -r * $out/share/mediawiki
cp ${phpConfig} $out/share/mediawiki/LocalSettings.php
runHook postInstall
'';
passthru.tests.mediawiki = nixosTests.mediawiki;
meta = with lib; {
2019-06-06 01:17:38 +00:00
description = "The collaborative editing software that runs Wikipedia";
license = licenses.gpl2Plus;
homepage = "https://www.mediawiki.org/";
platforms = platforms.all;
2022-06-22 18:05:02 +00:00
maintainers = with maintainers; [ ] ++ teams.c3d2.members;
2019-06-06 01:17:38 +00:00
};
}