···88 fetchNpmDeps,
99 jq,
1010 nixosTests,
1111+1212+ versionInfo ? {
1313+ # ESR releases only.
1414+ # See https://docs.mattermost.com/upgrade/extended-support-release.html
1515+ # When a new ESR version is available (e.g. 8.1.x -> 9.5.x), update
1616+ # the version regex here as well.
1717+ #
1818+ # Ensure you also check ../mattermostLatest/package.nix.
1919+ regex = "^v(9\.11\.[0-9]+)$";
2020+ version = "9.11.7";
2121+ srcHash = "sha256-KeGpYy3jr7/B2mtBk9em2MXJBJR2+Wajmvtz/yT4SG8=";
2222+ vendorHash = "sha256-alLPBfnA1o6bUUgPRqvYW/98UKR9wltmFTzKIGtVEm4=";
2323+ npmDepsHash = "sha256-ysz38ywGxJ5DXrrcDmcmezKbc5Y7aug9jOWUzHRAs/0=";
2424+ },
1125}:
12261327buildGoModule rec {
1428 pname = "mattermost";
1515- # ESR releases only.
1616- # See https://docs.mattermost.com/upgrade/extended-support-release.html
1717- # When a new ESR version is available (e.g. 8.1.x -> 9.5.x), update
1818- # the version regex in passthru.updateScript as well.
1919- version = "9.11.6";
2929+ inherit (versionInfo) version;
20302131 src = fetchFromGitHub {
2232 owner = "mattermost";
2333 repo = "mattermost";
2424- rev = "v${version}";
2525- hash = "sha256-G9RYktnnVXdhNWp8q+bNbdlHB9ZOGtnESnZVOA7lDvE=";
3434+ tag = "v${version}";
3535+ hash = versionInfo.srcHash;
2636 postFetch = ''
2737 cd $out/webapp
2838···3141 def desuffix(version): version | gsub("^(?<prefix>[^\\+]+)\\+.*$"; "\(.prefix)");
3242 .packages |= map_values(if has("version") then .version = desuffix(.version) else . end)
3343 ' < package-lock.json > package-lock.fixed.json
4444+4545+ # Run the lockfile overlay, if present.
4646+ ${lib.optionalString (versionInfo.lockfileOverlay or null != null) ''
4747+ ${lib.getExe jq} ${lib.escapeShellArg ''
4848+ # Unlock a dependency and let npm-lockfile-fix relock it.
4949+ def unlock(root; dependency; path):
5050+ root | .packages[path] |= del(.resolved, .integrity)
5151+ | .packages[path].version = root.packages.channels.dependencies[dependency];
5252+ ${versionInfo.lockfileOverlay}
5353+ ''} < package-lock.fixed.json > package-lock.overlaid.json
5454+ mv package-lock.overlaid.json package-lock.fixed.json
5555+ ''}
3456 ${lib.getExe npm-lockfile-fix} package-lock.fixed.json
35573658 rm -f package-lock.json
···5476 npmDeps = fetchNpmDeps {
5577 inherit src;
5678 sourceRoot = "${src.name}/webapp";
5757- hash = "sha256-ysz38ywGxJ5DXrrcDmcmezKbc5Y7aug9jOWUzHRAs/0=";
7979+ hash = versionInfo.npmDepsHash;
5880 makeCacheWritable = true;
5981 forceGitDeps = true;
6082 };
···99121 '';
100122 };
101123102102- vendorHash = "sha256-Gwv6clnq7ihoFC8ox8iEM5xp/us9jWUrcmqA9/XbxBE=";
124124+ inherit (versionInfo) vendorHash;
103125104126 modRoot = "./server";
105127 preBuild = ''
···142164143165 passthru = {
144166 updateScript = nix-update-script {
145145- extraArgs = [
146146- "--version-regex"
147147- "^v(9\.11\.[0-9]+)$"
148148- ];
167167+ extraArgs =
168168+ [
169169+ "--version-regex"
170170+ versionInfo.regex
171171+ ]
172172+ ++ lib.optionals (versionInfo.autoUpdate or null != null) [
173173+ "--override-filename"
174174+ versionInfo.autoUpdate
175175+ ];
149176 };
150177 tests.mattermost = nixosTests.mattermost;
151178 };
+23
pkgs/by-name/ma/mattermostLatest/package.nix
···11+{
22+ mattermost,
33+}:
44+55+mattermost.override {
66+ versionInfo = {
77+ # Latest, non-RC releases only.
88+ # If the latest is an ESR (Extended Support Release),
99+ # duplicate it here to facilitate the update script.
1010+ # See https://docs.mattermost.com/about/mattermost-server-releases.html
1111+ # and make sure the version regex is up to date here.
1212+ # Ensure you also check ../mattermost/package.nix for ESR releases.
1313+ regex = "^v(10\.[0-9]+\.[0-9]+)$";
1414+ version = "10.4.1";
1515+ srcHash = "sha256-e7uT30tWhJpEQzlcDUY2huFcupDbe4l8B19Dgub2pg0=";
1616+ vendorHash = "sha256-AcemUxcBoytE/ZoXqaIlxkzAnmGV/C1laDqziMuE+XE=";
1717+ npmDepsHash = "sha256-HABPwdhtev9DZLhWJQsyU4g2ZueYgsX+tUduMsc74YY=";
1818+ lockfileOverlay = ''
1919+ unlock(.; "@floating-ui/react"; "channels/node_modules/@floating-ui/react")
2020+ '';
2121+ autoUpdate = ./package.nix;
2222+ };
2323+}
···127127128128 # TODO: cleanup with mass-rebuild
129129 installCheckPhase = ''
130130- if [ ! -e $lib/${python3.sitePackages}/lldb/_lldb*.so ] ; then
130130+ if [ ! -e ''${!outputLib}/${python3.sitePackages}/lldb/_lldb*.so ] ; then
131131 echo "ERROR: python files not installed where expected!";
132132 return 1;
133133 fi
134134 '' # Something lua is built on older versions but this file doesn't exist.
135135 + lib.optionalString (lib.versionAtLeast release_version "14") ''
136136- if [ ! -e "$lib/lib/lua/${lua5_3.luaversion}/lldb.so" ] ; then
136136+ if [ ! -e "''${!outputLib}/lib/lua/${lua5_3.luaversion}/lldb.so" ] ; then
137137 echo "ERROR: lua files not installed where expected!";
138138 return 1;
139139 fi
···20052005 - ghc-clippy-plugin # failure in job https://hydra.nixos.org/build/233227499 at 2023-09-02
20062006 - ghc-core-smallstep # failure in job https://hydra.nixos.org/build/233209763 at 2023-09-02
20072007 - ghc-corroborate # failure in job https://hydra.nixos.org/build/233223692 at 2023-09-02
20082008- - ghc-datasize # failure in job https://hydra.nixos.org/build/233196292 at 2023-09-02
20092008 - ghc-definitions-th # failure in job https://hydra.nixos.org/build/233254844 at 2023-09-02
20102009 - ghc-dump-core # failure in job https://hydra.nixos.org/build/233214478 at 2023-09-02
20112010 - ghc-dump-tree # failure in job https://hydra.nixos.org/build/233237228 at 2023-09-02
···49904989 - rattle # failure in job https://hydra.nixos.org/build/233234335 at 2023-09-02
49914990 - rattletrap # failure in job https://hydra.nixos.org/build/233206840 at 2023-09-02
49924991 - raven-haskell-scotty # failure in job https://hydra.nixos.org/build/233244270 at 2023-09-02
49924992+ - rawr # fails to build after unbreaking ghc-datasize at 2025-01-19
49934993 - raylib-imgui # failure in job https://hydra.nixos.org/build/233222471 at 2023-09-02
49944994 - raz # failure in job https://hydra.nixos.org/build/233218482 at 2023-09-02
49954995 - rbst # failure in job https://hydra.nixos.org/build/233238184 at 2023-09-02
···2121 patchShebangs cli/*.php app/actualize_script.php
2222 '';
23232424- # the thirdparty_extension_path can only be set by config, but should be read by an env-var.
2424+ # THIRDPARTY_EXTENSIONS_PATH can only be set by config, but should be read from an env-var.
2525 overrideConfig = writeText "constants.local.php" ''
2626 <?php
2727- define('THIRDPARTY_EXTENSIONS_PATH', getenv('THIRDPARTY_EXTENSIONS_PATH') . '/extensions');
2727+ $thirdpartyExtensionsPath = getenv('THIRDPARTY_EXTENSIONS_PATH');
2828+ if (is_string($thirdpartyExtensionsPath) && $thirdpartyExtensionsPath !== "") {
2929+ define('THIRDPARTY_EXTENSIONS_PATH', $thirdpartyExtensionsPath . '/extensions');
3030+ }
2831 '';
29323033 buildInputs = [ php ];