mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-20 04:31:52 +00:00
40 lines
1 KiB
Nix
40 lines
1 KiB
Nix
{ lib, stdenv, fetchurl, writeText }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "mediawiki";
|
|
version = "1.37.1";
|
|
|
|
src = with lib; fetchurl {
|
|
url = "https://releases.wikimedia.org/mediawiki/${versions.majorMinor version}/${pname}-${version}.tar.gz";
|
|
sha256 = "sha256-U0NuktwwrbFLZ5fYE50gaWpUYVJfOKN1yD5DXPBC4uc=";
|
|
};
|
|
|
|
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
|
|
'';
|
|
|
|
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; [ ];
|
|
};
|
|
}
|