diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-07-23 00:02:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-23 00:02:31 +0000 |
commit | 86a73bdb86fa92f89a8d66f6b73ce3cf903fd811 (patch) | |
tree | 4ae95b4d1e829ec6f604b164814b6b1a16b26697 /pkgs/desktops | |
parent | 41e6556ad365aab1000548c1b2a77a6b6339efaf (diff) | |
parent | a8ba422f71f83858209f2312e942e71f5c8f7cd3 (diff) | |
download | nixlib-86a73bdb86fa92f89a8d66f6b73ce3cf903fd811.tar nixlib-86a73bdb86fa92f89a8d66f6b73ce3cf903fd811.tar.gz nixlib-86a73bdb86fa92f89a8d66f6b73ce3cf903fd811.tar.bz2 nixlib-86a73bdb86fa92f89a8d66f6b73ce3cf903fd811.tar.lz nixlib-86a73bdb86fa92f89a8d66f6b73ce3cf903fd811.tar.xz nixlib-86a73bdb86fa92f89a8d66f6b73ce3cf903fd811.tar.zst nixlib-86a73bdb86fa92f89a8d66f6b73ce3cf903fd811.zip |
Merge master into staging-next
Diffstat (limited to 'pkgs/desktops')
-rw-r--r-- | pkgs/desktops/lomiri/default.nix | 1 | ||||
-rw-r--r-- | pkgs/desktops/lomiri/development/geonames/default.nix | 122 |
2 files changed, 123 insertions, 0 deletions
diff --git a/pkgs/desktops/lomiri/default.nix b/pkgs/desktops/lomiri/default.nix index 27869f6e9280..ba4c6446d4c0 100644 --- a/pkgs/desktops/lomiri/default.nix +++ b/pkgs/desktops/lomiri/default.nix @@ -10,6 +10,7 @@ let #### Development tools / libraries cmake-extras = callPackage ./development/cmake-extras { }; deviceinfo = callPackage ./development/deviceinfo { }; + geonames = callPackage ./development/geonames { }; gmenuharness = callPackage ./development/gmenuharness { }; lomiri-api = callPackage ./development/lomiri-api { }; }; diff --git a/pkgs/desktops/lomiri/development/geonames/default.nix b/pkgs/desktops/lomiri/development/geonames/default.nix new file mode 100644 index 000000000000..b3ee9dc25ef7 --- /dev/null +++ b/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" + ]; + }; +}) |