forked from mirrors/nixpkgs
f8621a2025
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools. This update was made based on information from https://repology.org/metapackage/matomo/versions. These checks were done: - built on NixOS - Warning: no invocation of /nix/store/r4kflygmbi1z0vl2gp5b64h5dnbw0zps-matomo-3.5.1/bin/matomo-console had a zero exit code or showed the expected version - 0 of 1 passed binary check by having a zero exit code. - 0 of 1 passed binary check by having the new version present in output. - found 3.5.1 with grep in /nix/store/r4kflygmbi1z0vl2gp5b64h5dnbw0zps-matomo-3.5.1 - directory tree listing: https://gist.github.com/1ab3b04c7d594c57458b6d4ef8e65867 - du listing: https://gist.github.com/c105a7109ba84d6e2715bc3800c66780
61 lines
2.2 KiB
Nix
61 lines
2.2 KiB
Nix
{ stdenv, fetchurl, makeWrapper, php }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "matomo-${version}";
|
|
version = "3.5.1";
|
|
|
|
src = fetchurl {
|
|
# TODO: As soon as the tarballs are renamed as well on future releases, this should be enabled again
|
|
# url = "https://builds.matomo.org/${name}.tar.gz";
|
|
url = "https://builds.matomo.org/piwik-${version}.tar.gz";
|
|
sha256 = "0ifrgaw30h4d6hwwzrz8i9k036dxzkxgh71y9s0ds10lhr8vidym";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
# make-localhost-default-database-server.patch:
|
|
# 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
|
|
patches = [ ./make-localhost-default-database-host.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 evertything 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 copied to PIWIK_USER_PATH anyway
|
|
mv $out/share/config $out/
|
|
|
|
makeWrapper ${php}/bin/php $out/bin/matomo-console \
|
|
--add-flags "$out/share/console"
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "A real-time web analytics application";
|
|
license = licenses.gpl3Plus;
|
|
homepage = https://matomo.org/;
|
|
platforms = platforms.all;
|
|
maintainers = [ maintainers.florianjacob ];
|
|
};
|
|
}
|