push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
windows,
autoreconfHook,
mingw_w64_headers,
crt ? stdenv.hostPlatform.libc,
}:
stdenv.mkDerivation {
pname = "mingw-w64";
inherit (mingw_w64_headers) version src meta;
outputs = [
"out"
"dev"
];
configureFlags = [
(lib.enableFeature true "idl")
(lib.enableFeature true "secure-api")
(lib.withFeatureAs true "default-msvcrt" crt)
# Including other architectures causes errors with invalid asm
(lib.enableFeature stdenv.hostPlatform.isi686 "lib32")
(lib.enableFeature stdenv.hostPlatform.isx86_64 "lib64")
(lib.enableFeature stdenv.hostPlatform.isAarch64 "libarm64")
];
enableParallelBuilding = true;
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ mingw_w64_headers ];
hardeningDisable = [
"stackprotector"
"fortify"
];
}

View File

@@ -0,0 +1,47 @@
{
lib,
nixosTests,
stdenvNoCC,
fetchurl,
crt ? stdenvNoCC.hostPlatform.libc,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "mingw_w64-headers";
version = "13.0.0";
src = fetchurl {
url = "mirror://sourceforge/mingw-w64/mingw-w64-v${finalAttrs.version}.tar.bz2";
hash = "sha256-Wv6CKvXE7b9n2q9F7sYdU49J7vaxlSTeZIl8a5WCjK8=";
};
configureFlags = [
(lib.withFeatureAs true "default-msvcrt" crt)
];
preConfigure = ''
cd mingw-w64-headers
'';
passthru = {
tests = {
inherit (nixosTests) wine;
};
updateScript = ./update.nu;
};
meta = {
homepage = "https://www.mingw-w64.org/";
downloadPage = "https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/";
description = "Collection of headers and libraries for building native Windows applications";
license = with lib.licenses; [
# Primarily under
zpl21
# A couple files
mit
# Certain headers imported from Wine
lgpl21Plus
];
platforms = lib.platforms.windows;
teams = [ lib.teams.windows ];
};
})

View File

@@ -0,0 +1,19 @@
{
lib,
stdenv,
mingw_w64_headers,
# Rustc require 'libpthread.a' when targeting 'x86_64-pc-windows-gnu'.
# Enabling this makes it work out of the box instead of failing.
withStatic ? true,
}:
stdenv.mkDerivation {
pname = "mingw_w64-pthreads";
inherit (mingw_w64_headers) version src meta;
configureFlags = [ (lib.enableFeature withStatic "static") ];
preConfigure = ''
cd mingw-w64-libraries/winpthreads
'';
}

View File

@@ -0,0 +1,77 @@
#!/usr/bin/env nix-shell
#! nix-shell -i nu -p nushell nix
use std/log
def replace [ p: path old: string new: string ] {
open $p
| str replace $old $new
| save -f $p
}
def eval [ attr: string ] {
with-env {
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM: 1
} {
nix eval -f ./. $attr --json
}
| from json
}
def main [] {
# List of all the link in the RSS feed for
# https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/
let links = http get https://sourceforge.net/projects/mingw-w64/rss?path=/mingw-w64/mingw-w64-release/
| from xml
| get content.content.0
| where tag == item
| get content
| flatten
| where tag == title
| get content
| flatten
| get content
# Select only files ending in "tar.bz2", then select the largest value
# We only consider values with at least two digits cause they are at
# 13.0 and sorting strings doesn't work well if they aren't the same length
let newest = $links
| where { ($in | str ends-with "tar.bz2") and ($in =~ v[0-9][0-9]\.) }
| sort -r
| get 0
# Extract the newest version out of the URL
let new_version = $newest
| split column /
| get column4.0
| split column -
| get column3.0
| str replace .tar.bz2 ""
| str trim -c v
# Get the current version in the drv
let current_version = eval "windows.mingw_w64_headers.version"
if $new_version == $current_version {
log info "Current mingw-w64 version matches the latest, exiting..."
return
} else {
log info $"Current version is ($current_version)\nLatest version is ($new_version)"
}
# Get the current hash
let current_hash = eval "windows.mingw_w64_headers.src.outputHash"
# Set to the new version
replace ./pkgs/os-specific/windows/mingw-w64/headers.nix $current_version $new_version
# The nix derivation creates the URL from the version, so just grab that.
let new_url = eval "windows.mingw_w64_headers.src.url"
# Prefetch to get the new hash
let new_hash = nix-prefetch-url --type sha256 $new_url
| nix hash to-sri --type sha256 $in
# Set the hash
replace ./pkgs/os-specific/windows/mingw-w64/headers.nix $current_hash $new_hash
}