3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/web-apps/mediawiki/default.nix

40 lines
1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, makeWrapper, writeText }:
2019-06-06 02:17:38 +01:00
stdenv.mkDerivation rec {
pname = "mediawiki";
2020-10-03 17:29:20 +01:00
version = "1.35.0";
2019-06-06 02:17:38 +01:00
2021-01-15 07:07:56 +00:00
src = with lib; fetchurl {
2019-06-06 02:17:38 +01:00
url = "https://releases.wikimedia.org/mediawiki/${versions.majorMinor version}/${pname}-${version}.tar.gz";
2020-10-03 17:29:20 +01:00
sha256 = "1m1f7yaabmfpp3ma394j9nqhx9xv47vpbc48qrbknlq3xhfvqzrs";
2019-06-06 02:17:38 +01: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
'';
meta = with lib; {
2019-06-06 02:17:38 +01:00
description = "The collaborative editing software that runs Wikipedia";
license = licenses.gpl2Plus;
homepage = "https://www.mediawiki.org/";
platforms = platforms.all;
maintainers = [ maintainers.redvers ];
};
}