2021-06-25 10:48:39 +00:00
|
|
|
{ lib, stdenv, fetchurl, writeText }:
|
2019-06-06 01:17:38 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mediawiki";
|
2021-06-25 10:48:39 +00:00
|
|
|
version = "1.36.1";
|
2019-06-06 01:17:38 +00:00
|
|
|
|
2021-01-15 07:07:56 +00:00
|
|
|
src = with lib; fetchurl {
|
2019-06-06 01:17:38 +00:00
|
|
|
url = "https://releases.wikimedia.org/mediawiki/${versions.majorMinor version}/${pname}-${version}.tar.gz";
|
2021-06-25 10:48:39 +00:00
|
|
|
sha256 = "0ymda3x58a7ic4bwhbkxc7rskkwn164nplxzq9g4w9qnmwcqnsg6";
|
2019-06-06 01:17:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
sed -i 's|$vars = Installer::getExistingLocalSettings();|$vars = null;|' includes/installer/CliInstaller.php
|
|
|
|
'';
|
|
|
|
|
|
|
|
phpConfig = writeText "LocalSettings.php" ''
|
|
|
|
<?php
|
|
|
|
return require(getenv('MEDIAWIKI_CONFIG'));
|
|
|
|
?>
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/share/mediawiki
|
|
|
|
cp -r * $out/share/mediawiki
|
|
|
|
cp ${phpConfig} $out/share/mediawiki/LocalSettings.php
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
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;
|
|
|
|
maintainers = [ maintainers.redvers ];
|
|
|
|
};
|
|
|
|
}
|