diff --git a/pkgs/applications/science/electronics/linux-gpib/common.nix b/pkgs/applications/science/electronics/linux-gpib/common.nix new file mode 100644 index 000000000000..e87751a18860 --- /dev/null +++ b/pkgs/applications/science/electronics/linux-gpib/common.nix @@ -0,0 +1,24 @@ +{ pname, fetchurl, lib }: rec { + version = "4.3.6"; + inherit pname; + + src = fetchurl { + url = "mirror://sourceforge/project/linux-gpib/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/${version}/linux-gpib-${version}.tar.gz"; + hash = "sha256-Gze4xrvkhEgn+J5Jhrycezjp2uhlD1v6aX0WGv4J2Jg="; + }; + + unpackPhase = '' + tar xf $src + tar xf linux-gpib-${version}/${pname}-${version}.tar.gz + ''; + + sourceRoot = "${pname}-${version}"; + + meta = with lib; { + description = "Support package for GPIB (IEEE 488) hardware"; + homepage = "https://linux-gpib.sourceforge.io/"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ fsagbuya ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/science/electronics/linux-gpib/kernel.nix b/pkgs/applications/science/electronics/linux-gpib/kernel.nix new file mode 100644 index 000000000000..d64e2fc81fbd --- /dev/null +++ b/pkgs/applications/science/electronics/linux-gpib/kernel.nix @@ -0,0 +1,23 @@ +{ lib +, stdenv +, fetchurl +, kernel +, pahole +}: + +stdenv.mkDerivation (import ./common.nix { inherit fetchurl lib; pname = "linux-gpib-kernel"; } // { + + postPatch = '' + sed -i 's@/sbin/depmod -A@@g' Makefile + ''; + + buildInputs = [ pahole ] ++ kernel.moduleBuildDependencies; + + makeFlags = [ + "LINUX_SRCDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ]; + + installFlags = [ + "INSTALL_MOD_PATH=$(out)" + ]; +}) diff --git a/pkgs/applications/science/electronics/linux-gpib/user.nix b/pkgs/applications/science/electronics/linux-gpib/user.nix new file mode 100644 index 000000000000..f9c9a2e1e6cb --- /dev/null +++ b/pkgs/applications/science/electronics/linux-gpib/user.nix @@ -0,0 +1,25 @@ +{ lib +, stdenv +, fetchurl +, autoconf +, libtool +, bison +, flex +, automake +}: + +stdenv.mkDerivation (import ./common.nix { inherit fetchurl lib; pname = "linux-gpib-user"; } // { + + nativeBuildInputs = [ + autoconf + libtool + bison + flex + automake + ]; + + configureFlags = [ + "--sysconfdir=$(out)/etc" + "--prefix=$(out)" + ]; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2639afba28ae..2cd4e9849aff 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10335,6 +10335,8 @@ with pkgs; linux-exploit-suggester = callPackage ../tools/security/linux-exploit-suggester { }; + linux-gpib = callPackage ../applications/science/electronics/linux-gpib/user.nix { }; + linuxquota = callPackage ../tools/misc/linuxquota { }; lipl = callPackage ../tools/misc/lipl { }; diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index 495d6f6c127d..c813e7d6e0fb 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -372,6 +372,8 @@ in { lenovo-legion-module = callPackage ../os-specific/linux/lenovo-legion { }; + linux-gpib = callPackage ../applications/science/electronics/linux-gpib/kernel.nix { }; + liquidtux = callPackage ../os-specific/linux/liquidtux {}; lkrg = callPackage ../os-specific/linux/lkrg {};