tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
msalsdk-dbusclient: init at 1.0.1
Rhys Davies
2 years ago
5a7e93fe
70c69948
+63
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
ms
msalsdk-dbusclient
package.nix
update.sh
+37
pkgs/by-name/ms/msalsdk-dbusclient/package.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{ stdenv
2
+
, lib
3
+
, fetchurl
4
+
, dpkg
5
+
, sdbus-cpp
6
+
}:
7
+
stdenv.mkDerivation rec {
8
+
pname = "msalsdk-dbusclient";
9
+
version = "1.0.1";
10
+
11
+
src = fetchurl {
12
+
url = "https://packages.microsoft.com/ubuntu/22.04/prod/pool/main/m/${pname}/${pname}_${version}_amd64.deb";
13
+
hash = "sha256-AVPrNxCjXGza2gGETP0YrlXeEgI6AjlrSVTtqKb2UBI=";
14
+
};
15
+
16
+
nativeBuildInputs = [ dpkg ];
17
+
18
+
installPhase = ''
19
+
runHook preInstall
20
+
21
+
mkdir -p $out/lib
22
+
install -m 755 usr/lib/libmsal_dbus_client.so $out/lib/
23
+
patchelf --set-rpath ${lib.makeLibraryPath [ stdenv.cc.cc.lib sdbus-cpp ]} $out/lib/libmsal_dbus_client.so
24
+
25
+
runHook postInstall
26
+
'';
27
+
28
+
passthru.updateScript = ./update.sh;
29
+
meta = with lib; {
30
+
description = "Microsoft Authentication Library cross platform Dbus client for talking to microsoft-identity-broker";
31
+
homepage = "https://github.com/AzureAD/microsoft-authentication-library-for-cpp";
32
+
license = licenses.unfree;
33
+
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
34
+
platforms = [ "x86_64-linux" ];
35
+
maintainers = with lib.maintainers; [ rhysmdnz ];
36
+
};
37
+
}
+26
pkgs/by-name/ms/msalsdk-dbusclient/update.sh
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
#! /usr/bin/env nix-shell
2
+
#! nix-shell -i bash -p curl gzip dpkg common-updater-scripts
3
+
4
+
index_file=$(curl -sL https://packages.microsoft.com/ubuntu/22.04/prod/dists/jammy/main/binary-amd64/Packages.gz | gzip -dc)
5
+
6
+
latest_version="0"
7
+
8
+
echo "$index_file" | while read -r line; do
9
+
if [[ "$line" =~ ^Package:[[:space:]]*(.*) ]]; then
10
+
Package="${BASH_REMATCH[1]}"
11
+
fi
12
+
if [[ "$line" =~ ^Version:[[:space:]]*(.*) ]]; then
13
+
Version="${BASH_REMATCH[1]}"
14
+
fi
15
+
16
+
if ! [[ "$line" ]] && [[ "${Package}" == "msalsdk-dbusclient" ]]; then
17
+
if ( dpkg --compare-versions ${Version} gt ${latest_version} ); then
18
+
latest_version="${Version}"
19
+
20
+
echo $latest_version
21
+
fi
22
+
23
+
Package=""
24
+
Version=""
25
+
fi
26
+
done | tail -n 1 | (read version; update-source-version msalsdk-dbusclient $version)