summary refs log tree commit diff
path: root/pkgs/development/misc
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/misc')
-rw-r--r--pkgs/development/misc/msp430/mspds/binary.nix35
-rw-r--r--pkgs/development/misc/msp430/mspds/bsl430.patch51
-rw-r--r--pkgs/development/misc/msp430/mspds/default.nix56
-rw-r--r--pkgs/development/misc/yelp-tools/default.nix30
4 files changed, 165 insertions, 7 deletions
diff --git a/pkgs/development/misc/msp430/mspds/binary.nix b/pkgs/development/misc/msp430/mspds/binary.nix
new file mode 100644
index 00000000000..690ed3e45e7
--- /dev/null
+++ b/pkgs/development/misc/msp430/mspds/binary.nix
@@ -0,0 +1,35 @@
+{ stdenv, lib, fetchurl, unzip, autoPatchelfHook }:
+
+with lib;
+
+let
+  archPostfix = optionalString (stdenv.is64bit && !stdenv.isDarwin) "_64";
+in stdenv.mkDerivation rec {
+  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 autoPatchelfHook ];
+  buildInputs = [ stdenv.cc.cc ];
+
+  installPhase = ''
+    install -Dm0755 $libname $out/lib/''${libname//_64/}
+    install -Dm0644 -t $out/include Inc/*.h
+  '';
+
+  meta = {
+    description = "Unfree binary release of the TI MSP430 FET debug driver";
+    homepage = https://www.ti.com/tool/MSPDS;
+    license = licenses.unfree;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ aerialx ];
+  };
+}
diff --git a/pkgs/development/misc/msp430/mspds/bsl430.patch b/pkgs/development/misc/msp430/mspds/bsl430.patch
new file mode 100644
index 00000000000..6c57fb040e2
--- /dev/null
+++ b/pkgs/development/misc/msp430/mspds/bsl430.patch
@@ -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
diff --git a/pkgs/development/misc/msp430/mspds/default.nix b/pkgs/development/misc/msp430/mspds/default.nix
new file mode 100644
index 00000000000..2481b50bfbe
--- /dev/null
+++ b/pkgs/development/misc/msp430/mspds/default.nix
@@ -0,0 +1,56 @@
+{ stdenv
+, lib
+, fetchurl, unzip
+, boost, pugixml
+, hidapi
+, libusb1 ? null
+}:
+
+with lib;
+assert stdenv.isLinux -> libusb1 != null;
+
+let
+  hidapiDriver = optionalString stdenv.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}" ];
+  NIX_CFLAGS_COMPILE = [ "-I${hidapi}/include/hidapi" ];
+
+  patches = [ ./bsl430.patch ];
+
+  preBuild = ''
+    rm ThirdParty/src/pugixml.cpp
+    rm ThirdParty/include/pugi{config,xml}.hpp
+  '' + optionalString stdenv.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 ]
+    ++ optional stdenv.isLinux libusb1;
+
+  meta = {
+    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 ];
+  };
+}
diff --git a/pkgs/development/misc/yelp-tools/default.nix b/pkgs/development/misc/yelp-tools/default.nix
index bf348d68041..ca7050c0678 100644
--- a/pkgs/development/misc/yelp-tools/default.nix
+++ b/pkgs/development/misc/yelp-tools/default.nix
@@ -6,28 +6,44 @@
 , itstool
 , gnome3
 , pkg-config
+, meson
+, ninja
+, python3
 }:
 
-stdenv.mkDerivation rec {
+python3.pkgs.buildPythonApplication rec {
   pname = "yelp-tools";
-  version = "3.38.0";
+  version = "40.0";
+
+  format = "other";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/yelp-tools/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1c045c794sm83rrjan67jmsk20qacrw1m814p4nw85w5xsry8z30";
+    url = "mirror://gnome/sources/yelp-tools/${lib.versions.major version}/${pname}-${version}.tar.xz";
+    sha256 = "1bkanqp3qwmirv06mi99qv2acr5ba5rlhy9zlh0fyrfxygraqjv6";
   };
 
   nativeBuildInputs = [
     pkg-config
+    meson
+    ninja
+  ];
+
+  propagatedBuildInputs = [
+    libxml2 # xmllint required by yelp-check.
+    libxslt # xsltproc required by yelp-build and yelp-check.
   ];
 
   buildInputs = [
-    libxml2
-    libxslt
-    itstool
+    itstool # build script checks for its presence but I am not sure if anything uses it
     gnome3.yelp-xsl
   ];
 
+  pythonPath = [
+    python3.pkgs.lxml
+  ];
+
+  strictDeps = false; # TODO: Meson cannot find xmllint oherwise. Maybe add it to machine file?
+
   doCheck = true;
 
   passthru = {