ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / in / intune-portal / package.nix
blobdbd3e3393529acc2eae983440cec83612f483ea3
1 { stdenv
2 , lib
3 , fetchurl
4 , dpkg
5 , libuuid
6 , xorg
7 , curlMinimal
8 , openssl
9 , libsecret
10 , webkitgtk_4_0
11 , libsoup
12 , gtk3
13 , atk
14 , pango
15 , glib
16 , sqlite
17 , zlib
18 , systemd
19 , msalsdk-dbusclient
20 , pam
21 , dbus
22 , nixosTests
24 stdenv.mkDerivation rec {
25   pname = "intune-portal";
26   version = "1.2405.17-jammy";
28   src = fetchurl {
29     url = "https://packages.microsoft.com/ubuntu/22.04/prod/pool/main/i/intune-portal/intune-portal_${version}_amd64.deb";
30     hash = "sha256-WpVPWzh8jN092MaY2rMXhLfpVXsflMl9hOY9nNGJlLk=";
31   };
33   nativeBuildInputs = [ dpkg ];
35   buildPhase =
36     let
37       libPath = {
38         intune = lib.makeLibraryPath [
39           stdenv.cc.cc
40           libuuid
41           xorg.libX11
42           curlMinimal
43           openssl
44           libsecret
45           webkitgtk_4_0
46           libsoup
47           gtk3
48           atk
49           glib
50           pango
51           sqlite
52           zlib
53           systemd
54           msalsdk-dbusclient
55           dbus
56         ];
57         pam = lib.makeLibraryPath [ pam ];
58       };
59     in
60     ''
61       runHook preBuild
63       patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath ${libPath.intune} opt/microsoft/intune/bin/intune-portal
64       patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath ${libPath.intune} opt/microsoft/intune/bin/intune-agent
65       patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath ${libPath.intune} opt/microsoft/intune/bin/intune-daemon
66       patchelf --set-rpath ${libPath.pam} ./usr/lib/x86_64-linux-gnu/security/pam_intune.so
68       runHook postBuild
69     '';
71   installPhase = ''
72     runHook preInstall
74     mkdir -p $out/bin
75     cp -a opt/microsoft/intune/bin/* $out/bin/
76     cp -a usr/share $out
77     cp -a lib $out
78     mkdir -p $out/lib/security
79     cp -a ./usr/lib/x86_64-linux-gnu/security/pam_intune.so $out/lib/security/
80     cp -a usr/lib/tmpfiles.d $out/lib
82     substituteInPlace $out/share/applications/intune-portal.desktop \
83       --replace /opt/microsoft/intune/bin/intune-portal $out/bin/intune-portal
85     substituteInPlace $out/lib/systemd/user/intune-agent.service \
86       --replace \
87         ExecStart=/opt/microsoft/intune/bin/intune-agent \
88         ExecStart=$out/bin/intune-agent
90     substituteInPlace $out/lib/systemd/system/intune-daemon.service \
91       --replace \
92         ExecStart=/opt/microsoft/intune/bin/intune-daemon \
93         ExecStart=$out/bin/intune-daemon
95     runHook postInstall
96   '';
98   # Without this network requests fail
99   dontPatchELF = true;
101   passthru = {
102     updateScript = ./update.sh;
103     tests = { inherit (nixosTests) intune; };
104   };
106   meta = with lib; {
107     description = "Microsoft Intune Portal allows you to securely access corporate apps, data, and resources";
108     homepage = "https://www.microsoft.com/";
109     license = licenses.unfree;
110     platforms = [ "x86_64-linux" ];
111     maintainers = with lib.maintainers; [ rhysmdnz ];
112     sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
113   };