tvl-depot/third_party/apereo-cas/default.nix
sterni e628862e97 chore(3p): Bump NixOS channels to 2021-02-18
Main motivation for this is to get the openldap update that fixes
10 CVEs: CVE-2020-36221 to including CVE-2020-36230. See also this
issue which lists them all: https://github.com/NixOS/nixpkgs/issues/113490

Someone should also redeploy whitby as soon as this lands in canon and
all build failures have been fixed.

Things done to resolve upstream breakages:

* grpc no longer takes abseil-cpp as an input, it has also been removed
  in the override.

* Upgrade glittershark's kernel to 5.11 since the linuxPackages_5_9
  attribute has been removed by upstream and the patch used by them is
  available for 5.11 as well.

* The fixed output hash for third_patry.apereo-cas changed for some reason.

* Remove the pin of haskellPackages.vector from the haskell overlay. It
  broke as the most recent version of vector in nixos-unstable no longer
  depends on semigroups. This effectively updates vector from 0.12.1.2
  to 0.12.2.0.

* Align two comments in tvix/libstore/worker-protocol.hh because the
  updated clang-format now demands that.

Change-Id: I2ecf10a98de935e9222acf1feaea447d4c11ed2d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2538
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-02-19 14:45:43 +00:00

63 lines
2 KiB
Nix

{ pkgs, ... }:
let
name = "apereo-cas-${version}";
version = "6.2.0";
overlay = ./overlay;
jdk = pkgs.jdk11;
gradle = pkgs.gradle_6;
meta = with pkgs.stdenvNoCC.lib; {
homepage = "https://www.apereo.org/projects/cas";
description = "CAS provides enterprise single sign-on for the Web";
platforms = platforms.linux;
licenses = licenses.asl20;
};
deps = pkgs.stdenvNoCC.mkDerivation {
inherit meta;
name = "${name}-deps";
src = overlay;
nativeBuildInputs = with pkgs; [ gradle perl ];
buildPhase = ''
export GRADLE_USER_HOME="$(mktemp -d)"
gradle --no-daemon build -x test downloadShell
'';
# perl code mavenizes paths (see pkgs/servers/ma1sd from nixpkgs)
installPhase = ''
find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\([wj]ar\|pom\)' \
| perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# $src = $1; ($x = $2) =~ tr|\.|/|; $dir1 = $3; $dir2 = $4; ($y = $5) =~ s|-jvm||n; "install -Dm444 $src \$out/$x/$dir1/$dir2/$y" #e' \
| sh
install -m444 build/libs/cas-server-support-shell-* $out/cas-server-shell.jar
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "07wxmgljs8v0pmnryqjz6dr6jl93x3023y8zx3al5314mmqkpaan";
};
in
pkgs.stdenvNoCC.mkDerivation {
inherit name version meta;
src = overlay;
nativeBuildInputs = with pkgs; [ gradle makeWrapper ];
buildInputs = with pkgs; [ jdk ];
buildPhase = ''
export GRADLE_USER_HOME="$(mktemp -d)"
gradle -PcacheLocation="${deps}" --offline --no-daemon build -x test
'';
installPhase = ''
install -D build/libs/cas.war $out/lib/cas.war
cp ${deps}/cas-server-shell.jar $out/lib/cas-server-shell.jar
cp -R etc $out/etc
makeWrapper ${jdk}/bin/java $out/bin/cas --add-flags "-Dcas.standalone.configurationDirectory=$out/etc/cas/config -jar $out/lib/cas.war"
makeWrapper ${jdk}/bin/java $out/bin/cas-shell --add-flags "-Dcas.standalone.configurationDirectory=$out/etc/cas/config -jar $out/lib/cas-server-shell.jar"
'';
}