3
0
Fork 0
forked from mirrors/nixpkgs

msalsdk-dbusclient: init at 1.0.1

This commit is contained in:
Rhys Davies 2023-03-17 21:33:47 +13:00
parent 70c6994870
commit 5a7e93fef9
No known key found for this signature in database
2 changed files with 63 additions and 0 deletions

View file

@ -0,0 +1,37 @@
{ stdenv
, lib
, fetchurl
, dpkg
, sdbus-cpp
}:
stdenv.mkDerivation rec {
pname = "msalsdk-dbusclient";
version = "1.0.1";
src = fetchurl {
url = "https://packages.microsoft.com/ubuntu/22.04/prod/pool/main/m/${pname}/${pname}_${version}_amd64.deb";
hash = "sha256-AVPrNxCjXGza2gGETP0YrlXeEgI6AjlrSVTtqKb2UBI=";
};
nativeBuildInputs = [ dpkg ];
installPhase = ''
runHook preInstall
mkdir -p $out/lib
install -m 755 usr/lib/libmsal_dbus_client.so $out/lib/
patchelf --set-rpath ${lib.makeLibraryPath [ stdenv.cc.cc.lib sdbus-cpp ]} $out/lib/libmsal_dbus_client.so
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Microsoft Authentication Library cross platform Dbus client for talking to microsoft-identity-broker";
homepage = "https://github.com/AzureAD/microsoft-authentication-library-for-cpp";
license = licenses.unfree;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ rhysmdnz ];
};
}

View file

@ -0,0 +1,26 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p curl gzip dpkg common-updater-scripts
index_file=$(curl -sL https://packages.microsoft.com/ubuntu/22.04/prod/dists/jammy/main/binary-amd64/Packages.gz | gzip -dc)
latest_version="0"
echo "$index_file" | while read -r line; do
if [[ "$line" =~ ^Package:[[:space:]]*(.*) ]]; then
Package="${BASH_REMATCH[1]}"
fi
if [[ "$line" =~ ^Version:[[:space:]]*(.*) ]]; then
Version="${BASH_REMATCH[1]}"
fi
if ! [[ "$line" ]] && [[ "${Package}" == "msalsdk-dbusclient" ]]; then
if ( dpkg --compare-versions ${Version} gt ${latest_version} ); then
latest_version="${Version}"
echo $latest_version
fi
Package=""
Version=""
fi
done | tail -n 1 | (read version; update-source-version msalsdk-dbusclient $version)