nixpkgs/pkgs/servers/web-apps/mediawiki/default.nix
2019-10-18 19:15:42 -04:00

40 lines
1.0 KiB
Nix

{ stdenv, fetchurl, makeWrapper, writeText }:
stdenv.mkDerivation rec {
pname = "mediawiki";
version = "1.33.1";
src = with stdenv.lib; fetchurl {
url = "https://releases.wikimedia.org/mediawiki/${versions.majorMinor version}/${pname}-${version}.tar.gz";
sha256 = "19x10vsgg2fhcpmfvdswwilqwa65byrsmzvhk2v8bsxzhp6s95vx";
};
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 stdenv.lib; {
description = "The collaborative editing software that runs Wikipedia";
license = licenses.gpl2Plus;
homepage = "https://www.mediawiki.org/";
platforms = platforms.all;
maintainers = [ maintainers.redvers ];
};
}