From 5191e540accd5b899a4e1faa9966dfd689bc8c6b Mon Sep 17 00:00:00 2001 From: rewine Date: Thu, 12 Jan 2023 13:31:22 +0800 Subject: [PATCH] deepin.dde-device-formatter: init at unstable-2022-09-05 --- pkgs/desktops/deepin/default.nix | 1 + .../tools/dde-device-formatter/default.nix | 69 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 pkgs/desktops/deepin/tools/dde-device-formatter/default.nix diff --git a/pkgs/desktops/deepin/default.nix b/pkgs/desktops/deepin/default.nix index 4195af30e5d7..9c8c7adff7ca 100644 --- a/pkgs/desktops/deepin/default.nix +++ b/pkgs/desktops/deepin/default.nix @@ -57,6 +57,7 @@ let deepin-desktop-schemas = callPackage ./go-package/deepin-desktop-schemas { }; #### TOOLS + dde-device-formatter = callPackage ./tools/dde-device-formatter { }; deepin-gettext-tools = callPackage ./tools/deepin-gettext-tools { }; #### ARTWORK diff --git a/pkgs/desktops/deepin/tools/dde-device-formatter/default.nix b/pkgs/desktops/deepin/tools/dde-device-formatter/default.nix new file mode 100644 index 000000000000..87a2fe1b66c7 --- /dev/null +++ b/pkgs/desktops/deepin/tools/dde-device-formatter/default.nix @@ -0,0 +1,69 @@ +{ stdenv +, lib +, fetchFromGitHub +, fetchpatch +, dtkwidget +, deepin-gettext-tools +, qt5integration +, qmake +, qtbase +, qttools +, qtx11extras +, pkg-config +, wrapQtAppsHook +, udisks2-qt5 +}: + +stdenv.mkDerivation rec { + pname = "dde-device-formatter"; + version = "unstable-2022-09-05"; + + src = fetchFromGitHub { + owner = "linuxdeepin"; + repo = pname; + rev = "9b8489cb2bb7c85bd62557d16a5eabc94100512e"; + sha256 = "sha256-Mi48dSDCoKhr8CGt9z64/9d7+r9QSrPPICv+R5VDuaU="; + }; + + patches = [ + (fetchpatch { + name = "chore: don't use hardcode path"; + url = "https://github.com/linuxdeepin/dde-device-formatter/commit/b836a498b8e783e0dff3820302957f15ee8416eb.patch"; + sha256 = "sha256-i/VqJ6EmCyhE6weHKUB66bW6b51gLyssIAzb5li4aJM="; + }) + ]; + + postPatch = '' + substituteInPlace dde-device-formatter.pro --replace "/usr" "$out" + patchShebangs *.sh + ''; + + nativeBuildInputs = [ + qmake + qttools + pkg-config + wrapQtAppsHook + deepin-gettext-tools + ]; + + buildInputs = [ + dtkwidget + udisks2-qt5 + qtx11extras + ]; + + cmakeFlags = [ "-DVERSION=${version}" ]; + + # qt5integration must be placed before qtsvg in QT_PLUGIN_PATH + qtWrapperArgs = [ + "--prefix QT_PLUGIN_PATH : ${qt5integration}/${qtbase.qtPluginPrefix}" + ]; + + meta = with lib; { + description = "A simple graphical interface for creating file system in a block device"; + homepage = "https://github.com/linuxdeepin/dde-device-formatter"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = teams.deepin.members; + }; +}