depot/third_party/nixpkgs/pkgs/servers/web-apps/mediawiki/default.nix
Default email 4d5a95770c Project import generated by Copybara.
GitOrigin-RevId: 3c5319ad3aa51551182ac82ea17ab1c6b0f0df89
2023-03-04 15:14:45 +03:00

41 lines
1.1 KiB
Nix

{ lib, stdenv, fetchurl, writeText, nixosTests }:
stdenv.mkDerivation rec {
pname = "mediawiki";
version = "1.39.2";
src = fetchurl {
url = "https://releases.wikimedia.org/mediawiki/${lib.versions.majorMinor version}/mediawiki-${version}.tar.gz";
sha256 = "sha256-3bUdIooZymjNiHHYUBdfa+9Gh0R27RRm8BXPmEbZx6U=";
};
postPatch = ''
sed -i 's|$vars = Installer::getExistingLocalSettings();|$vars = null;|' includes/installer/CliInstaller.php
'';
installPhase = let
phpConfig = writeText "LocalSettings.php" ''
<?php
return require(getenv('MEDIAWIKI_CONFIG'));
?>
'';
in ''
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; {
description = "The collaborative editing software that runs Wikipedia";
license = licenses.gpl2Plus;
homepage = "https://www.mediawiki.org/";
platforms = platforms.all;
maintainers = with maintainers; [ ] ++ teams.c3d2.members;
};
}