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,36 @@
{
lib,
stdenvNoCC,
fetchzip,
}:
let
mspgccVersion = "6_1_1_0";
in
stdenvNoCC.mkDerivation rec {
pname = "msp430-gcc-support-files";
version = "1.207";
src = fetchzip {
url = "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/${mspgccVersion}/exports/msp430-gcc-support-files-${version}.zip";
sha256 = "1gyi9zc5vh9c1lxd22dwvk6b17dcd17hah2rayr062p4l51kzam1";
};
buildCommand = ''
find $src/include -name '*.ld' | xargs install -Dm0644 -t $out/lib
find $src/include -name '*.h' | xargs install -Dm0644 -t $out/include
install -Dm0644 -t $out/include $src/include/devices.csv
# appease bintoolsWrapper_addLDVars, search path needed for ld scripts
touch $out/lib/lib
'';
meta = with lib; {
description = ''
Development headers and linker scripts for TI MSP430 microcontrollers
'';
homepage = "https://www.ti.com/tool/msp430-gcc-opensource";
license = licenses.bsd3;
platforms = [ "msp430-none" ];
maintainers = with maintainers; [ aerialx ];
};
}

View File

@@ -0,0 +1,71 @@
{
lib,
stdenv,
fetchFromGitHub,
autoPatchelfHook,
libusb-compat-0_1,
readline ? null,
enableReadline ? true,
hidapi ? null,
pkg-config ? null,
mspds ? null,
enableMspds ? false,
}:
assert stdenv.hostPlatform.isDarwin -> hidapi != null && pkg-config != null;
assert enableReadline -> readline != null;
assert enableMspds -> mspds != null;
stdenv.mkDerivation rec {
version = "0.25";
pname = "mspdebug";
src = fetchFromGitHub {
owner = "dlbeer";
repo = "mspdebug";
rev = "v${version}";
sha256 = "0prgwb5vx6fd4bj12ss1bbb6axj2kjyriyjxqrzd58s5jyyy8d3c";
};
enableParallelBuilding = true;
nativeBuildInputs =
lib.optional stdenv.hostPlatform.isDarwin pkg-config
++ lib.optional (enableMspds && stdenv.hostPlatform.isLinux) autoPatchelfHook;
buildInputs = [
libusb-compat-0_1
]
++ lib.optional stdenv.hostPlatform.isDarwin hidapi
++ lib.optional enableReadline readline;
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# TODO: remove once a new 0.26+ release is made
substituteInPlace drivers/tilib_api.c --replace .so ${stdenv.hostPlatform.extensions.sharedLibrary}
# Makefile only uses pkg-config if it detects homebrew
substituteInPlace Makefile --replace brew true
'';
# TODO: wrap with MSPDEBUG_TILIB_PATH env var instead of these rpath fixups in 0.26+
runtimeDependencies = lib.optional enableMspds mspds;
postFixup = lib.optionalString (enableMspds && stdenv.hostPlatform.isDarwin) ''
# autoPatchelfHook only works on linux so...
for dep in $runtimeDependencies; do
install_name_tool -add_rpath $dep/lib $out/bin/$pname
done
'';
installFlags = [
"PREFIX=$(out)"
"INSTALL=install"
];
makeFlags = [ "UNAME_S=$(unameS)" ] ++ lib.optional (!enableReadline) "WITHOUT_READLINE=1";
unameS = lib.optionalString stdenv.hostPlatform.isDarwin "Darwin";
meta = with lib; {
description = "Free programmer, debugger, and gdb proxy for MSP430 MCUs";
mainProgram = "mspdebug";
homepage = "https://dlbeer.co.nz/mspdebug/";
license = licenses.gpl2;
platforms = platforms.all;
maintainers = with maintainers; [ aerialx ];
};
}

View File

