about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/lomiri
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/desktops/lomiri')
-rw-r--r--nixpkgs/pkgs/desktops/lomiri/applications/lomiri-terminal-app/default.nix104
-rw-r--r--nixpkgs/pkgs/desktops/lomiri/default.nix4
-rw-r--r--nixpkgs/pkgs/desktops/lomiri/development/lomiri-api/default.nix9
-rw-r--r--nixpkgs/pkgs/desktops/lomiri/services/content-hub/default.nix179
4 files changed, 296 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/desktops/lomiri/applications/lomiri-terminal-app/default.nix b/nixpkgs/pkgs/desktops/lomiri/applications/lomiri-terminal-app/default.nix
new file mode 100644
index 000000000000..31ef9ed8838c
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/lomiri/applications/lomiri-terminal-app/default.nix
@@ -0,0 +1,104 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, fetchpatch
+, gitUpdater
+, nixosTests
+, cmake
+, gsettings-qt
+, lomiri-ui-extras
+, lomiri-ui-toolkit
+, pkg-config
+, qmltermwidget
+, qtbase
+, qtdeclarative
+, qtsystems
+, wrapQtAppsHook
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "lomiri-terminal-app";
+  version = "2.0.2";
+
+  src = fetchFromGitLab {
+    owner = "ubports";
+    repo = "development/apps/lomiri-terminal-app";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-mXbPmVcl5dL78QUp+w3o4im5ohUQCPTKWLSVqlNO0yo=";
+  };
+
+  patches = [
+    # Stop usage of private qt5_use_modules function, seemingly unavailable in this package
+    # Remove when https://gitlab.com/ubports/development/apps/lomiri-terminal-app/-/merge_requests/103 merged & in release
+    (fetchpatch {
+      name = "0001-lomiri-terminal-app-Stop-using-qt5_use_modules.patch";
+      url = "https://gitlab.com/ubports/development/apps/lomiri-terminal-app/-/commit/db210c74e771a427066aebdc3a99cab6e782d326.patch";
+      hash = "sha256-op4+/eo8rBRMcW6MZ0rOEFReM7JBCck1B+AsgAPyqAI=";
+    })
+
+    # Explicitly bind textdomain, don't rely on hacky workaround in LUITK
+    # Remove when https://gitlab.com/ubports/development/apps/lomiri-terminal-app/-/merge_requests/104 merged & in release
+    (fetchpatch {
+      name = "0002-lomiri-terminal-app-Call-i18n.bindtextdomain.patch";
+      url = "https://gitlab.com/ubports/development/apps/lomiri-terminal-app/-/commit/7f9d419e29043f0d0922d2ac1dce5673e2723a01.patch";
+      hash = "sha256-HfIvGVbIdTasoHAfHysnzFLufQQ4lskym5HTekH+mjk=";
+    })
+
+    # Add more & correct existing usage of GNUInstallDirs variables
+    # Remove when https://gitlab.com/ubports/development/apps/lomiri-terminal-app/-/merge_requests/105 merged & in release
+    (fetchpatch {
+      name = "0003-lomiri-terminal-app-GNUInstallDirs-usage.patch";
+      url = "https://gitlab.com/ubports/development/apps/lomiri-terminal-app/-/commit/fcde1f05bb442c74b1dff95917fd7594f26e97a7.patch";
+      hash = "sha256-umxCMGNjyz0TVmwH0Gl0MpgjLQtkW9cHkUfpNJcoasE=";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
+
+    # Tests look abandoned - add_test in CMake code is commented out, refers to old repo structure in import paths
+    sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    qtbase
+    qtdeclarative
+    qmltermwidget
+
+    # QML
+    gsettings-qt
+    lomiri-ui-extras
+    lomiri-ui-toolkit
+    qtsystems
+  ];
+
+  cmakeFlags = [
+    "-DINSTALL_TESTS=OFF"
+    "-DCLICK_MODE=OFF"
+  ];
+
+  passthru = {
+    tests.vm-test = nixosTests.terminal-emulators.lomiri-terminal-app;
+    updateScript = gitUpdater {
+      rev-prefix = "v";
+    };
+  };
+
+  meta = with lib; {
+    description = "A terminal app for desktop and mobile devices";
+    homepage = "https://gitlab.com/ubports/development/apps/lomiri-terminal-app";
+    license = licenses.gpl3Only;
+    mainProgram = "lomiri-terminal-app";
+    maintainers = teams.lomiri.members;
+    platforms = platforms.linux;
+  };
+})
diff --git a/nixpkgs/pkgs/desktops/lomiri/default.nix b/nixpkgs/pkgs/desktops/lomiri/default.nix
index 70caa9d64420..f1161155ae37 100644
--- a/nixpkgs/pkgs/desktops/lomiri/default.nix
+++ b/nixpkgs/pkgs/desktops/lomiri/default.nix
@@ -7,6 +7,9 @@ let
   packages = self: let
     inherit (self) callPackage;
   in {
+    #### Core Apps
+    lomiri-terminal-app = callPackage ./applications/lomiri-terminal-app { };
+
     #### Data
     lomiri-schemas = callPackage ./data/lomiri-schemas { };
     suru-icon-theme = callPackage ./data/suru-icon-theme { };
@@ -31,6 +34,7 @@ let
 
     #### Services
     biometryd = callPackage ./services/biometryd { };
+    content-hub = callPackage ./services/content-hub { };
     hfd-service = callPackage ./services/hfd-service { };
     history-service = callPackage ./services/history-service { };
     lomiri-download-manager = callPackage ./services/lomiri-download-manager { };
diff --git a/nixpkgs/pkgs/desktops/lomiri/development/lomiri-api/default.nix b/nixpkgs/pkgs/desktops/lomiri/development/lomiri-api/default.nix
index f4a7c968c66f..9f699bbd715a 100644
--- a/nixpkgs/pkgs/desktops/lomiri/development/lomiri-api/default.nix
+++ b/nixpkgs/pkgs/desktops/lomiri/development/lomiri-api/default.nix
@@ -1,6 +1,7 @@
 { stdenv
 , lib
 , fetchFromGitLab
+, fetchpatch
 , gitUpdater
 , makeFontsConf
 , testers
@@ -31,6 +32,14 @@ stdenv.mkDerivation (finalAttrs: {
 
   outputs = [ "out" "dev" "doc" ];
 
+  patches = [
+    (fetchpatch {
+      name = "0001-lomiri-api-Add-missing-headers-for-GCC13.patch";
+      url = "https://gitlab.com/ubports/development/core/lomiri-api/-/commit/029b42a9b4d5467951595dff8bc536eb5a9e3ef7.patch";
+      hash = "sha256-eWrDQGrwf22X49rtUAVbrd+QN+OwyGacVLCWYFsS02o=";
+    })
+  ];
+
   postPatch = ''
     patchShebangs $(find test -name '*.py')
 
diff --git a/nixpkgs/pkgs/desktops/lomiri/services/content-hub/default.nix b/nixpkgs/pkgs/desktops/lomiri/services/content-hub/default.nix
new file mode 100644
index 000000000000..6fb05b445ed8
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/lomiri/services/content-hub/default.nix
@@ -0,0 +1,179 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, fetchpatch
+, fetchpatch2
+, gitUpdater
+, testers
+, cmake
+, cmake-extras
+, dbus-test-runner
+, gettext
+, glib
+, gsettings-qt
+, gtest
+, libapparmor
+, libnotify
+, lomiri-api
+, lomiri-app-launch
+, lomiri-download-manager
+, lomiri-ui-toolkit
+, pkg-config
+, properties-cpp
+, qtbase
+, qtdeclarative
+, qtfeedback
+, qtgraphicaleffects
+, wrapGAppsHook
+, xvfb-run
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "content-hub";
+  version = "1.1.0";
+
+  src = fetchFromGitLab {
+    owner = "ubports";
+    repo = "development/core/content-hub";
+    rev = finalAttrs.version;
+    hash = "sha256-IntEpgPCBmOL6K6TU+UhgGb6OHVA9pYurK5VN3woIIw=";
+  };
+
+  outputs = [
+    "out"
+    "dev"
+    "examples"
+  ];
+
+  patches = [
+    # Remove when https://gitlab.com/ubports/development/core/content-hub/-/merge_requests/33 merged & in release
+    (fetchpatch {
+      name = "0001-content-hub-Migrate-to-GetConnectionCredentials.patch";
+      url = "https://gitlab.com/ubports/development/core/content-hub/-/commit/9c0eae42d856b4b6e24fa609ade0e674c7a84cfe.patch";
+      hash = "sha256-IWoCQKSCCk26n7133oG0Ht+iEjavn/IiOVUM+tCLX2U=";
+    })
+
+    # Remove when https://gitlab.com/ubports/development/core/content-hub/-/merge_requests/34 merged & in release
+    (fetchpatch {
+      name = "0002-content-hub-import-Lomiri-Content-CMakeLists-Drop-qt-argument-to-qmlplugindump.patch";
+      url = "https://gitlab.com/ubports/development/core/content-hub/-/commit/63a4baf1469de31c4fd50c69ed85d061f5e8e80a.patch";
+      hash = "sha256-T+6T9lXne6AhDFv9d7L8JNwdl8f0wjDmvSoNVPkHza4=";
+    })
+
+    # Remove when https://gitlab.com/ubports/development/core/content-hub/-/merge_requests/35 merged & in release
+    # fetchpatch2 due to renames, https://github.com/NixOS/nixpkgs/issues/32084
+    (fetchpatch2 {
+      name = "0003-content-hub-Add-more-better-GNUInstallDirs-variables-usage.patch";
+      url = "https://gitlab.com/ubports/development/core/content-hub/-/commit/3c5ca4a8ec125e003aca78c14521b70140856c25.patch";
+      hash = "sha256-kYN0eLwMyM/9yK+zboyEsoPKZMZ4SCXodVYsvkQr2F8=";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace import/*/Content/CMakeLists.txt \
+      --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
+
+    # Look for peer files in running system
+    substituteInPlace src/com/lomiri/content/service/registry-updater.cpp \
+      --replace '/usr' '/run/current-system/sw'
+
+    # Don't override default theme search path (which honours XDG_DATA_DIRS) with a FHS assumption
+    substituteInPlace import/Lomiri/Content/contenthubplugin.cpp \
+      --replace 'QIcon::setThemeSearchPaths(QStringList() << ("/usr/share/icons/"));' ""
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    cmake
+    gettext
+    pkg-config
+    qtdeclarative # qmlplugindump
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    cmake-extras
+    glib
+    gsettings-qt
+    libapparmor
+    libnotify
+    lomiri-api
+    lomiri-app-launch
+    lomiri-download-manager
+    lomiri-ui-toolkit
+    properties-cpp
+    qtbase
+    qtdeclarative
+    qtfeedback
+    qtgraphicaleffects
+  ];
+
+  nativeCheckInputs = [
+    dbus-test-runner
+    xvfb-run
+  ];
+
+  checkInputs = [
+    gtest
+  ];
+
+  dontWrapQtApps = true;
+
+  cmakeFlags = [
+    (lib.cmakeBool "GSETTINGS_COMPILE" true)
+    (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
+    (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
+    (lib.cmakeBool "ENABLE_DOC" false) # needs Qt5 qdoc: https://github.com/NixOS/nixpkgs/pull/245379
+    (lib.cmakeBool "ENABLE_UBUNTU_COMPAT" true) # in case something still depends on it
+  ];
+
+  preBuild = let
+    listToQtVar = list: suffix: lib.strings.concatMapStringsSep ":" (drv: "${lib.getBin drv}/${suffix}") list;
+  in ''
+    # Executes qmlplugindump
+    export QT_PLUGIN_PATH=${listToQtVar [ qtbase ] qtbase.qtPluginPrefix}
+    export QML2_IMPORT_PATH=${listToQtVar [ qtdeclarative lomiri-ui-toolkit qtfeedback qtgraphicaleffects ] qtbase.qtQmlPrefix}
+  '';
+
+  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
+
+  # Starts & talks to D-Bus services, breaks under parallelism
+  enableParallelChecking = false;
+
+  preFixup = ''
+    for exampleExe in content-hub-test-{importer,exporter,sharer}; do
+      moveToOutput bin/$exampleExe $examples
+      moveToOutput share/applications/$exampleExe.desktop $examples
+    done
+    moveToOutput share/icons $examples
+  '';
+
+  postFixup = ''
+    for exampleBin in $examples/bin/*; do
+      wrapGApp $exampleBin
+    done
+  '';
+
+  passthru = {
+    tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
+    updateScript = gitUpdater { };
+  };
+
+  meta = with lib; {
+    description = "Content sharing/picking service";
+    longDescription = ''
+      content-hub is a mediation service to let applications share content between them,
+      even if they are not running at the same time.
+    '';
+    homepage = "https://gitlab.com/ubports/development/core/content-hub";
+    license = with licenses; [ gpl3Only lgpl3Only ];
+    mainProgram = "content-hub-service";
+    maintainers = teams.lomiri.members;
+    platforms = platforms.linux;
+    pkgConfigModules = [
+      "libcontent-hub"
+      "libcontent-hub-glib"
+    ];
+  };
+})