mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 09:04:17 +00:00
ch9344: 2.0 -> 0-unstable-2024-11-15
GitHub repository does not contain versioned tags. The version mentioned in the commit message also does not match the change log embedded in the source code, which seems to be where the official version came from. Since this is such a mess, treat the package as no versioning.
This commit is contained in:
parent
ba4c0e502a
commit
c353ff9402
@ -1,17 +1,18 @@
|
||||
{ stdenv, lib, fetchzip, kernel }:
|
||||
{ stdenv, lib, fetchFromGitHub, kernel }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ch9344";
|
||||
version = "2.0";
|
||||
version = "0-unstable-2024-11-15";
|
||||
|
||||
src = fetchzip {
|
||||
name = "CH9344SER_LINUX.zip";
|
||||
url = "https://www.wch.cn/downloads/file/386.html#CH9344SER_LINUX.zip";
|
||||
hash = "sha256-YKNMYpap7CjhgTIpd/M9+nB11NtpwGYT/P14J6q3XZg=";
|
||||
src = fetchFromGitHub {
|
||||
owner = "WCHSoftGroup";
|
||||
repo = "ch9344ser_linux";
|
||||
rev = "4ea8973886989d67acdd01dba213e355eacc9088";
|
||||
hash = "sha256-ZZ/8s26o7wRwHy6c0m1vZ/DtRW5od+NgiU6aXZBVfc4=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./fix-incompatible-pointer-types.patch
|
||||
./fix-linux-6-12-build.patch
|
||||
];
|
||||
|
||||
sourceRoot = "${src.name}/driver";
|
||||
@ -34,13 +35,12 @@ stdenv.mkDerivation rec {
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.wch-ic.com/";
|
||||
downloadPage = "https://www.wch.cn/downloads/CH9344SER_LINUX_ZIP.html";
|
||||
downloadPage = "https://github.com/WCHSoftGroup/ch9344ser_linux";
|
||||
description = "WCH CH9344/CH348 UART driver";
|
||||
longDescription = ''
|
||||
A kernel module for WinChipHead CH9344/CH348 USB To Multi Serial Ports controller.
|
||||
'';
|
||||
# Archive contains no license.
|
||||
license = licenses.unfree;
|
||||
license = licenses.gpl2Only;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ MakiseKurisu ];
|
||||
};
|
||||
|
@ -1,16 +0,0 @@
|
||||
diff --git a/ch9344.c b/ch9344.c
|
||||
index bfa10bb..76a94a7 100644
|
||||
--- a/ch9344.c
|
||||
+++ b/ch9344.c
|
||||
@@ -837,7 +837,11 @@ static void ch9344_tty_close(struct tty_struct *tty, struct file *filp)
|
||||
}
|
||||
}
|
||||
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0))
|
||||
+static ssize_t ch9344_tty_write(struct tty_struct *tty, const u8 *buf, size_t count)
|
||||
+#else
|
||||
static int ch9344_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
|
||||
+#endif
|
||||
{
|
||||
struct ch9344 *ch9344 = tty->driver_data;
|
||||
int stat;
|
16
pkgs/os-specific/linux/ch9344/fix-linux-6-12-build.patch
Normal file
16
pkgs/os-specific/linux/ch9344/fix-linux-6-12-build.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff --git a/ch9344.c b/ch9344.c
|
||||
index 8130334..b017faa 100644
|
||||
--- a/ch9344.c
|
||||
+++ b/ch9344.c
|
||||
@@ -62,7 +62,11 @@
|
||||
#include <linux/timer.h>
|
||||
#include <linux/kfifo.h>
|
||||
#include <asm/byteorder.h>
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
|
||||
+#include <linux/unaligned.h>
|
||||
+#else
|
||||
#include <asm/unaligned.h>
|
||||
+#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0))
|
||||
#include <linux/sched/signal.h>
|
Loading…
Reference in New Issue
Block a user