Unverified Commit fc3229db authored by rewine's avatar rewine Committed by GitHub
Browse files

Merge pull request #310305 from wineee/dtk6-qt6

deepin.dtk6: init
parents f4223423 1c0f273d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@ let
    image-editor = callPackage ./library/image-editor { };
    udisks2-qt5 = callPackage ./library/udisks2-qt5 { };
    util-dfm = callPackage ./library/util-dfm { };
    dtk6core = callPackage ./library/dtk6core { };
    dtk6gui = callPackage ./library/dtk6gui { };
    dtk6widget = callPackage ./library/dtk6widget { };
    dtk6declarative = callPackage ./library/dtk6declarative { };
    dtk6systemsettings = callPackage ./library/dtk6systemsettings { };

    #### CORE
    deepin-kwin = callPackage ./core/deepin-kwin { };
+84 −0
Original line number Diff line number Diff line
{ stdenv
, lib
, fetchFromGitHub
, cmake
, pkg-config
, doxygen
, qt6Packages
, lshw
, libuchardet
, spdlog
, dtkcommon
, systemd
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "dtk6core";
  version = "6.0.15";

  src = fetchFromGitHub {
    owner = "linuxdeepin";
    repo = "dtk6core";
    rev = finalAttrs.version;
    hash = "sha256-zUJFilafR0hNH/Owmuyh6BLBFPbBuFKcHv40fena0GM=";
  };

  patches = [
    ./fix-pkgconfig-path.patch
    ./fix-pri-path.patch
  ];

  nativeBuildInputs = [
    cmake
    pkg-config
    doxygen
    qt6Packages.qttools
    qt6Packages.wrapQtAppsHook
  ];

  dontWrapQtApps = true;

  buildInputs = [
    qt6Packages.qtbase
    lshw
    libuchardet
    spdlog
  ]
  ++ lib.optional withSystemd systemd;

  propagatedBuildInputs = [ dtkcommon ];

  cmakeFlags = [
    "-DDTK_VERSION=${finalAttrs.version}"
    "-DBUILD_DOCS=ON"
    "-DBUILD_EXAMPLES=OFF"
    "-DQCH_INSTALL_DESTINATION=${placeholder "doc"}/share/doc"
    "-DDSG_PREFIX_PATH='/run/current-system/sw'"
    "-DMKSPECS_INSTALL_DIR=${placeholder "out"}/mkspecs/modules"
    "-DD_DSG_APP_DATA_FALLBACK=/var/dsg/appdata"
    "-DBUILD_WITH_SYSTEMD=${if withSystemd then "ON" else "OFF"}"
  ];

  preConfigure = ''
    # qt.qpa.plugin: Could not find the Qt platform plugin "minimal"
    # A workaround is to set QT_PLUGIN_PATH explicitly
    export QT_PLUGIN_PATH=${lib.getBin qt6Packages.qtbase}/${qt6Packages.qtbase.qtPluginPrefix}
  '';

  outputs = [ "out" "dev" "doc" ];

  postFixup = ''
    for binary in $out/libexec/dtk6/DCore/bin/*; do
      wrapQtApp $binary
    done
  '';

  meta = {
    description = "Deepin tool kit core library";
    homepage = "https://github.com/linuxdeepin/dtk6core";
    license = lib.licenses.lgpl3Plus;
    platforms = lib.platforms.linux;
    maintainers = lib.teams.deepin.members;
  };
})
+14 −0
Original line number Diff line number Diff line
diff --git a/misc/dtkcore.pc.in b/misc/dtkcore.pc.in
index 83eecb7..da24ce8 100644
--- a/misc/dtkcore.pc.in
+++ b/misc/dtkcore.pc.in
@@ -1,7 +1,7 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
-libdir=${prefix}/@LIBRARY_INSTALL_DIR@
-includedir=${prefix}/@INCLUDE_INSTALL_DIR@
+libdir=@LIBRARY_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
 
 Name: dtk@DTK_VERSION_MAJOR@core
 Description: Deepin Tool Kit dtkcore header files
+17 −0
Original line number Diff line number Diff line
diff --git a/misc/qt_lib_dtkcore.pri.in b/misc/qt_lib_dtkcore.pri.in
index a331f52..ce01dc0 100644
--- a/misc/qt_lib_dtkcore.pri.in
+++ b/misc/qt_lib_dtkcore.pri.in
@@ -4,9 +4,9 @@ QT.dtkcore.MINOR_VERSION = @PROJECT_VERSION_MINOR@
 QT.dtkcore.PATCH_VERSION = @PROJECT_VERSION_PATCH@
 QT.dtkcore.name = dtkcore
 QT.dtkcore.module = dtk@DTK_VERSION_MAJOR@core
-QT.dtkcore.tools = @CMAKE_INSTALL_PREFIX@/@TOOL_INSTALL_DIR@
-QT.dtkcore.libs = @CMAKE_INSTALL_PREFIX@/@LIBRARY_INSTALL_DIR@
-QT.dtkcore.includes = @CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@
+QT.dtkcore.tools = @TOOL_INSTALL_DIR@
+QT.dtkcore.libs = @LIBRARY_INSTALL_DIR@
+QT.dtkcore.includes = @INCLUDE_INSTALL_DIR@
 QT.dtkcore.frameworks =
 QT.dtkcore.depends = core dbus xml
 QT.dtkcore.module_config = v2 ltcg
+70 −0
Original line number Diff line number Diff line
{ stdenv
, lib
, fetchFromGitHub
, cmake
, pkg-config
, doxygen
, qt6Packages
, dtk6gui
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "dtk6declarative";
  version = "6.0.15";

  src = fetchFromGitHub {
    owner = "linuxdeepin";
    repo = "dtk6declarative";
    rev = finalAttrs.version;
    hash = "sha256-euHEfK2N2jtWMzeajgvTnHSl39zXwp7I0cQIqZRVGZ0=";
  };

  patches = [
    ./fix-pkgconfig-path.patch
    ./fix-pri-path.patch
  ];

  nativeBuildInputs = [
    cmake
    pkg-config
    doxygen
    qt6Packages.qttools
    qt6Packages.wrapQtAppsHook
  ];

  propagatedBuildInputs = [
    dtk6gui
  ] ++ (with qt6Packages ; [
    qtbase
    qtdeclarative
    qtshadertools
    qt5compat
  ]);

  cmakeFlags = [
    "-DDTK_VERSION=${finalAttrs.version}"
    "-DBUILD_DOCS=ON"
    "-DBUILD_EXAMPLES=ON"
    "-DMKSPECS_INSTALL_DIR=${placeholder "dev"}/mkspecs/modules"
    "-DQCH_INSTALL_DESTINATION=${placeholder "doc"}/share/doc"
    "-DQML_INSTALL_DIR=${placeholder "out"}/${qt6Packages.qtbase.qtQmlPrefix}"
  ];

  preConfigure = ''
    # qt.qpa.plugin: Could not find the Qt platform plugin "minimal"
    # A workaround is to set QT_PLUGIN_PATH explicitly
    export QT_PLUGIN_PATH=${lib.getBin qt6Packages.qtbase}/${qt6Packages.qtbase.qtPluginPrefix}
    export QML2_IMPORT_PATH=${lib.getBin qt6Packages.qtdeclarative}/${qt6Packages.qtbase.qtQmlPrefix}
  '';

  outputs = [ "out" "dev" "doc" ];

  meta = {
    description = "A widget development toolkit based on QtQuick/QtQml";
    mainProgram = "dtk-exhibition";
    homepage = "https://github.com/linuxdeepin/dtk6declarative";
    license = lib.licenses.lgpl3Plus;
    platforms = lib.platforms.linux;
    maintainers = lib.teams.deepin.members;
  };
})
Loading