uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
62
pkgs/servers/web-apps/moodle/default.nix
Normal file
62
pkgs/servers/web-apps/moodle/default.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{ lib, stdenv, fetchurl, writeText, plugins ? [ ] }:
|
||||
|
||||
let
|
||||
version = "3.11.6";
|
||||
stableVersion = lib.concatStrings (lib.take 2 (lib.splitVersion version));
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "moodle";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.moodle.org/stable${stableVersion}/${pname}-${version}.tgz";
|
||||
sha256 = "sha256-g3qHYkxiXb18vJ23THUw8ej+s5SgIkJpmjQmmARwQhs=";
|
||||
};
|
||||
|
||||
phpConfig = writeText "config.php" ''
|
||||
<?php
|
||||
return require(getenv('MOODLE_CONFIG'));
|
||||
?>
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/share/moodle
|
||||
cp -r . $out/share/moodle
|
||||
cp ${phpConfig} $out/share/moodle/config.php
|
||||
|
||||
${lib.concatStringsSep "\n" (map (p:
|
||||
let
|
||||
dir = if p.pluginType == "mod" then
|
||||
"mod"
|
||||
else if p.pluginType == "theme" then
|
||||
"theme"
|
||||
else if p.pluginType == "block" then
|
||||
"blocks"
|
||||
else if p.pluginType == "question" then
|
||||
"question/type"
|
||||
else if p.pluginType == "course" then
|
||||
"course/format"
|
||||
else if p.pluginType == "report" then
|
||||
"admin/report"
|
||||
else
|
||||
throw "unknown moodle plugin type";
|
||||
# we have to copy it, because the plugins have refrences to .. inside
|
||||
in ''
|
||||
mkdir -p $out/share/moodle/${dir}/${p.name}
|
||||
cp -r ${p}/* $out/share/moodle/${dir}/${p.name}/
|
||||
'') plugins)}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description =
|
||||
"Free and open-source learning management system (LMS) written in PHP";
|
||||
license = licenses.gpl3Plus;
|
||||
homepage = "https://moodle.org/";
|
||||
maintainers = with maintainers; [ freezeboy ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
33
pkgs/servers/web-apps/moodle/moodle-utils.nix
Normal file
33
pkgs/servers/web-apps/moodle/moodle-utils.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ stdenv, unzip, ... }:
|
||||
|
||||
let
|
||||
buildMoodlePlugin = a@{
|
||||
name,
|
||||
src,
|
||||
pluginType,
|
||||
configurePhase ? ":",
|
||||
buildPhase ? ":",
|
||||
buildInputs ? [ ],
|
||||
nativeBuildInputs ? [ ],
|
||||
...
|
||||
}:
|
||||
stdenv.mkDerivation (a // {
|
||||
name = name;
|
||||
|
||||
inherit pluginType;
|
||||
inherit configurePhase buildPhase buildInputs;
|
||||
|
||||
nativeBuildInputs = [ unzip ] ++ nativeBuildInputs;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p "$out"
|
||||
mv * $out/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
in {
|
||||
inherit buildMoodlePlugin;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue