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,190 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitHub,
m4,
cmake,
perl,
writeScript,
enableUnstable ? false,
}:
let
stableVersion = "1.4.0";
in
stdenv.mkDerivation (finalAttrs: {
pname = "ath9k-htc-blobless-firmware";
version = if enableUnstable then "unstable-2022-05-22" else stableVersion;
src = fetchFromGitHub (
{
owner = "qca";
repo = "open-ath9k-htc-firmware";
}
// (
if enableUnstable then
{
rev = "d856466a068afe4069335257c0d28295ff777d92";
hash = "sha256-9OE6qYGABeXjf1r/Depd+811EJ2e8I0Ni5ePHSOh9G4=";
}
else
{
rev = finalAttrs.version;
hash = "sha256-Q/A0ryIC5E1pt2Sh7o79gxHbe4OgdlrwflOWtxWSS5o=";
}
)
);
postPatch = ''
patchShebangs target_firmware/firmware-crc.pl
'';
nativeBuildInputs = [
m4
cmake
perl
];
env.NIX_CFLAGS_COMPILE =
# old libiberty emits fatal warnings
"-w"
# old gmp fails to compile with newer gcc
# FIXME remove when the normal version has moved on
+ lib.optionalString (!enableUnstable) " -fpermissive";
dontUseCmakeConfigure = true;
enableParallelBuilding = true;
# The firmware repository builds its own toolchain, with patches
# applied to the xtensa support in both gcc and binutils.
preBuild =
let
inherit (lib)
toUpper
splitString
last
listToAttrs
pipe
;
inherit (builtins) map;
urls-and-hashes = import (./. + "/urls-and-hashes-${finalAttrs.version}.nix");
make-links =
pipe
[ "gcc" "binutils" "gmp" "mpfr" "mpc" ]
[
(map (
vname:
fetchurl rec {
url = urls-and-hashes."${(toUpper vname) + "_URL"}";
sha256 = urls-and-hashes."${(toUpper vname) + "_SUM"}" or "";
name = last (splitString "/" url);
}
))
(map (v: "ln -sT ${v} toolchain/dl/${v.name}"))
(lib.concatStringsSep "\n")
];
in
''
mkdir -p toolchain/dl
${make-links}
'';
makeTargets = [
"toolchain"
"firmware"
];
installPhase = ''
runHook preInstall
install -Dt "$out/lib/firmware/ath9k_htc/" target_firmware/*.fw
# make symlinks so that firmware will be automatically found
ln -s htc_7010.fw "$out/lib/firmware/ath9k_htc/htc_7010-${stableVersion}.fw"
ln -s htc_9271.fw "$out/lib/firmware/ath9k_htc/htc_9271-${stableVersion}.fw"
runHook postInstall
'';
passthru = {
inherit (finalAttrs) src;
updateScript = writeScript "${finalAttrs.pname}-${finalAttrs.version}-updateScript" ''
nix-shell '<nixpkgs>' -A ${finalAttrs.pname}${lib.optionalString enableUnstable "-unstable"}.passthru.update \
> pkgs/os-specific/linux/firmware/ath9k/urls-and-hashes-${finalAttrs.version}.nix
'';
update = stdenv.mkDerivation {
name = "${finalAttrs.pname}-${finalAttrs.version}-update";
shellHook = ''
echo 'rec {'
echo ' BASEDIR="$NIX_BUILD_TOP";'
make --dry-run --print-data-base -f ${finalAttrs.src}/Makefile download \
| egrep '^[A-Z]+_(VER|URL|SUM|DIR) = ' \
| sed 's_\([^ ]*\) = \(.*\)_\1 = "\2\";_' \
| tr \( \{ \
| tr \) \}
''
# sha256 checksums were not added to upstream's Makefile until
# after the 1.4.0 release. The following line is needed for
# the `enableUnstable==false` build but not for the
# `enableUnstable==true` build. We can remove the lines below
# as soon as `enableUnstable==false` points to a version
# greater than 1.4.0.
+ lib.optionalString (finalAttrs.version == "1.4.0") ''
echo 'GCC_SUM = "sha256-kuYcbcOgpEnmLXKjgYX9pVAWioZwLeoHEl69PsOZYoI=";'
echo 'MPFR_SUM = "sha256-e2bD8T3IOF8IJkyAWFPz4aju2rgHHVgvPmYZccms1f0=";'
echo 'MPC_SUM = "sha256-7VqBXP6lJdx3jfDLN0aLnBtVSq8w2TKLFDHKcFt0AP8=";'
echo 'GMP_SUM = "sha256-H1iKrMxBu5rtlG+f44Uhwm2LKQ0APF34B/ZWkPKq3sk=";'
echo 'BINUTILS_SUM = "sha256-KrLlsD4IbRLGKV+DGtrUaz4UEKOiNJM6Lo+sZssuehk=";'
''
+ ''
echo '}'
exit
'';
};
};
meta = {
description = "Blobless, open source wifi firmware for ath9k_htc.ko";
longDescription = ''
Firmware for Qualcomm Atheros cards which use the ath9k_htc.ko
Linux driver, supporting 802.11 abgn on both 2.4ghz and 5ghz
bands, 3x3-antenna MIMO, up to 600mbit/sec.
Most devices which use this driver are based on the Qualcomm
Atheros AR9271 chip, which is a PCIe device. If your device
is connected via USB, it will also include a Qualcomm Atheros
AR7010, which bridges from a USB gadget interface to a PCIe
host interface. This repository includes the firmware for
both chips.
This firmware is completely open source with no blobs, which
is quite rare in the wifi world. Wifi chips have their own
dedicated general-purpose CPUs. This source code allows you
to see what those CPUs are doing and modify their behavior.
'';
license = with lib.licenses; [
# see NOTICE.txt for details
bsd3 # almost everything; "the ClearBSD licence"
gpl2Plus # **/*cmnos_printf.c, only three files
classpathException20 # **/*cmnos_printf.c, only three files
mit # **/xtos, **/xtensa
];
# release 1.4.0 vendors a GMP which uses an ancient version of
# autotools that does not work on aarch64 or powerpc.
# However, enableUnstable (unreleased upstream) works.
/*
# disabled until #195294 is merged
badPlatforms =
with lib.systems.inspect.patterns;
lib.optionals (!enableUnstable && lib.versionOlder finalAttrs.version "1.4.1") [
isAarch64
isPower64
];
*/
sourceProvenance = [ lib.sourceTypes.fromSource ];
homepage = "http://lists.infradead.org/mailman/listinfo/ath9k_htc_fw";
downloadPage = "https://github.com/qca/open-ath9k-htc-firmware";
changelog = "https://github.com/qca/open-ath9k-htc-firmware/tags";
};
})

View File

@@ -0,0 +1,26 @@
rec {
BASEDIR = "$NIX_BUILD_TOP";
BINUTILS_URL = "https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VER}.tar.bz2";
DL_DIR = "${TOOLCHAIN_DIR}/dl";
GMP_URL = "https://ftp.gnu.org/gnu/gmp/gmp-${GMP_VER}.tar.bz2";
GCC_URL = "https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-${GCC_VER}.tar.bz2";
BINUTILS_DIR = "binutils-${BINUTILS_VER}";
GCC_VER = "4.7.4";
MPFR_URL = "https://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VER}.tar.bz2";
MPC_VER = "1.0.1";
GMP_DIR = "gmp-${GMP_VER}";
MPC_URL = "https://ftp.gnu.org/gnu/mpc/mpc-${MPC_VER}.tar.gz";
GCC_DIR = "gcc-${GCC_VER}";
MPFR_DIR = "mpfr-${MPFR_VER}";
MPC_DIR = "mpc-${MPC_VER}";
MPFR_VER = "3.1.1";
GMP_VER = "5.0.5";
BINUTILS_VER = "2.23.1";
BUILD_DIR = "${TOOLCHAIN_DIR}/build";
TOOLCHAIN_DIR = "${BASEDIR}/toolchain";
GCC_SUM = "sha256-kuYcbcOgpEnmLXKjgYX9pVAWioZwLeoHEl69PsOZYoI=";
MPFR_SUM = "sha256-e2bD8T3IOF8IJkyAWFPz4aju2rgHHVgvPmYZccms1f0=";
MPC_SUM = "sha256-7VqBXP6lJdx3jfDLN0aLnBtVSq8w2TKLFDHKcFt0AP8=";
GMP_SUM = "sha256-H1iKrMxBu5rtlG+f44Uhwm2LKQ0APF34B/ZWkPKq3sk=";
BINUTILS_SUM = "sha256-KrLlsD4IbRLGKV+DGtrUaz4UEKOiNJM6Lo+sZssuehk=";
}

View File

@@ -0,0 +1,26 @@
rec {
BASEDIR = "$NIX_BUILD_TOP";
BINUTILS_URL = "https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VER}.tar.bz2";
DL_DIR = "${TOOLCHAIN_DIR}/dl";
GMP_SUM = "f51c99cb114deb21a60075ffb494c1a210eb9d7cb729ed042ddb7de9534451ea";
GMP_URL = "https://ftp.gnu.org/gnu/gmp/gmp-${GMP_VER}.tar.bz2";
GCC_URL = "https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-${GCC_VER}.tar.gz";
BINUTILS_DIR = "binutils-${BINUTILS_VER}";
GCC_VER = "10.2.0";
MPFR_URL = "https://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VER}.tar.bz2";
MPC_VER = "1.1.0";
GMP_DIR = "gmp-${GMP_VER}";
MPC_URL = "https://ftp.gnu.org/gnu/mpc/mpc-${MPC_VER}.tar.gz";
GCC_DIR = "gcc-${GCC_VER}";
MPC_SUM = "6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e";
GCC_SUM = "27e879dccc639cd7b0cc08ed575c1669492579529b53c9ff27b0b96265fa867d";
BINUTILS_SUM = "7d24660f87093670738e58bcc7b7b06f121c0fcb0ca8fc44368d675a5ef9cff7";
MPFR_DIR = "mpfr-${MPFR_VER}";
MPC_DIR = "mpc-${MPC_VER}";
MPFR_VER = "4.1.0";
GMP_VER = "6.2.0";
BINUTILS_VER = "2.35";
BUILD_DIR = "${TOOLCHAIN_DIR}/build";
MPFR_SUM = "feced2d430dd5a97805fa289fed3fc8ff2b094c02d05287fd6133e7f1f0ec926";
TOOLCHAIN_DIR = "${BASEDIR}/toolchain";
}

View File

@@ -0,0 +1,33 @@
{
lib,
stdenvNoCC,
fetchurl,
b43FirmwareCutter,
}:
let
version = "5.100.138";
in
stdenvNoCC.mkDerivation {
pname = "b43-firmware";
inherit version;
src = fetchurl {
url = "http://www.lwfinger.com/b43-firmware/broadcom-wl-${version}.tar.bz2";
sha256 = "0vz4ka8gycf72gmnaq61k8rh8y17j1wm2k3fidxvcqjvmix0drzi";
};
nativeBuildInputs = [ b43FirmwareCutter ];
installPhase = ''
mkdir -p $out/lib/firmware
b43-fwcutter -w $out/lib/firmware linux/wl_apsta.o
'';
meta = {
description = "Firmware for cards supported by the b43 kernel module";
homepage = "https://wireless.wiki.kernel.org/en/users/drivers/b43";
license = lib.licenses.unfree;
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
stdenvNoCC,
fetchurl,
b43FirmwareCutter,
}:
stdenvNoCC.mkDerivation rec {
pname = "b43-firmware";
version = "6.30.163.46";
src = fetchurl {
url = "http://www.lwfinger.com/b43-firmware/broadcom-wl-${version}.tar.bz2";
sha256 = "0baw6gcnrhxbb447msv34xg6rmlcj0gm3ahxwvdwfcvq4xmknz50";
};
nativeBuildInputs = [ b43FirmwareCutter ];
sourceRoot = ".";
installPhase = ''
mkdir -p $out/lib/firmware
b43-fwcutter -w $out/lib/firmware *.wl_apsta.o
'';
meta = with lib; {
description = "Firmware for cards supported by the b43 kernel module";
homepage = "https://wireless.wiki.kernel.org/en/users/drivers/b43";
downloadPage = "http://www.lwfinger.com/b43-firmware";
license = licenses.unfree;
};
}

View File

@@ -0,0 +1,67 @@
{
lib,
stdenv,
fetchFromGitHub,
}:
let
inherit (lib) optionals;
in
stdenv.mkDerivation {
pname = "raspberrypi-armstubs";
version = "unstable-2022-07-11";
src = fetchFromGitHub {
owner = "raspberrypi";
repo = "tools";
rev = "439b6198a9b340de5998dd14a26a0d9d38a6bcac";
hash = "sha512-KMHgj73eXHT++IE8DbCsFeJ87ngc9R3XxMUJy4Z3s4/MtMeB9zblADHkyJqz9oyeugeJTrDtuVETPBRo7M4Y8A==";
};
env.NIX_CFLAGS_COMPILE = toString [
"-march=armv8-a+crc"
];
preConfigure = ''
cd armstubs
'';
makeFlags = [
"CC8=${stdenv.cc.targetPrefix}cc"
"LD8=${stdenv.cc.targetPrefix}ld"
"OBJCOPY8=${stdenv.cc.targetPrefix}objcopy"
"OBJDUMP8=${stdenv.cc.targetPrefix}objdump"
"CC7=${stdenv.cc.targetPrefix}cc"
"LD7=${stdenv.cc.targetPrefix}ld"
"OBJCOPY7=${stdenv.cc.targetPrefix}objcopy"
"OBJDUMP7=${stdenv.cc.targetPrefix}objdump"
]
++ optionals (stdenv.hostPlatform.isAarch64) [
"armstub8.bin"
"armstub8-gic.bin"
]
++ optionals (stdenv.hostPlatform.isAarch32) [
"armstub7.bin"
"armstub8-32.bin"
"armstub8-32-gic.bin"
];
installPhase = ''
runHook preInstall
mkdir -vp $out/
cp -v *.bin $out/
runHook postInstall
'';
meta = with lib; {
description = "Firmware related ARM stubs for the Raspberry Pi";
homepage = "https://github.com/raspberrypi/tools";
license = licenses.bsd3;
platforms = [
"armv6l-linux"
"armv7l-linux"
"aarch64-linux"
];
maintainers = [ ];
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
}:
stdenvNoCC.mkDerivation rec {
# NOTE: this should be updated with linux_rpi
pname = "raspberrypi-firmware";
version = "1.20250430";
src = fetchFromGitHub {
owner = "raspberrypi";
repo = "firmware";
rev = version;
hash = "sha256-U41EgEDny1R+JFktSC/3CE+2Qi7GJludj929ft49Nm0=";
};
installPhase = ''
mkdir -p $out/share/raspberrypi/
mv boot "$out/share/raspberrypi/"
'';
dontConfigure = true;
dontBuild = true;
dontFixup = true;
meta = with lib; {
description = "Firmware for the Raspberry Pi board";
homepage = "https://github.com/raspberrypi/firmware";
license = licenses.unfreeRedistributableFirmware; # See https://github.com/raspberrypi/firmware/blob/master/boot/LICENCE.broadcom
maintainers = with maintainers; [ dezgeg ];
# Hash mismatch on source, mystery.
# Maybe due to https://github.com/NixOS/nix/issues/847
broken = stdenvNoCC.hostPlatform.isDarwin;
};
}