@@ -0,0 +1,45 @@
{
stdenv,
lib,
fetchurl,
unzip,
autoPatchelfHook,
}:
let
archPostfix = lib.optionalString (
stdenv.hostPlatform.is64bit && !stdenv.hostPlatform.isDarwin
) "_64";
in
stdenv.mkDerivation {
pname = "msp-debug-stack-bin";
version = "3.15.1.1";
src = fetchurl {
url = "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPDS/3_15_1_001/export/MSP430_DLL_Developer_Package_Rev_3_15_1_1.zip";
sha256 = "1m1ssrwbhqvqwbp3m4hnjyxnz3f9d4acz9vl1av3fbnhvxr0d2hb";
};
sourceRoot = ".";
libname =
if stdenv.hostPlatform.isWindows then
"MSP430${archPostfix}.dll"
else
"libmsp430${archPostfix}${stdenv.hostPlatform.extensions.sharedLibrary}";
nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
buildInputs = [ stdenv.cc.cc ];
installPhase = ''
install -Dm0755 $libname $out/lib/''${libname//_64/}
install -Dm0644 -t $out/include Inc/*.h
'';
meta = with lib; {
description = "Unfree binary release of the TI MSP430 FET debug driver";
homepage = "https://www.ti.com/tool/MSPDS";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ aerialx ];
};
}

View File

@@ -0,0 +1,51 @@
diff -ruN a/Makefile b/Makefile
--- a/Makefile 2020-06-03 16:10:18.000000000 -0700
+++ b/Makefile 2020-07-21 18:03:12.464121056 -0700
@@ -42,7 +42,7 @@
PLATFORM := $(shell uname -s)
ifeq ($(PLATFORM),Linux)
- CXX:= g++
+ CXX?= g++
STATICOUTPUT := linux64
@@ -68,7 +68,7 @@
HIDOBJ := $(LIBTHIRD)/hid-libusb.o
else
- CXX:= clang++
+ CXX?= clang++
OUTPUT := libmsp430.dylib
STATICOUTPUT := mac64
@@ -134,7 +134,7 @@
$(CXX) -c -o $@ $< $(USE_PCH) $(CXXFLAGS) $(INCLUDES) $(DEFINES)
$(BSLLIB):
- $(MAKE) -C ./ThirdParty/BSL430_DLL
+ $(MAKE) -C ./ThirdParty/BSL430_DLL OUTPUT=../../$(BSLLIB)
install:
cp $(OUTPUT) /usr/local/lib/
diff -ruN a/ThirdParty/BSL430_DLL/Makefile b/ThirdParty/BSL430_DLL/Makefile
--- a/ThirdParty/BSL430_DLL/Makefile 2019-11-18 13:16:00.000000000 -0800
+++ b/ThirdParty/BSL430_DLL/Makefile 2020-07-21 18:02:55.987782494 -0700
@@ -36,7 +36,7 @@
PLATFORM := $(shell uname -s)
ifeq ($(PLATFORM),Linux)
- CXX:= g++
+ CXX?= g++
ifdef BIT32
CXXFLAGS += -m32
@@ -47,7 +47,7 @@
INCLUDES += -I$(BOOST_DIR)
endif
else
- CXX:= clang++
+ CXX?= clang++
ifdef BOOST_DIR
INCLUDES += -I$(BOOST_DIR)/include

View File

@@ -0,0 +1,70 @@
{
stdenv,
lib,
fetchurl,
unzip,
boost,
pugixml,
hidapi,
libusb1 ? null,
}:
assert stdenv.hostPlatform.isLinux -> libusb1 != null;
let
hidapiDriver = lib.optionalString stdenv.hostPlatform.isLinux "-libusb";
in
stdenv.mkDerivation {
pname = "msp-debug-stack";
version = "3.15.1.1";
src = fetchurl {
url = "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPDS/3_15_1_001/export/MSPDebugStack_OS_Package_3_15_1_1.zip";
sha256 = "1j5sljqwc20zrb50mrji4mnmw5i680qc7n0lb0pakrrxqjc9m9g3";
};
sourceRoot = ".";
enableParallelBuilding = true;
libName = "libmsp430${stdenv.hostPlatform.extensions.sharedLibrary}";
makeFlags = [
"OUTPUT=$(libName)"
"HIDOBJ="
];
NIX_LDFLAGS = [
"-lpugixml"
"-lhidapi${hidapiDriver}"
];
env.NIX_CFLAGS_COMPILE = toString [ "-I${hidapi}/include/hidapi" ];
patches = [ ./bsl430.patch ];
preBuild = ''
rm ThirdParty/src/pugixml.cpp
rm ThirdParty/include/pugi{config,xml}.hpp
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
makeFlagsArray+=(OUTNAME="-install_name ")
'';
installPhase = ''
install -Dm0755 -t $out/lib $libName
install -Dm0644 -t $out/include DLL430_v3/include/*.h
'';
nativeBuildInputs = [ unzip ];
buildInputs = [
boost
hidapi
pugixml
]
++ lib.optional stdenv.hostPlatform.isLinux libusb1;
meta = with lib; {
description = "TI MSP430 FET debug driver";
homepage = "https://www.ti.com/tool/MSPDS";
license = licenses.bsd3;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ aerialx ];
};
}

View File

@@ -0,0 +1,30 @@
{
stdenvNoCC,
xorg,
newlib,
msp430GccSupport,
}:
stdenvNoCC.mkDerivation {
name = "msp430-${newlib.name}";
inherit newlib;
inherit msp430GccSupport;
preferLocalBuild = true;
allowSubstitutes = false;
buildCommand = ''
mkdir $out
${xorg.lndir}/bin/lndir -silent $newlib $out
${xorg.lndir}/bin/lndir -silent $msp430GccSupport/include $out/${newlib.incdir}
${xorg.lndir}/bin/lndir -silent $msp430GccSupport/lib $out/${newlib.libdir}
'';
passthru = {
inherit (newlib) incdir libdir;
};
meta = {
platforms = [ "msp430-none" ];
};
}