From aa1a4a413eecb93daee0e192e73568499af9d0aa Mon Sep 17 00:00:00 2001 From: Guy Chronister Date: Wed, 27 May 2026 16:39:31 -0500 Subject: [PATCH] cdemu: inline common-drv-attrs and refactor --- .../applications/emulators/cdemu/analyzer.nix | 45 +++++++++++----- pkgs/applications/emulators/cdemu/client.nix | 44 +++++++++++----- .../emulators/cdemu/common-drv-attrs.nix | 33 ------------ pkgs/applications/emulators/cdemu/daemon.nix | 52 ++++++++++--------- pkgs/applications/emulators/cdemu/gui.nix | 50 ++++++++++++------ .../emulators/cdemu/libmirage.nix | 38 ++++++-------- 6 files changed, 140 insertions(+), 122 deletions(-) delete mode 100644 pkgs/applications/emulators/cdemu/common-drv-attrs.nix diff --git a/pkgs/applications/emulators/cdemu/analyzer.nix b/pkgs/applications/emulators/cdemu/analyzer.nix index e9065676e147..90fdb30a1821 100644 --- a/pkgs/applications/emulators/cdemu/analyzer.nix +++ b/pkgs/applications/emulators/cdemu/analyzer.nix @@ -1,7 +1,6 @@ { cmake, pkg-config, - callPackage, gobject-introspection, wrapGAppsHook3, python3Packages, @@ -11,20 +10,17 @@ gdk-pixbuf, intltool, libmirage, + fetchurl, + lib, }: -python3Packages.buildPythonApplication { +python3Packages.buildPythonApplication (finalAttrs: { + pname = "image-analyzer"; + version = "3.2.6"; - inherit - (callPackage ./common-drv-attrs.nix { - version = "3.2.6"; - pname = "image-analyzer"; - hash = "sha256-7I8RUgd+k3cEzskJGbziv1f0/eo5QQXn62wGh/Y5ozc="; - }) - pname - version - src - meta - ; + src = fetchurl { + url = "mirror://sourceforge/cdemu/image-analyzer-${finalAttrs.version}.tar.xz"; + hash = "sha256-7I8RUgd+k3cEzskJGbziv1f0/eo5QQXn62wGh/Y5ozc="; + }; buildInputs = [ libxml2 @@ -33,10 +29,12 @@ python3Packages.buildPythonApplication { adwaita-icon-theme gdk-pixbuf ]; + propagatedBuildInputs = with python3Packages; [ pygobject3 matplotlib ]; + nativeBuildInputs = [ cmake pkg-config @@ -47,8 +45,27 @@ python3Packages.buildPythonApplication { pyproject = false; dontWrapGApps = true; + preFixup = '' makeWrapperArgs+=("''${gappsWrapperArgs[@]}") ''; -} + meta = { + description = "Suite of tools for emulating optical drives and discs"; + longDescription = '' + CDEmu consists of: + + - a kernel module implementing a virtual drive-controller + - libmirage which is a software library for interpreting optical disc images + - a daemon which emulates the functionality of an optical drive+disc + - textmode and GTK clients for controlling the emulator + - an image analyzer to view the structure of image files + + Optical media emulated by CDemu can be mounted within Linux. Automounting is also allowed. + ''; + homepage = "https://cdemu.sourceforge.io/"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ bendlas ]; + }; +}) diff --git a/pkgs/applications/emulators/cdemu/client.nix b/pkgs/applications/emulators/cdemu/client.nix index afb68755775c..c45fda289abc 100644 --- a/pkgs/applications/emulators/cdemu/client.nix +++ b/pkgs/applications/emulators/cdemu/client.nix @@ -1,25 +1,21 @@ { - callPackage, python3Packages, cmake, pkg-config, intltool, wrapGAppsNoGuiHook, gobject-introspection, + fetchurl, + lib, }: -python3Packages.buildPythonApplication { +python3Packages.buildPythonApplication (finalAttrs: { + pname = "cdemu-client"; + version = "3.2.5"; - inherit - (callPackage ./common-drv-attrs.nix { - version = "3.2.5"; - pname = "cdemu-client"; - hash = "sha256-py2F61v8vO0BCM18GCflAiD48deZjbMM6wqoCDZsOd8="; - }) - pname - version - src - meta - ; + src = fetchurl { + url = "mirror://sourceforge/cdemu/cdemu-client-${finalAttrs.version}.tar.xz"; + hash = "sha256-py2F61v8vO0BCM18GCflAiD48deZjbMM6wqoCDZsOd8="; + }; nativeBuildInputs = [ cmake @@ -28,6 +24,7 @@ python3Packages.buildPythonApplication { wrapGAppsNoGuiHook gobject-introspection ]; + propagatedBuildInputs = with python3Packages; [ dbus-python pygobject3 @@ -35,8 +32,27 @@ python3Packages.buildPythonApplication { pyproject = false; dontWrapGApps = true; + preFixup = '' makeWrapperArgs+=("''${gappsWrapperArgs[@]}") ''; -} + meta = { + description = "Suite of tools for emulating optical drives and discs"; + longDescription = '' + CDEmu consists of: + + - a kernel module implementing a virtual drive-controller + - libmirage which is a software library for interpreting optical disc images + - a daemon which emulates the functionality of an optical drive+disc + - textmode and GTK clients for controlling the emulator + - an image analyzer to view the structure of image files + + Optical media emulated by CDemu can be mounted within Linux. Automounting is also allowed. + ''; + homepage = "https://cdemu.sourceforge.io/"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ bendlas ]; + }; +}) diff --git a/pkgs/applications/emulators/cdemu/common-drv-attrs.nix b/pkgs/applications/emulators/cdemu/common-drv-attrs.nix deleted file mode 100644 index edc3361a5fad..000000000000 --- a/pkgs/applications/emulators/cdemu/common-drv-attrs.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - lib, - fetchurl, - pname, - version, - hash, -}: - -{ - inherit pname version; - src = fetchurl { - url = "mirror://sourceforge/cdemu/${pname}-${version}.tar.xz"; - inherit hash; - }; - meta = { - description = "Suite of tools for emulating optical drives and discs"; - longDescription = '' - CDEmu consists of: - - - a kernel module implementing a virtual drive-controller - - libmirage which is a software library for interpreting optical disc images - - a daemon which emulates the functionality of an optical drive+disc - - textmode and GTK clients for controlling the emulator - - an image analyzer to view the structure of image files - - Optical media emulated by CDemu can be mounted within Linux. Automounting is also allowed. - ''; - homepage = "https://cdemu.sourceforge.io/"; - license = lib.licenses.gpl2Plus; - platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ bendlas ]; - }; -} diff --git a/pkgs/applications/emulators/cdemu/daemon.nix b/pkgs/applications/emulators/cdemu/daemon.nix index 874b0522aa07..42cac77cba31 100644 --- a/pkgs/applications/emulators/cdemu/daemon.nix +++ b/pkgs/applications/emulators/cdemu/daemon.nix @@ -1,6 +1,5 @@ { stdenv, - callPackage, cmake, pkg-config, glib, @@ -8,34 +7,31 @@ intltool, libmirage, coreutils, + fetchurl, + lib, }: -let - inherit - (callPackage ./common-drv-attrs.nix { - version = "3.2.7"; - pname = "cdemu-daemon"; - hash = "sha256-EKh2G6RA9Yq46BpTAqN2s6TpLJb8gwDuEpGiwdGcelc="; - }) - pname - version - src - meta - ; -in -stdenv.mkDerivation { - inherit pname version src; +stdenv.mkDerivation (finalAttrs: { + pname = "cdemu-daemon"; + version = "3.2.7"; + + src = fetchurl { + url = "mirror://sourceforge/cdemu/cdemu-daemon-${finalAttrs.version}.tar.xz"; + hash = "sha256-EKh2G6RA9Yq46BpTAqN2s6TpLJb8gwDuEpGiwdGcelc="; + }; nativeBuildInputs = [ cmake pkg-config intltool ]; + buildInputs = [ glib libao libmirage ]; + postInstall = '' mkdir -p $out/share/dbus-1/services cp -R ../service-example $out/share/cdemu @@ -46,14 +42,22 @@ stdenv.mkDerivation { ''; meta = { - inherit (meta) - description - license - longDescription - maintainers - platforms - ; + description = "Suite of tools for emulating optical drives and discs"; + longDescription = '' + CDEmu consists of: + + - a kernel module implementing a virtual drive-controller + - libmirage which is a software library for interpreting optical disc images + - a daemon which emulates the functionality of an optical drive+disc + - textmode and GTK clients for controlling the emulator + - an image analyzer to view the structure of image files + + Optical media emulated by CDemu can be mounted within Linux. Automounting is also allowed. + ''; homepage = "https://cdemu.sourceforge.io/about/daemon/"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ bendlas ]; mainProgram = "cdemu-daemon"; }; -} +}) diff --git a/pkgs/applications/emulators/cdemu/gui.nix b/pkgs/applications/emulators/cdemu/gui.nix index 90523e12ead6..11fd3c2c7c88 100644 --- a/pkgs/applications/emulators/cdemu/gui.nix +++ b/pkgs/applications/emulators/cdemu/gui.nix @@ -1,5 +1,4 @@ { - callPackage, cmake, pkg-config, wrapGAppsHook3, @@ -10,20 +9,18 @@ adwaita-icon-theme, gdk-pixbuf, libappindicator-gtk3, + fetchurl, + lib, }: -python3Packages.buildPythonApplication { - inherit - (callPackage ./common-drv-attrs.nix { - version = "3.2.6"; - pname = "gcdemu"; - hash = "sha256-w4vzKoSotL5Cjfr4Cu4YhNSWXJqS+n/vySrwvbhR1zA="; - }) - pname - version - src - meta - ; +python3Packages.buildPythonApplication (finalAttrs: { + pname = "gcdemu"; + version = "3.2.6"; + + src = fetchurl { + url = "mirror://sourceforge/cdemu/gcdemu-${finalAttrs.version}.tar.xz"; + hash = "sha256-w4vzKoSotL5Cjfr4Cu4YhNSWXJqS+n/vySrwvbhR1zA="; + }; nativeBuildInputs = [ cmake @@ -32,18 +29,41 @@ python3Packages.buildPythonApplication { intltool gobject-introspection ]; + buildInputs = [ libnotify adwaita-icon-theme gdk-pixbuf libappindicator-gtk3 ]; - propagatedBuildInputs = with python3Packages; [ pygobject3 ]; + + propagatedBuildInputs = with python3Packages; [ + pygobject3 + ]; pyproject = false; dontWrapGApps = true; + preFixup = '' makeWrapperArgs+=("''${gappsWrapperArgs[@]}") ''; -} + meta = { + description = "Suite of tools for emulating optical drives and discs"; + longDescription = '' + CDEmu consists of: + + - a kernel module implementing a virtual drive-controller + - libmirage which is a software library for interpreting optical disc images + - a daemon which emulates the functionality of an optical drive+disc + - textmode and GTK clients for controlling the emulator + - an image analyzer to view the structure of image files + + Optical media emulated by CDemu can be mounted within Linux. Automounting is also allowed. + ''; + homepage = "https://cdemu.sourceforge.io/"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ bendlas ]; + }; +}) diff --git a/pkgs/applications/emulators/cdemu/libmirage.nix b/pkgs/applications/emulators/cdemu/libmirage.nix index e2017be9616c..16e1cc2e3a01 100644 --- a/pkgs/applications/emulators/cdemu/libmirage.nix +++ b/pkgs/applications/emulators/cdemu/libmirage.nix @@ -1,6 +1,5 @@ { stdenv, - callPackage, cmake, pkg-config, gobject-introspection, @@ -16,23 +15,18 @@ util-linux, libselinux, libsepol, + fetchurl, + lib, }: -let - inherit - (callPackage ./common-drv-attrs.nix { - version = "3.2.10"; - pname = "libmirage"; - hash = "sha256-+T5Gu3VcprCkSJcq/kTySRnNI7nc+GbRtctLkzPhgK4="; - }) - pname - version - src - meta - ; -in -stdenv.mkDerivation { - inherit pname version src; +stdenv.mkDerivation (finalAttrs: { + pname = "libmirage"; + version = "3.2.10"; + + src = fetchurl { + url = "mirror://sourceforge/cdemu/libmirage-${finalAttrs.version}.tar.xz"; + hash = "sha256-+T5Gu3VcprCkSJcq/kTySRnNI7nc+GbRtctLkzPhgK4="; + }; env = { PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "out"}/share/gir-1.0"; @@ -47,6 +41,7 @@ stdenv.mkDerivation { xz libsamplerate ]; + nativeBuildInputs = [ cmake pkg-config @@ -54,6 +49,7 @@ stdenv.mkDerivation { gobject-introspection vala ]; + propagatedBuildInputs = [ pcre util-linux @@ -62,12 +58,10 @@ stdenv.mkDerivation { ]; meta = { - inherit (meta) - maintainers - license - platforms - ; + maintainers = with lib.maintainers; [ bendlas ]; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; description = "CD-ROM image access library"; homepage = "https://cdemu.sourceforge.io/about/libmirage/"; }; -} +})