git.iko.soy/typeable/nixpkgs
on master help sign in
mspds: init at 3.15.1.1
commitda7c1383f4122c54b5c34d017beaff4faadb0313 authorAaron Lindsay <aerialx@users.noreply.github.com> dateSat 30 Mar 2019, 17:33 (8 years ago) parentcc9e099
3 files changed+109
pkgs/development/misc/msp430/mspds/bsl430.patch+51 pkgs/development/misc/msp430/mspds/default.nix+56 pkgs/top-level/all-packages.nix+2
pkgs/development/misc/msp430/mspds/bsl430.patchnew file+51
@@ -0,0 +1,51 @@
1+diff -ruN a/Makefile b/Makefile
2+--- a/Makefile 2020-06-03 16:10:18.000000000 -0700
3++++ b/Makefile 2020-07-21 18:03:12.464121056 -0700
4+@@ -42,7 +42,7 @@
5+
6+ PLATFORM := $(shell uname -s)
7+ ifeq ($(PLATFORM),Linux)
8+- CXX:= g++
9++ CXX?= g++
10+
11+ STATICOUTPUT := linux64
12+
13+@@ -68,7 +68,7 @@
14+
15+ HIDOBJ := $(LIBTHIRD)/hid-libusb.o
16+ else
17+- CXX:= clang++
18++ CXX?= clang++
19+
20+ OUTPUT := libmsp430.dylib
21+ STATICOUTPUT := mac64
22+@@ -134,7 +134,7 @@
23+ $(CXX) -c -o $@ $< $(USE_PCH) $(CXXFLAGS) $(INCLUDES) $(DEFINES)
24+
25+ $(BSLLIB):
26+- $(MAKE) -C ./ThirdParty/BSL430_DLL
27++ $(MAKE) -C ./ThirdParty/BSL430_DLL OUTPUT=../../$(BSLLIB)
28+
29+ install:
30+ cp $(OUTPUT) /usr/local/lib/
31+diff -ruN a/ThirdParty/BSL430_DLL/Makefile b/ThirdParty/BSL430_DLL/Makefile
32+--- a/ThirdParty/BSL430_DLL/Makefile 2019-11-18 13:16:00.000000000 -0800
33++++ b/ThirdParty/BSL430_DLL/Makefile 2020-07-21 18:02:55.987782494 -0700
34+@@ -36,7 +36,7 @@
35+
36+ PLATFORM := $(shell uname -s)
37+ ifeq ($(PLATFORM),Linux)
38+- CXX:= g++
39++ CXX?= g++
40+
41+ ifdef BIT32
42+ CXXFLAGS += -m32
43+@@ -47,7 +47,7 @@
44+ INCLUDES += -I$(BOOST_DIR)
45+ endif
46+ else
47+- CXX:= clang++
48++ CXX?= clang++
49+
50+ ifdef BOOST_DIR
51+ INCLUDES += -I$(BOOST_DIR)/include
pkgs/development/misc/msp430/mspds/default.nixnew file+56
@@ -0,0 +1,56 @@
1+{ stdenv
2+, lib
3+, fetchurl, unzip
4+, boost, pugixml
5+, hidapi
6+, libusb1 ? null
7+}:
8+
9+with lib;
10+assert stdenv.isLinux -> libusb1 != null;
11+
12+let
13+ hidapiDriver = optionalString stdenv.isLinux "-libusb";
14+
15+in stdenv.mkDerivation {
16+ pname = "msp-debug-stack";
17+ version = "3.15.1.1";
18+
19+ src = fetchurl {
20+ 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";
21+ sha256 = "1j5sljqwc20zrb50mrji4mnmw5i680qc7n0lb0pakrrxqjc9m9g3";
22+ };
23+ sourceRoot = ".";
24+
25+ enableParallelBuilding = true;
26+ libName = "libmsp430${stdenv.hostPlatform.extensions.sharedLibrary}";
27+ makeFlags = [ "OUTPUT=$(libName)" "HIDOBJ=" ];
28+ NIX_LDFLAGS = [ "-lpugixml" "-lhidapi${hidapiDriver}" ];
29+ NIX_CFLAGS_COMPILE = [ "-I${hidapi}/include/hidapi" ];
30+
31+ patches = [ ./bsl430.patch ];
32+
33+ preBuild = ''
34+ rm ThirdParty/src/pugixml.cpp
35+ rm ThirdParty/include/pugi{config,xml}.hpp
36+ '' + optionalString stdenv.isDarwin ''
37+ makeFlagsArray+=(OUTNAME="-install_name ")
38+ '';
39+
40+ installPhase = ''
41+ install -Dm0755 -t $out/lib $libName
42+ install -Dm0644 -t $out/include DLL430_v3/include/*.h
43+ '';
44+
45+ nativeBuildInputs = [ unzip ];
46+ buildInputs = [ boost hidapi pugixml ]
47+ ++ optional stdenv.isLinux libusb1;
48+
49+ meta = {
50+ description = "TI MSP430 FET debug driver";
51+ homepage = https://www.ti.com/tool/MSPDS;
52+ license = licenses.bsd3;
53+ platforms = platforms.linux ++ platforms.darwin;
54+ maintainers = with maintainers; [ aerialx ];
55+ };
56+}
pkgs/top-level/all-packages.nix+2
@@ -12206,6 +12206,8 @@ in
1220612206 newlib = newlibCross;
1220712207 };
1220812208
12209+ mspds = callPackage ../development/misc/msp430/mspds { };
12210+
1220912211 mspdebug = callPackage ../development/misc/msp430/mspdebug.nix { };
1221012212
1221112213 vc4-newlib = callPackage ../development/misc/vc4/newlib.nix {};