2021-06-28 23:13:55 +00:00
|
|
|
{ lib, stdenv, fetchurl, writeText }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mediawiki";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "1.37.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
src = with lib; fetchurl {
|
2020-04-24 23:36:52 +00:00
|
|
|
url = "https://releases.wikimedia.org/mediawiki/${versions.majorMinor version}/${pname}-${version}.tar.gz";
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "sha256-U0NuktwwrbFLZ5fYE50gaWpUYVJfOKN1yD5DXPBC4uc=";
|
2020-04-24 23:36:52 +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-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The collaborative editing software that runs Wikipedia";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
homepage = "https://www.mediawiki.org/";
|
|
|
|
platforms = platforms.all;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|