forked from mirrors/nixpkgs
msalsdk-dbusclient: init at 1.0.1
This commit is contained in:
parent
70c6994870
commit
5a7e93fef9
37
pkgs/by-name/ms/msalsdk-dbusclient/package.nix
Normal file
37
pkgs/by-name/ms/msalsdk-dbusclient/package.nix
Normal 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 ];
|
||||
};
|
||||
}
|
26
pkgs/by-name/ms/msalsdk-dbusclient/update.sh
Executable file
26
pkgs/by-name/ms/msalsdk-dbusclient/update.sh
Executable 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)
|
Loading…
Reference in a new issue