about summary refs log tree commit diff
path: root/pkgs/by-name/ch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/ch')
-rw-r--r--pkgs/by-name/ch/ch341eeprom/package.nix40
-rw-r--r--pkgs/by-name/ch/chromatic/package.nix9
-rw-r--r--pkgs/by-name/ch/chromatic/rustc_serialize_update.patch16
3 files changed, 64 insertions, 1 deletions
diff --git a/pkgs/by-name/ch/ch341eeprom/package.nix b/pkgs/by-name/ch/ch341eeprom/package.nix
new file mode 100644
index 000000000000..d98a23ce910c
--- /dev/null
+++ b/pkgs/by-name/ch/ch341eeprom/package.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, libusb1
+,
+}:
+stdenv.mkDerivation {
+  pname = "ch341eeprom";
+  version = "0-unstable-2021-01-05";
+
+  src = fetchFromGitHub {
+    owner = "command-tab";
+    repo = "ch341eeprom";
+    rev = "d5b2fba35a33a1cddd7a3e920e1df933f21ba9b0";
+    hash = "sha256-QUl5ErOfEfDhk1fF+BNu6n0Bake3IagNfn4I43b6Uns=";
+  };
+
+  buildInputs = [ libusb1 ];
+
+  dontConfigure = true;
+
+  makeFlags = [
+    "CC=${stdenv.cc.targetPrefix}cc"
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm755 -T ch341eeprom $out/bin/ch341eeprom
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "A libusb based programming tool for 24Cxx serial EEPROMs using the WinChipHead CH341A IC";
+    homepage = "https://github.com/command-tab/ch341eeprom";
+    license = licenses.gpl3;
+    platforms = platforms.darwin ++ platforms.linux;
+    mainProgram = "ch341eeprom";
+    maintainers = with maintainers; [ xokdvium ];
+  };
+}
diff --git a/pkgs/by-name/ch/chromatic/package.nix b/pkgs/by-name/ch/chromatic/package.nix
index 7eaae7818543..0598bababaa6 100644
--- a/pkgs/by-name/ch/chromatic/package.nix
+++ b/pkgs/by-name/ch/chromatic/package.nix
@@ -26,10 +26,17 @@ stdenv.mkDerivation rec {
     hash = "sha256-E3v3UoQumBBYDOiXMfCRh5J7bfUCkettHth7SAresCE=";
   };
 
+  patches = [
+    # solve error[E0310]: the parameter type `T` may not live long enough
+    # in rust-serialize crate
+    ./rustc_serialize_update.patch
+  ];
+
   cargoDeps = rustPlatform.fetchCargoTarball {
     inherit src;
     name = "${pname}-${version}";
-    hash = "sha256-M3UMeGkLf57/I/9BIkyiMpOvjbKQJrOk+axf05vRoW0=";
+    patches = [ ./rustc_serialize_update.patch ];
+    hash = "sha256-1Zb0J2tO/gIifDymmoXxZf6RNV8foE9QiQqZcrHrWzE=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/by-name/ch/chromatic/rustc_serialize_update.patch b/pkgs/by-name/ch/chromatic/rustc_serialize_update.patch
new file mode 100644
index 000000000000..fa56db4d5399
--- /dev/null
+++ b/pkgs/by-name/ch/chromatic/rustc_serialize_update.patch
@@ -0,0 +1,16 @@
+diff --git a/Cargo.lock b/Cargo.lock
+index ab2add4..7740629 100644
+--- a/Cargo.lock
++++ b/Cargo.lock
+@@ -1031,9 +1031,9 @@ checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
+ 
+ [[package]]
+ name = "rustc-serialize"
+-version = "0.3.24"
++version = "0.3.25"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
++checksum = "fe834bc780604f4674073badbad26d7219cadfb4a2275802db12cbae17498401"
+ 
+ [[package]]
+ name = "rustc_version"