Merge master into haskell-updates
This commit is contained in:
commit
40ae072ae9
@ -1,17 +1,17 @@
|
||||
{ autoreconfHook, boost180, cargo, coreutils, curl, cxx-rs, db62, fetchFromGitHub
|
||||
, hexdump, lib, libevent, libsodium, makeWrapper, rust, rustPlatform
|
||||
, pkg-config, Security, stdenv, testers, utf8cpp, util-linux, zcash, zeromq
|
||||
, git, hexdump, lib, libevent, libsodium, makeWrapper, rust, rustPlatform
|
||||
, pkg-config, Security, stdenv, testers, tl-expected, utf8cpp, util-linux, zcash, zeromq
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage.override { inherit stdenv; } rec {
|
||||
pname = "zcash";
|
||||
version = "5.3.0";
|
||||
version = "5.4.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "zcash";
|
||||
repo = "zcash";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-mlABKZDYYC3y+KlXQVFqdcm46m8K9tbOCqk4lM4shp8=";
|
||||
hash = "sha256-XGq/cYUo43FcpmRDO2YiNLCuEQLsTFLBFC4M1wM29l8=";
|
||||
};
|
||||
|
||||
prePatch = lib.optionalString stdenv.isAarch64 ''
|
||||
@ -20,15 +20,16 @@ rustPlatform.buildRustPackage.override { inherit stdenv; } rec {
|
||||
--replace "linker = \"aarch64-linux-gnu-gcc\"" ""
|
||||
'';
|
||||
|
||||
cargoHash = "sha256-6uhtOaBsgMw59Dy6yivZYUEWDsYfpInA7VmJrqxDS/4=";
|
||||
cargoHash = "sha256-Mz8mr/RDcOfwJvXhY19rZmWHP8mUeEf9GYD+3JAPNOw=";
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook cargo cxx-rs hexdump makeWrapper pkg-config ];
|
||||
nativeBuildInputs = [ autoreconfHook cargo cxx-rs git hexdump makeWrapper pkg-config ];
|
||||
|
||||
buildInputs = [
|
||||
boost180
|
||||
db62
|
||||
libevent
|
||||
libsodium
|
||||
tl-expected
|
||||
utf8cpp
|
||||
zeromq
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
|
68
pkgs/applications/networking/browsers/microsoft-edge/update.py
Executable file
68
pkgs/applications/networking/browsers/microsoft-edge/update.py
Executable file
@ -0,0 +1,68 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i python3 -p python3Packages.packaging python3Packages.debian
|
||||
|
||||
import base64
|
||||
import gzip
|
||||
import textwrap
|
||||
from urllib import request
|
||||
|
||||
from debian.deb822 import Packages
|
||||
from debian.debian_support import Version
|
||||
|
||||
|
||||
def packages():
|
||||
packages_url = 'https://packages.microsoft.com/repos/edge/dists/stable/main/binary-amd64/Packages'
|
||||
handle = request.urlopen(packages_url)
|
||||
return handle
|
||||
|
||||
|
||||
def latest_packages(packages: bytes):
|
||||
latest_packages: dict[str, Packages] = {}
|
||||
for package in Packages.iter_paragraphs(packages, use_apt_pkg=False):
|
||||
name: str = package['Package']
|
||||
if not name.startswith('microsoft-edge-'):
|
||||
continue
|
||||
channel = name.replace('microsoft-edge-', '')
|
||||
if channel not in latest_packages:
|
||||
latest_packages[channel] = package
|
||||
else:
|
||||
old_package = latest_packages[channel]
|
||||
if old_package.get_version() < package.get_version(): # type: ignore
|
||||
latest_packages[channel] = package
|
||||
return latest_packages
|
||||
|
||||
|
||||
def nix_expressions(latest: dict[str, Packages]):
|
||||
channel_strs: list[str] = []
|
||||
for channel, package in latest.items():
|
||||
print(f"Processing {channel} {package['Version']}")
|
||||
match = Version.re_valid_version.match(package['Version'])
|
||||
assert match is not None
|
||||
|
||||
version = match.group('upstream_version')
|
||||
revision = match.group('debian_revision')
|
||||
sri = 'sha256-' + \
|
||||
base64.b64encode(bytes.fromhex(package['SHA256'])).decode('ascii')
|
||||
|
||||
channel_str = textwrap.dedent(
|
||||
f'''\
|
||||
{channel} = import ./browser.nix {{
|
||||
channel = "{channel}";
|
||||
version = "{version}";
|
||||
revision = "{revision}";
|
||||
sha256 = "{sri}";
|
||||
}};'''
|
||||
)
|
||||
channel_strs.append(channel_str)
|
||||
return channel_strs
|
||||
|
||||
|
||||
def write_expression():
|
||||
latest = latest_packages(packages())
|
||||
channel_strs = nix_expressions(latest)
|
||||
nix_expr = '{\n' + textwrap.indent('\n'.join(channel_strs), ' ') + '\n}'
|
||||
with open('default.nix', 'w') as f:
|
||||
f.write(nix_expr)
|
||||
|
||||
|
||||
write_expression()
|
@ -1,50 +0,0 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p curl gzip
|
||||
|
||||
# To update: ./update.sh > default.nix
|
||||
|
||||
index_file=$(curl -sL https://packages.microsoft.com/repos/edge/dists/stable/main/binary-amd64/Packages.gz | gzip -dc)
|
||||
|
||||
echo "{"
|
||||
|
||||
packages=()
|
||||
echo "$index_file" | while read -r line; do
|
||||
if [[ "$line" =~ ^Package:[[:space:]]*(.*) ]]; then
|
||||
Package="${BASH_REMATCH[1]}"
|
||||
fi
|
||||
if [[ "$line" =~ ^Version:[[:space:]]*(.*)-([a-zA-Z0-9+.~]*) ]]; then
|
||||
Version="${BASH_REMATCH[1]}"
|
||||
Revision="${BASH_REMATCH[2]}"
|
||||
fi
|
||||
if [[ "$line" =~ ^SHA256:[[:space:]]*(.*) ]]; then
|
||||
SHA256="${BASH_REMATCH[1]}"
|
||||
fi
|
||||
|
||||
if ! [[ "$line" ]]; then
|
||||
found=0
|
||||
for i in "${packages[@]}"; do
|
||||
if [[ "$i" == "$Package" ]]; then
|
||||
found=1
|
||||
fi
|
||||
done
|
||||
|
||||
if (( ! $found )); then
|
||||
channel="${Package##*-}"
|
||||
name="${Package%-${channel}}"
|
||||
cat <<EOF
|
||||
${channel} = import ./browser.nix {
|
||||
channel = "${channel}";
|
||||
version = "${Version}";
|
||||
revision = "${Revision}";
|
||||
sha256 = "sha256:$(nix-hash --type sha256 --to-base32 ${SHA256})";
|
||||
};
|
||||
EOF
|
||||
fi
|
||||
|
||||
packages+=($Package)
|
||||
Package=""
|
||||
Version=""
|
||||
fi
|
||||
done
|
||||
|
||||
echo "}"
|
@ -24,14 +24,14 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "xrootd";
|
||||
version = "5.5.3";
|
||||
version = "5.5.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "xrootd";
|
||||
repo = "xrootd";
|
||||
rev = "v${version}";
|
||||
fetchSubmodules = true;
|
||||
hash = "sha256-61+8M6ubKX/GnsPLTql6XzGw/PTljpiXoDa1YoECya4=";
|
||||
hash = "sha256-6yjZ50ZTXfKcfYwuuAwqXOWsVucpNRWEC9F3rcYSRXQ=";
|
||||
};
|
||||
|
||||
outputs = [ "bin" "out" "dev" "man" ];
|
||||
|
Loading…
Reference in New Issue
Block a user