adminneo: 4.17.2 -> 5.1.1
Adminneo has redone the whole structure and removed any naming notion of
adminer. This includes now a different plugin mechanism, a new
configuration mechanism etc.
For this matter:
* Removed support for individualizing plugins (this is better left for a module)
* Removed support for themes (no longer exists in adminneo)
* Removed the special index.php (a link is kept, though)
* Installed all default plugins by default. This does not activate
them.
Other changes:
* Update homepage
* Add myself as maintainer
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace nixos {
|
||||
use AdminerPlugin;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
function adminer_object(): object
|
||||
{
|
||||
require_once __DIR__ . '/plugins/plugin.php';
|
||||
|
||||
if (!file_exists(__DIR__ . '/plugins.json')) {
|
||||
return new AdminerPlugin();
|
||||
}
|
||||
|
||||
$plugins = array_map(
|
||||
static function (string $name): ?object {
|
||||
$plugin = sprintf('%s/plugins/%s.php', __DIR__, $name);
|
||||
|
||||
if (!is_readable($plugin)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
require $plugin;
|
||||
|
||||
preg_match_all('/(\w+)/', $name, $matches);
|
||||
|
||||
return new sprintf('Adminer%s', implode('', array_map('ucfirst', $matches[1])));
|
||||
},
|
||||
json_decode(file_get_contents(sprintf('%s/plugins.json', __DIR__), true))
|
||||
);
|
||||
|
||||
return new AdminerPlugin(array_filter($plugins));
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
function adminer_object() {
|
||||
return \nixos\adminer_object();
|
||||
}
|
||||
|
||||
require(__DIR__ . '/adminer.php');
|
||||
}
|
||||
@@ -3,30 +3,31 @@
|
||||
stdenvNoCC,
|
||||
fetchFromGitHub,
|
||||
php,
|
||||
writeText,
|
||||
nix-update-script,
|
||||
theme ? null,
|
||||
plugins ? [ ],
|
||||
installPlugins ? true,
|
||||
}:
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "adminneo";
|
||||
version = "4.17.2";
|
||||
version = "5.1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "adminneo-org";
|
||||
repo = "adminneo";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-erz/kkaywkuT4k3wg8a48p2pTEqzsr3pHDrtNDtrq2I=";
|
||||
hash = "sha256-ckz0LvKLY6xm3thPmY/ry8G5kkt29rmDsG/D6NNeRoY=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
php
|
||||
];
|
||||
|
||||
# Package provides a Makefile, which is currently broken
|
||||
# https://github.com/adminneo-org/adminneo/issues/161
|
||||
# As soon, as this is fixed, the buildPhase can be removed
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
php compile.php
|
||||
${php}/bin/php bin/compile.php
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
@@ -35,41 +36,29 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
runHook preInstall
|
||||
|
||||
mkdir $out
|
||||
cp export/adminer-${finalAttrs.version}.php $out/adminer.php
|
||||
cp ${./index.php} $out/index.php
|
||||
|
||||
${lib.optionalString (theme != null) ''
|
||||
cp designs/${theme}/adminer.css $out/adminer.css
|
||||
''}
|
||||
|
||||
# Copy base plugin
|
||||
mkdir -p $out/plugins
|
||||
cp plugins/plugin.php $out/plugins/plugin.php
|
||||
|
||||
${lib.optionalString (plugins != [ ]) ''
|
||||
cp plugins/*.php $out/plugins/
|
||||
cp ${writeText "$out/plugins.json" ''
|
||||
${toString (builtins.toJSON plugins)}
|
||||
''} $out/plugins.json
|
||||
''}
|
||||
|
||||
cp compiled/adminneo-${finalAttrs.version}.php $out/adminneo.php
|
||||
# for compatibility
|
||||
ln -s adminneo.php $out/index.php
|
||||
''
|
||||
+ (lib.optionalString installPlugins ''
|
||||
cp -r compiled/adminneo-plugins $out/
|
||||
'')
|
||||
+ ''
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script { };
|
||||
indexPHP = ./index.php;
|
||||
};
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "Database management in a single PHP file (fork of Adminer)";
|
||||
homepage = "https://github.com/adminneo-org/adminneo";
|
||||
homepage = "https://www.adminneo.org/";
|
||||
license = with lib.licenses; [
|
||||
asl20
|
||||
gpl2Only
|
||||
];
|
||||
maintainers = with lib.maintainers; [
|
||||
johnrtitor
|
||||
Necoro
|
||||
];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user