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
6
pkgs/servers/web-apps/matomo/bootstrap.php
Normal file
6
pkgs/servers/web-apps/matomo/bootstrap.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
// get PIWIK_USER_PATH from environment variable,
|
||||
// so this bootstrap.php can be read-only but still configure PIWIK_USER_PATH at runtime
|
||||
if ($path = getenv('PIWIK_USER_PATH')) {
|
||||
define('PIWIK_USER_PATH', $path);
|
||||
}
|
||||
10
pkgs/servers/web-apps/matomo/change-path-geoip2.patch
Normal file
10
pkgs/servers/web-apps/matomo/change-path-geoip2.patch
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
--- a/plugins/GeoIp2/config/config.php
|
||||
+++ b/plugins/GeoIp2/config/config.php
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
- 'path.geoip2' => DI\string('{path.root}/misc/'),
|
||||
+ 'path.geoip2' => PIWIK_USER_PATH . '/misc/',
|
||||
];
|
||||
\ Pas de fin de ligne à la fin du fichier
|
||||
116
pkgs/servers/web-apps/matomo/default.nix
Normal file
116
pkgs/servers/web-apps/matomo/default.nix
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
{ lib, stdenv, fetchurl, makeWrapper, php }:
|
||||
|
||||
let
|
||||
versions = {
|
||||
matomo = {
|
||||
version = "4.5.0";
|
||||
sha256 = "sha256-OyjdzY+ENYxOTVjDLjj2unJbpaGODIH2I5Acmt45HDA=";
|
||||
};
|
||||
|
||||
matomo-beta = {
|
||||
version = "4.6.0";
|
||||
# `beta` examples: "b1", "rc1", null
|
||||
# when updating: use null if stable version is >= latest beta or release candidate
|
||||
beta = "b2";
|
||||
sha256 = "sha256-7p/ZPtr5a/tBjrM27ILF3rNfxDIWuzWKCXNom3HlyL8=";
|
||||
};
|
||||
};
|
||||
common = pname: { version, sha256, beta ? null }:
|
||||
let
|
||||
fullVersion = version + lib.optionalString (beta != null) "-${toString beta}";
|
||||
name = "${pname}-${fullVersion}";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
inherit name;
|
||||
version = fullVersion;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://builds.matomo.org/matomo-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
patches = [
|
||||
# This changes the default value of the database server field
|
||||
# from 127.0.0.1 to localhost.
|
||||
# unix socket authentication only works with localhost,
|
||||
# but password-based SQL authentication works with both.
|
||||
# TODO: is upstream interested in this?
|
||||
# -> discussion at https://github.com/matomo-org/matomo/issues/12646
|
||||
./make-localhost-default-database-host.patch
|
||||
|
||||
# This changes the default config for path.geoip2 so that it doesn't point
|
||||
# to the nix store.
|
||||
./change-path-geoip2.patch
|
||||
];
|
||||
|
||||
# this bootstrap.php adds support for getting PIWIK_USER_PATH
|
||||
# from an environment variable. Point it to a mutable location
|
||||
# to be able to use matomo read-only from the nix store
|
||||
postPatch = ''
|
||||
cp ${./bootstrap.php} bootstrap.php
|
||||
'';
|
||||
|
||||
# TODO: future versions might rename the PIWIK_… variables to MATOMO_…
|
||||
# TODO: Move more unnecessary files from share/, especially using PIWIK_INCLUDE_PATH.
|
||||
# See https://forum.matomo.org/t/bootstrap-php/5926/10 and
|
||||
# https://github.com/matomo-org/matomo/issues/11654#issuecomment-297730843
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
# copy everything to share/, used as webroot folder, and then remove what's known to be not needed
|
||||
mkdir -p $out/share
|
||||
cp -ra * $out/share/
|
||||
# tmp/ is created by matomo in PIWIK_USER_PATH
|
||||
rmdir $out/share/tmp
|
||||
# config/ needs to be accessed by PIWIK_USER_PATH anyway
|
||||
ln -s $out/share/config $out/
|
||||
|
||||
makeWrapper ${php}/bin/php $out/bin/matomo-console \
|
||||
--add-flags "$out/share/console"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
filesToFix = [
|
||||
"misc/composer/build-xhprof.sh"
|
||||
"misc/composer/clean-xhprof.sh"
|
||||
"misc/cron/archive.sh"
|
||||
"plugins/GeoIp2/config/config.php"
|
||||
"plugins/Installation/FormDatabaseSetup.php"
|
||||
"vendor/pear/archive_tar/sync-php4"
|
||||
"vendor/szymach/c-pchart/coverage.sh"
|
||||
"vendor/matomo/matomo-php-tracker/run_tests.sh"
|
||||
"vendor/twig/twig/drupal_test.sh"
|
||||
];
|
||||
|
||||
# This fixes the consistency check in the admin interface
|
||||
#
|
||||
# The filesToFix list may contain files that are exclusive to only one of the versions we build
|
||||
# make sure to test for existence to avoid erroring on an incompatible version and failing
|
||||
postFixup = ''
|
||||
pushd $out/share > /dev/null
|
||||
for f in $filesToFix; do
|
||||
if [ -f "$f" ]; then
|
||||
length="$(wc -c "$f" | cut -d' ' -f1)"
|
||||
hash="$(md5sum "$f" | cut -d' ' -f1)"
|
||||
sed -i "s:\\(\"$f\"[^(]*(\\).*:\\1\"$length\", \"$hash\"),:g" config/manifest.inc.php
|
||||
else
|
||||
echo "INFO(files-to-fix): $f does not exist in this version"
|
||||
fi
|
||||
done
|
||||
popd > /dev/null
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A real-time web analytics application";
|
||||
license = licenses.gpl3Plus;
|
||||
homepage = "https://matomo.org/";
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ florianjacob kiwi sebbel ];
|
||||
};
|
||||
};
|
||||
in
|
||||
lib.mapAttrs common versions
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/plugins/Installation/FormDatabaseSetup.php b/plugins/Installation/FormDatabaseSetup.php
|
||||
index 74de2535b4..bc172ad0eb 100644
|
||||
--- a/plugins/Installation/FormDatabaseSetup.php
|
||||
+++ b/plugins/Installation/FormDatabaseSetup.php
|
||||
@@ -82,7 +82,7 @@ class FormDatabaseSetup extends QuickForm2
|
||||
|
||||
|
||||
$defaults = array(
|
||||
- 'host' => '127.0.0.1',
|
||||
+ 'host' => 'localhost',
|
||||
'type' => $defaultDatabaseType,
|
||||
'tables_prefix' => 'matomo_',
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue