2023-03-04 12:14:45 +00:00
|
|
|
{ lib, stdenv, fetchurl, writeText, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mediawiki";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "1.39.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://releases.wikimedia.org/mediawiki/${lib.versions.majorMinor version}/mediawiki-${version}.tar.gz";
|
2023-03-04 12:14:45 +00:00
|
|
|
sha256 = "sha256-3bUdIooZymjNiHHYUBdfa+9Gh0R27RRm8BXPmEbZx6U=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i 's|$vars = Installer::getExistingLocalSettings();|$vars = null;|' includes/installer/CliInstaller.php
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
installPhase = let
|
|
|
|
phpConfig = writeText "LocalSettings.php" ''
|
|
|
|
<?php
|
|
|
|
return require(getenv('MEDIAWIKI_CONFIG'));
|
|
|
|
?>
|
|
|
|
'';
|
|
|
|
in ''
|
2020-04-24 23:36:52 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/share/mediawiki
|
|
|
|
cp -r * $out/share/mediawiki
|
|
|
|
cp ${phpConfig} $out/share/mediawiki/LocalSettings.php
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
passthru.tests.mediawiki = nixosTests.mediawiki;
|
|
|
|
|
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;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ ] ++ teams.c3d2.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|