diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-08-08 16:04:42 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-08-13 06:35:37 +0000 |
commit | 12aaa58dac35800b5b7d77f81cf2a87c21ee55da (patch) | |
tree | be0add9e5c22a85d20b5d78206aa74f956eb2a1b /nixpkgs/pkgs/desktops/lomiri | |
parent | 45892a5591202f75a1c2f1ca7c62a92c7566e3c5 (diff) | |
parent | 5a8e9243812ba528000995b294292d3b5e120947 (diff) | |
download | nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.gz nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.bz2 nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.lz nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.xz nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.zst nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.zip |
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts: nixpkgs/pkgs/applications/window-managers/sway/default.nix nixpkgs/pkgs/build-support/go/module.nix nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix nixpkgs/pkgs/development/libraries/mesa/default.nix nixpkgs/pkgs/servers/dict/dictd-db.nix Link: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/issues/391
Diffstat (limited to 'nixpkgs/pkgs/desktops/lomiri')
7 files changed, 589 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/desktops/lomiri/default.nix b/nixpkgs/pkgs/desktops/lomiri/default.nix new file mode 100644 index 000000000000..4aa91bae9f9c --- /dev/null +++ b/nixpkgs/pkgs/desktops/lomiri/default.nix @@ -0,0 +1,19 @@ +{ lib +, pkgs +, libsForQt5 +}: + +let + packages = self: let + inherit (self) callPackage; + in { + #### Development tools / libraries + cmake-extras = callPackage ./development/cmake-extras { }; + deviceinfo = callPackage ./development/deviceinfo { }; + geonames = callPackage ./development/geonames { }; + gmenuharness = callPackage ./development/gmenuharness { }; + libusermetrics = callPackage ./development/libusermetrics { }; + lomiri-api = callPackage ./development/lomiri-api { }; + }; +in + lib.makeScope libsForQt5.newScope packages diff --git a/nixpkgs/pkgs/desktops/lomiri/development/cmake-extras/default.nix b/nixpkgs/pkgs/desktops/lomiri/development/cmake-extras/default.nix new file mode 100644 index 000000000000..ee5665cd668f --- /dev/null +++ b/nixpkgs/pkgs/desktops/lomiri/development/cmake-extras/default.nix @@ -0,0 +1,49 @@ +{ stdenvNoCC +, lib +, fetchFromGitLab +, cmake +, qtbase +}: + +stdenvNoCC.mkDerivation { + pname = "cmake-extras"; + version = "unstable-2022-11-21"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/cmake-extras"; + rev = "99aab4514ee182cb7a94821b4b51e4d8cb9a82ef"; + hash = "sha256-axj5QxgDrHy0HiZkfrbm22hVvSCKkWFoQC8MdQMm9tg="; + }; + + postPatch = '' + # We have nothing to build here, no need to depend on a C compiler + substituteInPlace CMakeLists.txt \ + --replace 'project(cmake-extras)' 'project(cmake-extras NONE)' + + # This is in a function that reverse dependencies use to determine where to install their files to + substituteInPlace src/QmlPlugins/QmlPluginsConfig.cmake \ + --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" + ''; + + strictDeps = true; + + # Produces no binaries + dontWrapQtApps = true; + + nativeBuildInputs = [ + cmake + ]; + + buildInputs = [ + qtbase + ]; + + meta = with lib; { + description = "A collection of add-ons for the CMake build tool"; + homepage = "https://gitlab.com/ubports/development/core/cmake-extras/"; + license = licenses.gpl3Only; + maintainers = teams.lomiri.members; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/desktops/lomiri/development/deviceinfo/default.nix b/nixpkgs/pkgs/desktops/lomiri/development/deviceinfo/default.nix new file mode 100644 index 000000000000..11150c2ca1de --- /dev/null +++ b/nixpkgs/pkgs/desktops/lomiri/development/deviceinfo/default.nix @@ -0,0 +1,68 @@ +{ stdenv +, lib +, fetchFromGitLab +, gitUpdater +, testers +, cmake +, pkg-config +, cmake-extras +, gtest +, yaml-cpp +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "deviceinfo"; + version = "0.2.0"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/deviceinfo"; + rev = finalAttrs.version; + hash = "sha256-oKuX9JbYWIjroKgA2Y+/oqPkC26DPy3e6yHFU8mmbxQ="; + }; + + outputs = [ + "out" + "dev" + "bin" + ]; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + cmake-extras + yaml-cpp + ]; + + checkInputs = [ + gtest + ]; + + cmakeFlags = [ + "-DDISABLE_TESTS=${lib.boolToString (!finalAttrs.doCheck)}" + ]; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + passthru = { + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + updateScript = gitUpdater { }; + }; + + meta = with lib; { + description = "Library to detect and configure devices"; + homepage = "https://gitlab.com/ubports/development/core/deviceinfo"; + license = licenses.gpl3Only; + maintainers = teams.lomiri.members; + platforms = platforms.linux; + mainProgram = "device-info"; + pkgConfigModules = [ + "deviceinfo" + ]; + }; +}) diff --git a/nixpkgs/pkgs/desktops/lomiri/development/geonames/default.nix b/nixpkgs/pkgs/desktops/lomiri/development/geonames/default.nix new file mode 100644 index 000000000000..b3ee9dc25ef7 --- /dev/null +++ b/nixpkgs/pkgs/desktops/lomiri/development/geonames/default.nix @@ -0,0 +1,122 @@ +{ stdenv +, lib +, fetchFromGitLab +, fetchpatch +, gitUpdater +, testers +, buildPackages +, cmake +, docbook-xsl-nons +, docbook_xml_dtd_45 +, gettext +, glib +, glibcLocales +, withExamples ? true +, gtk3 +# Uses gtkdoc-scan* tools, which produces a binary linked against lib for hostPlatform and executes it to generate docs +, withDocumentation ? stdenv.buildPlatform.canExecute stdenv.hostPlatform +, gtk-doc +, pkg-config +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "geonames"; + version = "0.3.0"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/geonames"; + rev = finalAttrs.version; + hash = "sha256-Mo7Khj2pgdJ9kT3npFXnh1WTSsY/B1egWTccbAXFNY8="; + }; + + outputs = [ + "out" + "dev" + ] ++ lib.optionals withExamples [ + "bin" + ] ++ lib.optionals withDocumentation [ + "doc" + ]; + + patches = [ + # Improves install locations of demo & docs + # Remove when https://gitlab.com/ubports/development/core/geonames/-/merge_requests/3 merged & in release + (fetchpatch { + name = "0001-geonames-Use-GNUInstallDirs-more.patch"; + url = "https://gitlab.com/OPNA2608/geonames/-/commit/e64a391fc213b2629da1c8bbf975fd62a2973c51.patch"; + hash = "sha256-HPYDtIy1WUrZLPzvKh4aezrT/LniZkNX+PeQ9YB85RY="; + }) + ]; + + postPatch = '' + patchShebangs src/generate-locales.sh tests/setup-test-env.sh + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + gettext + glib # glib-compile-resources + pkg-config + ] ++ lib.optionals withDocumentation [ + docbook-xsl-nons + docbook_xml_dtd_45 + gtk-doc + ]; + + buildInputs = [ + glib + ] ++ lib.optionals withExamples [ + gtk3 + ]; + + # Tests need to be able to check locale + LC_ALL = lib.optionalString finalAttrs.doCheck "en_US.UTF-8"; + nativeCheckInputs = [ + glibcLocales + ]; + + makeFlags = [ + # gtkdoc-scan runs ld, can't find qsort & strncpy symbols + "LD=${stdenv.cc.targetPrefix}cc" + ]; + + cmakeFlags = [ + "-DWANT_DOC=${lib.boolToString withDocumentation}" + "-DWANT_DEMO=${lib.boolToString withExamples}" + "-DWANT_TESTS=${lib.boolToString finalAttrs.doCheck}" + # Keeps finding & using glib-compile-resources from buildInputs otherwise + "-DCMAKE_PROGRAM_PATH=${lib.makeBinPath [ buildPackages.glib.dev ]}" + ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + # only for cross without native execute support because the canExecute "emulator" call has a format that I can't get CMake to accept + "-DCMAKE_CROSSCOMPILING_EMULATOR=${stdenv.hostPlatform.emulator buildPackages}" + ]; + + preInstall = lib.optionalString withDocumentation '' + # gtkdoc-mkhtml generates images without write permissions, errors out during install + chmod +w doc/reference/html/* + ''; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + passthru = { + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + updateScript = gitUpdater { }; + }; + + meta = with lib; { + description = "Parse and query the geonames database dump"; + homepage = "https://gitlab.com/ubports/development/core/geonames"; + license = licenses.gpl3Only; + maintainers = teams.lomiri.members; + platforms = platforms.all; + # Cross requires hostPlatform emulation during build + # https://gitlab.com/ubports/development/core/geonames/-/issues/1 + broken = stdenv.buildPlatform != stdenv.hostPlatform && !stdenv.hostPlatform.emulatorAvailable buildPackages; + pkgConfigModules = [ + "geonames" + ]; + }; +}) diff --git a/nixpkgs/pkgs/desktops/lomiri/development/gmenuharness/default.nix b/nixpkgs/pkgs/desktops/lomiri/development/gmenuharness/default.nix new file mode 100644 index 000000000000..d5143e94d914 --- /dev/null +++ b/nixpkgs/pkgs/desktops/lomiri/development/gmenuharness/default.nix @@ -0,0 +1,96 @@ +{ stdenv +, lib +, fetchFromGitLab +, fetchpatch +, gitUpdater +, testers +, cmake +, cmake-extras +, dbus +, dbus-test-runner +, glib +, gtest +, libqtdbustest +, lomiri-api +, pkg-config +, qtbase +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "gmenuharness"; + version = "0.1.4"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/gmenuharness"; + rev = finalAttrs.version; + hash = "sha256-MswB8cQvz3JvcJL2zj7szUOBzKRjxzJO7/x+87m7E7c="; + }; + + patches = [ + # Remove when version > 0.1.4 + (fetchpatch { + name = "0001-gmenuharness-Rename-type-attribute-from-x-canonical-type-to-x-lomiri-type.patch"; + url = "https://gitlab.com/ubports/development/core/gmenuharness/-/commit/70e9ed85792a6ac1950faaf26391ce91e69486ab.patch"; + hash = "sha256-jeue0qrl2JZCt/Yfj4jT210wsF/E+MlbtNT/yFTcw5I="; + }) + ]; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + cmake-extras + glib + lomiri-api + qtbase + ]; + + nativeCheckInputs = [ + dbus + dbus-test-runner + ]; + + checkInputs = [ + gtest + libqtdbustest + ]; + + cmakeFlags = [ + "-Denable_tests=${lib.boolToString finalAttrs.doCheck}" + ]; + + dontWrapQtApps = true; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + enableParallelChecking = false; + + checkPhase = '' + runHook preCheck + + dbus-test-runner -t make -p test -p "''${enableParallelChecking:+-j $NIX_BUILD_CORES}" + + runHook postCheck + ''; + + passthru = { + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + updateScript = gitUpdater { }; + }; + + meta = with lib; { + description = "Library to test GMenuModel structures"; + homepage = "https://gitlab.com/ubports/development/core/gmenuharness"; + license = licenses.gpl3Only; + maintainers = teams.lomiri.members; + platforms = platforms.unix; + pkgConfigModules = [ + "libgmenuharness" + ]; + }; +}) diff --git a/nixpkgs/pkgs/desktops/lomiri/development/libusermetrics/default.nix b/nixpkgs/pkgs/desktops/lomiri/development/libusermetrics/default.nix new file mode 100644 index 000000000000..7ccaccfa395e --- /dev/null +++ b/nixpkgs/pkgs/desktops/lomiri/development/libusermetrics/default.nix @@ -0,0 +1,129 @@ +{ stdenv +, lib +, fetchFromGitLab +, gitUpdater +, testers +, cmake +, cmake-extras +, dbus +, doxygen +, gsettings-qt +, gtest +, intltool +, json-glib +, libapparmor +, libqtdbustest +, pkg-config +, qdjango +, qtbase +, qtdeclarative +, qtxmlpatterns +, ubports-click +, wrapQtAppsHook +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "libusermetrics"; + version = "1.3.0"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/libusermetrics"; + rev = finalAttrs.version; + hash = "sha256-yO9wZcXJBKt1HZ1GKoQ1flqYuwW9PlXiWLE3bl21PSQ="; + }; + + outputs = [ + "out" + "dev" + "doc" + ]; + + postPatch = '' + substituteInPlace data/CMakeLists.txt \ + --replace '/etc' "$out/etc" + + # Tries to query QMake for QT_INSTALL_QML variable, would return broken paths into /build/qtbase-<commit> even if qmake was available + substituteInPlace src/modules/UserMetrics/CMakeLists.txt \ + --replace "\''${QT_IMPORTS_DIR}/UserMetrics" '${placeholder "out"}/${qtbase.qtQmlPrefix}/UserMetrics' + + substituteInPlace src/libusermetricsinput/CMakeLists.txt \ + --replace 'RUNTIME DESTINATION bin' 'RUNTIME DESTINATION ''${CMAKE_INSTALL_BINDIR}' + + substituteInPlace doc/CMakeLists.txt \ + --replace "\''${CMAKE_INSTALL_DATAROOTDIR}/doc/libusermetrics-doc" "\''${CMAKE_INSTALL_DOCDIR}" + '' + lib.optionalString (!finalAttrs.doCheck) '' + # Only needed by tests + sed -i -e '/QTDBUSTEST/d' CMakeLists.txt + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + doxygen + intltool + pkg-config + wrapQtAppsHook + ]; + + buildInputs = [ + cmake-extras + gsettings-qt + json-glib + libapparmor + qdjango + qtxmlpatterns + ubports-click + + # Plugin + qtbase + ]; + + nativeCheckInputs = [ + dbus + ]; + + checkInputs = [ + gtest + libqtdbustest + qtdeclarative + ]; + + cmakeFlags = [ + "-DGSETTINGS_LOCALINSTALL=ON" + "-DGSETTINGS_COMPILE=ON" + "-DENABLE_TESTS=${lib.boolToString finalAttrs.doCheck}" + ]; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + checkPhase = '' + runHook preCheck + + export QT_PLUGIN_PATH=${lib.getBin qtbase}/lib/qt-${qtbase.version}/plugins/ + export QML2_IMPORT_PATH=${lib.getBin qtdeclarative}/lib/qt-${qtbase.version}/qml/ + dbus-run-session --config-file=${dbus}/share/dbus-1/session.conf -- \ + make test "''${enableParallelChecking:+-j $NIX_BUILD_CORES}" + + runHook postCheck + ''; + + passthru = { + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + updateScript = gitUpdater { }; + }; + + meta = with lib; { + description = "Enables apps to locally store interesting numerical data for later presentation"; + homepage = "https://gitlab.com/ubports/development/core/libusermetrics"; + license = licenses.lgpl3Only; + maintainers = teams.lomiri.members; + platforms = platforms.linux; + mainProgram = "usermetricsinput"; + pkgConfigModules = [ + "libusermetricsinput-1" + "libusermetricsoutput-1" + ]; + }; +}) diff --git a/nixpkgs/pkgs/desktops/lomiri/development/lomiri-api/default.nix b/nixpkgs/pkgs/desktops/lomiri/development/lomiri-api/default.nix new file mode 100644 index 000000000000..f4a7c968c66f --- /dev/null +++ b/nixpkgs/pkgs/desktops/lomiri/development/lomiri-api/default.nix @@ -0,0 +1,106 @@ +{ stdenv +, lib +, fetchFromGitLab +, gitUpdater +, makeFontsConf +, testers +, cmake +, cmake-extras +, dbus +, doxygen +, glib +, graphviz +, gtest +, libqtdbustest +, pkg-config +, python3 +, qtbase +, qtdeclarative +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "lomiri-api"; + version = "0.2.1"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/lomiri-api"; + rev = finalAttrs.version; + hash = "sha256-UTl0vObSlEvHuLmDt7vS3yEqZWGklJ9tVwlUAtRSTlU="; + }; + + outputs = [ "out" "dev" "doc" ]; + + postPatch = '' + patchShebangs $(find test -name '*.py') + + substituteInPlace data/*.pc.in \ + --replace "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" "\''${prefix}/lib" + + # Variable is queried via pkg-config by reverse dependencies + # TODO This is likely not supposed to be the regular Qt QML import prefix + # but otherwise i.e. lomiri-notifications cannot be found in lomiri + substituteInPlace CMakeLists.txt \ + --replace 'SHELL_PLUGINDIR ''${CMAKE_INSTALL_LIBDIR}/lomiri/qml' 'SHELL_PLUGINDIR ${qtbase.qtQmlPrefix}' + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + doxygen + graphviz + pkg-config + ]; + + buildInputs = [ + cmake-extras + glib + gtest + libqtdbustest + qtbase + qtdeclarative + ]; + + nativeCheckInputs = [ + dbus + python3 + ]; + + dontWrapQtApps = true; + + FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; }; + + preBuild = '' + # Makes fontconfig produce less noise in logs + export HOME=$TMPDIR + ''; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + preCheck = '' + # needs minimal plugin and QtTest QML + export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix} + export QML2_IMPORT_PATH=${lib.getBin qtdeclarative}/${qtbase.qtQmlPrefix} + ''; + + passthru = { + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + updateScript = gitUpdater { }; + }; + + meta = with lib; { + description = "Lomiri API Library for integrating with the Lomiri shell"; + homepage = "https://gitlab.com/ubports/development/core/lomiri-api"; + license = with licenses; [ lgpl3Only gpl3Only ]; + maintainers = teams.lomiri.members; + platforms = platforms.linux; + pkgConfigModules = [ + "liblomiri-api" + "lomiri-shell-api" + "lomiri-shell-application" + "lomiri-shell-launcher" + "lomiri-shell-notifications" + ]; + }; +}) |