about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/al
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-11-16 12:53:32 +0100
committerAlyssa Ross <hi@alyssa.is>2023-11-16 12:53:32 +0100
commit67419f0e56f99b0ebbe14574d3492110ac84c8d6 (patch)
tree3abc8e1606a2c80b6f5d14fef175e50800202163 /nixpkgs/pkgs/by-name/al
parenta2c1eff83c3118a9aee8076c7f84f58137416b6e (diff)
parent9008bc4eb62c878d0812105ea1b34255d651df88 (diff)
downloadnixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.gz
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.bz2
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.lz
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.xz
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.zst
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs into HEAD
Diffstat (limited to 'nixpkgs/pkgs/by-name/al')
-rw-r--r--nixpkgs/pkgs/by-name/al/alsa-firmware/package.nix46
-rw-r--r--nixpkgs/pkgs/by-name/al/alsa-lib/alsa-plugin-conf-multilib.patch232
-rw-r--r--nixpkgs/pkgs/by-name/al/alsa-lib/package.nix51
-rw-r--r--nixpkgs/pkgs/by-name/al/alsa-oss/package.nix31
-rw-r--r--nixpkgs/pkgs/by-name/al/alsa-plugins-wrapper/package.nix10
-rw-r--r--nixpkgs/pkgs/by-name/al/alsa-plugins/package.nix27
-rw-r--r--nixpkgs/pkgs/by-name/al/alsa-tools/package.nix114
-rw-r--r--nixpkgs/pkgs/by-name/al/alsa-topology-conf/package.nix36
-rw-r--r--nixpkgs/pkgs/by-name/al/alsa-ucm-conf/package.nix36
-rw-r--r--nixpkgs/pkgs/by-name/al/alsa-utils/package.nix47
10 files changed, 630 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/al/alsa-firmware/package.nix b/nixpkgs/pkgs/by-name/al/alsa-firmware/package.nix
new file mode 100644
index 000000000000..06b6ef47d430
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/al/alsa-firmware/package.nix
@@ -0,0 +1,46 @@
+{ lib, buildPackages, stdenvNoCC, autoreconfHook, fetchurl, fetchpatch }:
+
+stdenvNoCC.mkDerivation rec {
+  pname = "alsa-firmware";
+  version = "1.2.4";
+
+  src = fetchurl {
+    url = "mirror://alsa/firmware/alsa-firmware-${version}.tar.bz2";
+    sha256 = "sha256-tnttfQi8/CR+9v8KuIqZwYgwWjz1euLf0LzZpbNs1bs=";
+  };
+
+  patches = [
+    # fixes some includes / missing types on musl libc; should not make a difference for other platforms
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/void-linux/void-packages/ae690000017d5fd355ab397c49202426e3a01c11/srcpkgs/alsa-firmware/patches/musl.patch";
+      sha256 = "sha256-4A+TBBvpz14NwMNewLc2LQL51hnz4EZlZ44rhnx5dnc=";
+    })
+  ];
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ autoreconfHook ];
+
+  configureFlags = [
+    "--with-hotplug-dir=$(out)/lib/firmware"
+  ];
+
+  dontStrip = true;
+
+  postInstall = ''
+    # These are lifted from the Arch PKGBUILD
+    # remove files which conflicts with linux-firmware
+    rm -rf $out/lib/firmware/{ct{efx,speq}.bin,ess,korg,sb16,yamaha}
+    # remove broken symlinks (broken upstream)
+    rm -rf $out/lib/firmware/turtlebeach
+    # remove empty dir
+    rm -rf $out/bin
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.alsa-project.org/";
+    description = "Soundcard firmwares from the alsa project";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ l-as ];
+  };
+}
diff --git a/nixpkgs/pkgs/by-name/al/alsa-lib/alsa-plugin-conf-multilib.patch b/nixpkgs/pkgs/by-name/al/alsa-lib/alsa-plugin-conf-multilib.patch
new file mode 100644
index 000000000000..b17df9a492e5
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/al/alsa-lib/alsa-plugin-conf-multilib.patch
@@ -0,0 +1,232 @@
+diff --git a/src/control/control.c b/src/control/control.c
+index d66ed75..42cecad 100644
+--- a/src/control/control.c
++++ b/src/control/control.c
+@@ -838,6 +838,10 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
+ #ifndef PIC
+ 	extern void *snd_control_open_symbols(void);
+ #endif
++
++	snd_config_t *libs = NULL;
++	const char *libs_lib = NULL;
++
+ 	if (snd_config_get_type(ctl_conf) != SND_CONFIG_TYPE_COMPOUND) {
+ 		if (name)
+ 			SNDERR("Invalid type for CTL %s definition", name);
+@@ -879,6 +883,19 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
+ 					SNDERR("Invalid type for %s", id);
+ 					goto _err;
+ 				}
++
++				continue;
++			}
++			// Handle an array of extra libs.
++			if (strcmp(id, "libs") == 0) {
++				if (snd_config_get_type(n) != SND_CONFIG_TYPE_COMPOUND) {
++					SNDERR("Invalid type for libs definition in CTL %s definition",
++						str);
++					goto _err;
++				}
++
++				libs = n;
++
+ 				continue;
+ 			}
+ 			if (strcmp(id, "open") == 0) {
+@@ -903,7 +920,62 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
+ 		open_name = buf;
+ 		sprintf(buf, "_snd_ctl_%s_open", str);
+ 	}
+-	if (!lib) {
++
++#ifndef PIC
++	snd_control_open_symbols();
++#endif
++
++	// Normal alsa behaviour when there is no libs array.
++	if (!libs) {
++		if (lib) {
++			open_func = snd_dlobj_cache_get(lib, open_name,
++				SND_DLSYM_VERSION(SND_CONTROL_DLSYM_VERSION), 1);
++		}
++	}
++	// Handle libs array.
++	// Suppresses error messages if any function is loaded successfully.
++	else {
++		if (lib) {
++			open_func = snd_dlobj_cache_get(lib, open_name,
++				SND_DLSYM_VERSION(SND_CONTROL_DLSYM_VERSION), 0);
++		}
++
++		if (!open_func) {
++			snd_config_for_each(i, next, libs) {
++				snd_config_t *n = snd_config_iterator_entry(i);
++
++				err = snd_config_get_string(n, &libs_lib);
++				if (err < 0) {
++					SNDERR("Invalid entry in CTL %s libs definition", str);
++					goto _err;
++				}
++
++				if (!open_func) {
++					open_func = snd_dlobj_cache_get(libs_lib, open_name,
++						SND_DLSYM_VERSION(SND_CONTROL_DLSYM_VERSION), 0);
++				}
++			}
++		}
++
++		// Print error messages.
++		if (!open_func) {
++			if (lib) {
++				SNDERR("Either %s cannot be opened or %s was not defined inside",
++					lib, open_name);
++			}
++
++			snd_config_for_each(i, next, libs) {
++				snd_config_t *n = snd_config_iterator_entry(i);
++
++				snd_config_get_string(n, &libs_lib);
++				SNDERR("Either %s cannot be opened or %s was not defined inside",
++					libs_lib, open_name);
++			}
++		}
++	}
++
++	// Look in ALSA_PLUGIN_DIR iff we found nowhere else to look.
++	if (!lib && (!libs || !libs_lib)) {
+ 		const char *const *build_in = build_in_ctls;
+ 		while (*build_in) {
+ 			if (!strcmp(*build_in, str))
+@@ -919,12 +991,11 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
+ 			lib = buf1;
+ 			sprintf(buf1, "%s/libasound_module_ctl_%s.so", ALSA_PLUGIN_DIR, str);
+ 		}
+-	}
+-#ifndef PIC
+-	snd_control_open_symbols();
+-#endif
+-	open_func = snd_dlobj_cache_get(lib, open_name,
++
++		open_func = snd_dlobj_cache_get(lib, open_name,
+ 			SND_DLSYM_VERSION(SND_CONTROL_DLSYM_VERSION), 1);
++	}
++
+ 	if (open_func) {
+ 		err = open_func(ctlp, name, ctl_root, ctl_conf, mode);
+ 		if (err >= 0) {
+diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
+index 2e24338..7f489f4 100644
+--- a/src/pcm/pcm.c
++++ b/src/pcm/pcm.c
+@@ -2116,6 +2116,10 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
+ #ifndef PIC
+ 	extern void *snd_pcm_open_symbols(void);
+ #endif
++
++	snd_config_t *libs = NULL;
++	const char *libs_lib = NULL;
++
+ 	if (snd_config_get_type(pcm_conf) != SND_CONFIG_TYPE_COMPOUND) {
+ 		char *val;
+ 		id = NULL;
+@@ -2160,6 +2164,19 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
+ 					SNDERR("Invalid type for %s", id);
+ 					goto _err;
+ 				}
++
++				continue;
++			}
++			// Handle an array of extra libs.
++			if (strcmp(id, "libs") == 0) {
++				if (snd_config_get_type(n) != SND_CONFIG_TYPE_COMPOUND) {
++					SNDERR("Invalid type for libs definition in PCM %s definition",
++						str);
++					goto _err;
++				}
++
++				libs = n;
++
+ 				continue;
+ 			}
+ 			if (strcmp(id, "open") == 0) {
+@@ -2184,7 +2201,62 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
+ 		open_name = buf;
+ 		sprintf(buf, "_snd_pcm_%s_open", str);
+ 	}
+-	if (!lib) {
++
++#ifndef PIC
++	snd_pcm_open_symbols();	/* this call is for static linking only */
++#endif
++
++	// Normal alsa behaviour when there is no libs array.
++	if (!libs) {
++		if (lib) {
++			open_func = snd_dlobj_cache_get(lib, open_name,
++				SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION), 1);
++		}
++	}
++	// Handle libs array.
++	// Suppresses error messages if any function is loaded successfully.
++	else {
++		if (lib) {
++			open_func = snd_dlobj_cache_get(lib, open_name,
++				SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION), 0);
++		}
++
++		if (!open_func) {
++			snd_config_for_each(i, next, libs) {
++				snd_config_t *n = snd_config_iterator_entry(i);
++
++				err = snd_config_get_string(n, &libs_lib);
++				if (err < 0) {
++					SNDERR("Invalid entry in PCM %s libs definition", str);
++					goto _err;
++				}
++
++				if (!open_func) {
++					open_func = snd_dlobj_cache_get(libs_lib, open_name,
++						SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION), 0);
++				}
++			}
++		}
++
++		// Print error messages.
++		if (!open_func) {
++			if (lib) {
++				SNDERR("Either %s cannot be opened or %s was not defined inside",
++					lib, open_name);
++			}
++
++			snd_config_for_each(i, next, libs) {
++				snd_config_t *n = snd_config_iterator_entry(i);
++
++				snd_config_get_string(n, &libs_lib);
++				SNDERR("Either %s cannot be opened or %s was not defined inside",
++					libs_lib, open_name);
++			}
++		}
++	}
++
++	// Look in ALSA_PLUGIN_DIR iff we found nowhere else to look.
++	if (!lib && (!libs || !libs_lib)) {
+ 		const char *const *build_in = build_in_pcms;
+ 		while (*build_in) {
+ 			if (!strcmp(*build_in, str))
+@@ -2200,12 +2272,11 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
+ 			lib = buf1;
+ 			sprintf(buf1, "%s/libasound_module_pcm_%s.so", ALSA_PLUGIN_DIR, str);
+ 		}
+-	}
+-#ifndef PIC
+-	snd_pcm_open_symbols();	/* this call is for static linking only */
+-#endif
+-	open_func = snd_dlobj_cache_get(lib, open_name,
++
++		open_func = snd_dlobj_cache_get(lib, open_name,
+ 			SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION), 1);
++	}
++
+ 	if (open_func) {
+ 		err = open_func(pcmp, name, pcm_root, pcm_conf, stream, mode);
+ 		if (err >= 0) {
diff --git a/nixpkgs/pkgs/by-name/al/alsa-lib/package.nix b/nixpkgs/pkgs/by-name/al/alsa-lib/package.nix
new file mode 100644
index 000000000000..f0eb34906073
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/al/alsa-lib/package.nix
@@ -0,0 +1,51 @@
+{ lib
+, stdenv
+, fetchurl
+, alsa-topology-conf
+, alsa-ucm-conf
+, testers
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "alsa-lib";
+  version = "1.2.9";
+
+  src = fetchurl {
+    url = "mirror://alsa/lib/${finalAttrs.pname}-${finalAttrs.version}.tar.bz2";
+    hash = "sha256-3JxkP9xMz9BXLMaFhY3UHgivtYPzBGCzF+QYgnX2FbI=";
+  };
+
+  patches = [
+    # Add a "libs" field to the syntax recognized in the /etc/asound.conf file.
+    # The nixos modules for pulseaudio, jack, and pipewire are leveraging this
+    # "libs" field to declare locations for both native and 32bit plugins, in
+    # order to support apps with 32bit sound running on x86_64 architecture.
+    ./alsa-plugin-conf-multilib.patch
+  ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    ln -s ${alsa-ucm-conf}/share/alsa/{ucm,ucm2} $out/share/alsa
+    ln -s ${alsa-topology-conf}/share/alsa/topology $out/share/alsa
+  '';
+
+  outputs = [ "out" "dev" ];
+
+  passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
+
+  meta = with lib; {
+    homepage = "http://www.alsa-project.org/";
+    description = "ALSA, the Advanced Linux Sound Architecture libraries";
+
+    longDescription = ''
+      The Advanced Linux Sound Architecture (ALSA) provides audio and
+      MIDI functionality to the Linux-based operating system.
+    '';
+
+    license = licenses.lgpl21Plus;
+    pkgConfigModules = [ "alsa" "alsa-topology" ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ l-as ];
+  };
+})
diff --git a/nixpkgs/pkgs/by-name/al/alsa-oss/package.nix b/nixpkgs/pkgs/by-name/al/alsa-oss/package.nix
new file mode 100644
index 000000000000..f600b52c5f3a
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/al/alsa-oss/package.nix
@@ -0,0 +1,31 @@
+{lib, stdenv, fetchurl, alsa-lib, gettext, ncurses, libsamplerate}:
+
+stdenv.mkDerivation rec {
+  pname = "alsa-oss";
+  version = "1.1.8";
+
+  src = fetchurl {
+    url = "mirror://alsa/oss-lib/${pname}-${version}.tar.bz2";
+    sha256 = "13nn6n6wpr2sj1hyqx4r9nb9bwxnhnzw8r2f08p8v13yjbswxbb4";
+  };
+
+  buildInputs = [ alsa-lib ncurses libsamplerate ];
+  nativeBuildInputs = [ gettext ];
+
+  configureFlags = [ "--disable-xmlto" ];
+
+  installFlags = [ "ASOUND_STATE_DIR=$(TMPDIR)/dummy" ];
+
+  meta = with lib; {
+    homepage = "http://www.alsa-project.org/";
+    description = "ALSA, the Advanced Linux Sound Architecture alsa-oss emulation";
+
+    longDescription = ''
+      The Advanced Linux Sound Architecture (ALSA) provides audio and
+      MIDI functionality to the Linux-based operating system.
+    '';
+
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/by-name/al/alsa-plugins-wrapper/package.nix b/nixpkgs/pkgs/by-name/al/alsa-plugins-wrapper/package.nix
new file mode 100644
index 000000000000..992f4886e262
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/al/alsa-plugins-wrapper/package.nix
@@ -0,0 +1,10 @@
+{ stdenv
+, alsa-plugins
+, writeShellScriptBin
+}:
+let
+  arch = if stdenv.hostPlatform.system == "i686-linux" then "32" else "64";
+in
+writeShellScriptBin "ap${arch}" ''
+  ALSA_PLUGIN_DIRS=${alsa-plugins}/lib/alsa-lib "$@"
+''
diff --git a/nixpkgs/pkgs/by-name/al/alsa-plugins/package.nix b/nixpkgs/pkgs/by-name/al/alsa-plugins/package.nix
new file mode 100644
index 000000000000..ababb767955b
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/al/alsa-plugins/package.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, lib, pkg-config, alsa-lib, libogg, libpulseaudio ? null, libjack2 ? null }:
+
+stdenv.mkDerivation rec {
+  pname = "alsa-plugins";
+  version = "1.2.7.1";
+
+  src = fetchurl {
+    url = "mirror://alsa/plugins/${pname}-${version}.tar.bz2";
+    hash = "sha256-jDN4FJVLt8FnRWczpgRhQqKTHxLsy6PsKkrmGKNDJRE=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  # ToDo: a52, etc.?
+  buildInputs =
+    [ alsa-lib libogg ]
+    ++ lib.optional (libpulseaudio != null) libpulseaudio
+    ++ lib.optional (libjack2 != null) libjack2;
+
+  meta = with lib; {
+    description = "Various plugins for ALSA";
+    homepage = "http://alsa-project.org/";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.marcweber ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/by-name/al/alsa-tools/package.nix b/nixpkgs/pkgs/by-name/al/alsa-tools/package.nix
new file mode 100644
index 000000000000..b52e15200967
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/al/alsa-tools/package.nix
@@ -0,0 +1,114 @@
+{ lib
+, stdenv
+, fetchurl
+, alsa-lib
+, fltk13
+, gtk2
+, gtk3
+, makeWrapper
+, pkg-config
+, psmisc
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "alsa-tools";
+  version = "1.2.5";
+
+  src = fetchurl {
+    url = "mirror://alsa/tools/alsa-tools-${finalAttrs.version}.tar.bz2";
+    hash = "sha256-NacQJ6AfTX3kci4iNSDpQN5os8VwtsZxaRVnrij5iT4=";
+  };
+
+  nativeBuildInputs = [
+    makeWrapper
+    pkg-config
+  ];
+
+  buildInputs = [
+    alsa-lib
+    fltk13
+    gtk2
+    gtk3
+    psmisc
+  ];
+
+  env.TOOLSET = lib.concatStringsSep " " [
+    "as10k1"
+    "echomixer"
+    "envy24control"
+    "hda-verb"
+    "hdajackretask"
+    "hdajacksensetest"
+    "hdspconf"
+    "hdsploader"
+    "hdspmixer"
+    # "hwmixvolume" # Requires old, unmaintained, abandoned EOL Python 2
+    "ld10k1"
+    # "qlo10k1" # needs Qt
+    "mixartloader"
+    "pcxhrloader"
+    "rmedigicontrol"
+    "sb16_csp"
+    # "seq" # mysterious configure error
+    "sscape_ctl"
+    "us428control"
+    # "usx2yloader" # tries to create /etc/hotplug/usb
+    "vxloader"
+  ];
+
+  configurePhase = ''
+    runHook preConfigure
+
+    for tool in $TOOLSET; do
+      echo "Configuring $tool:"
+      pushd "$tool"
+      ./configure --prefix="$out"
+      popd
+    done
+
+    runHook postConfigure
+  '';
+
+  buildPhase = ''
+    runHook preBuild
+
+    for tool in $TOOLSET; do
+      echo "Building $tool:"
+      pushd "$tool"
+      make
+      popd
+    done
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    for tool in $TOOLSET; do
+      echo "Installing $tool:"
+      pushd "$tool"
+      make install
+      popd
+    done
+
+    runHook postInstall
+  '';
+
+  fixupPhase = ''
+    runHook preFixup
+
+    wrapProgram $out/bin/hdajackretask \
+      --prefix PATH : ${lib.makeBinPath [ psmisc ]}
+
+    runHook postFixup
+  '';
+
+  meta = {
+    homepage = "http://www.alsa-project.org/";
+    description = "ALSA Tools";
+    license = lib.licenses.gpl2Plus;
+    maintainers = [ lib.maintainers.AndersonTorres ];
+    platforms = lib.platforms.linux;
+  };
+})
diff --git a/nixpkgs/pkgs/by-name/al/alsa-topology-conf/package.nix b/nixpkgs/pkgs/by-name/al/alsa-topology-conf/package.nix
new file mode 100644
index 000000000000..e0dfc879fbc9
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/al/alsa-topology-conf/package.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "alsa-topology-conf-${version}";
+  version = "1.2.5.1";
+
+  src = fetchurl {
+    url = "mirror://alsa/lib/${name}.tar.bz2";
+    sha256 = "sha256-98W64VRavNc4JLyX9OcsNA4Rq+oYi6DxwG9eCtd2sXk=";
+  };
+
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/alsa
+    cp -r topology $out/share/alsa
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.alsa-project.org/";
+    description = "ALSA topology configuration files";
+
+    longDescription = ''
+      The Advanced Linux Sound Architecture (ALSA) provides audio and
+      MIDI functionality to the Linux-based operating system.
+    '';
+
+    license = licenses.bsd3;
+    maintainers = [ maintainers.roastiek ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/by-name/al/alsa-ucm-conf/package.nix b/nixpkgs/pkgs/by-name/al/alsa-ucm-conf/package.nix
new file mode 100644
index 000000000000..75ec2932c890
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/al/alsa-ucm-conf/package.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "alsa-ucm-conf";
+  version = "1.2.9";
+
+  src = fetchurl {
+    url = "mirror://alsa/lib/${pname}-${version}.tar.bz2";
+    hash = "sha256-N09oM7/XfQpGdeSqK/t53v6FDlpGpdRUKkWWL0ueJyo=";
+  };
+
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/alsa
+    cp -r ucm ucm2 $out/share/alsa
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.alsa-project.org/";
+    description = "ALSA Use Case Manager configuration";
+
+    longDescription = ''
+      The Advanced Linux Sound Architecture (ALSA) provides audio and
+      MIDI functionality to the Linux-based operating system.
+    '';
+
+    license = licenses.bsd3;
+    maintainers = [ maintainers.roastiek ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/by-name/al/alsa-utils/package.nix b/nixpkgs/pkgs/by-name/al/alsa-utils/package.nix
new file mode 100644
index 000000000000..da559b5fcc1c
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/al/alsa-utils/package.nix
@@ -0,0 +1,47 @@
+{lib, stdenv, fetchurl, fetchpatch, alsa-lib, gettext, makeWrapper, ncurses, libsamplerate, pciutils, which, fftw}:
+
+stdenv.mkDerivation rec {
+  pname = "alsa-utils";
+  version = "1.2.10";
+
+  src = fetchurl {
+    url = "mirror://alsa/utils/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-EEti7H8Cp84WynefSBVhbfHMIZM1A3g6kQe1lE+DBjo=";
+  };
+  patches = [
+    # Backport fixes for musl libc. Remove on next release
+    (fetchpatch {
+      url = "https://github.com/alsa-project/alsa-utils/commit/8c229270f6bae83b705a03714c46067a7aa57b02.patch";
+      hash = "sha256-sUaBHY8EHf4805nF6tyNV5jYXcJf3O+r04VXFu4dUCE=";
+    })
+    (fetchpatch {
+      url = "https://github.com/alsa-project/alsa-utils/commit/0925ad7f09b2dc77015784f9ac2f5e34dd0dd5c3.patch";
+      hash = "sha256-bgGU9On82AUbOjo+KN6WfuhqUAWM87OHnKN7plpG284=";
+    })
+  ];
+
+  nativeBuildInputs = [ gettext makeWrapper ];
+  buildInputs = [ alsa-lib ncurses libsamplerate fftw ];
+
+  configureFlags = [ "--disable-xmlto" "--with-udev-rules-dir=$(out)/lib/udev/rules.d" ];
+
+  installFlags = [ "ASOUND_STATE_DIR=$(TMPDIR)/dummy" ];
+
+  postFixup = ''
+    mv $out/bin/alsa-info.sh $out/bin/alsa-info
+    wrapProgram $out/bin/alsa-info --prefix PATH : "${lib.makeBinPath [ which pciutils ]}"
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.alsa-project.org/";
+    description = "ALSA, the Advanced Linux Sound Architecture utils";
+    longDescription = ''
+      The Advanced Linux Sound Architecture (ALSA) provides audio and
+      MIDI functionality to the Linux-based operating system.
+    '';
+
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.AndersonTorres ];
+  };
+}