lomiri.morph-browser: 1.1.2 -> 1.99.0
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitLab,
|
||||
fetchpatch2,
|
||||
gitUpdater,
|
||||
nixosTests,
|
||||
cmake,
|
||||
ctestCheckHook,
|
||||
gettext,
|
||||
libapparmor,
|
||||
lomiri-action-api,
|
||||
@@ -29,13 +31,13 @@ let
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "morph-browser";
|
||||
version = "1.1.2";
|
||||
version = "1.99.0";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "ubports";
|
||||
repo = "development/core/morph-browser";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-CW+8HEGxeDDfqbBtNHDKTvsZkbu0tCmD6OEDW07KG2k=";
|
||||
hash = "sha256-fuemZhBMtx6MiQGsdAlsRkK4uJJvIOjcSSc9Z1nGeXU=";
|
||||
};
|
||||
|
||||
outputs = [
|
||||
@@ -43,8 +45,20 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"doc"
|
||||
];
|
||||
|
||||
patches = [
|
||||
# Fix an issue with asset installation & loading
|
||||
# Remove when version > 1.99.0
|
||||
(fetchpatch2 {
|
||||
url = "https://gitlab.com/ubports/development/core/morph-browser/-/commit/512a7dceebd4665856c4877c02d5d01fd8411574.diff";
|
||||
hash = "sha256-yincXEYXsfOJz7cpotD4OX90kwiDgk9E7FL1MP4iNuM=";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/{Morph,Ubuntu}/CMakeLists.txt \
|
||||
substituteInPlace src/Morph/CMakeLists.txt \
|
||||
--replace-fail '/usr/lib/''${CMAKE_LIBRARY_ARCHITECTURE}/qt''${QT_VERSION_MAJOR}/qml' "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
|
||||
|
||||
substituteInPlace src/Ubuntu/CMakeLists.txt \
|
||||
--replace-fail '/usr/lib/''${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml' "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
|
||||
|
||||
substituteInPlace src/app/webbrowser/morph-browser.desktop.in.in \
|
||||
@@ -52,11 +66,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
--replace-fail 'X-Lomiri-Splash-Image=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser-splash.svg' 'X-Lomiri-Splash-Image=lomiri-app-launch/splash/morph-browser.svg'
|
||||
|
||||
substituteInPlace doc/CMakeLists.txt \
|
||||
--replace-fail 'COMMAND ''${QDOC_EXECUTABLE} -qt5' 'COMMAND ''${QDOC_EXECUTABLE}'
|
||||
--replace-fail 'COMMAND ''${QDOC_BIN} -qt5' 'COMMAND ''${QDOC_BIN}'
|
||||
''
|
||||
+ lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
|
||||
# Being worked on upstream and temporarily disabled, but they still mostly work fine right now
|
||||
+ lib.optionalString (finalAttrs.finalPackage.doCheck) ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'add_subdirectory(tests)' ""
|
||||
--replace-fail '#add_subdirectory(tests)' 'add_subdirectory(tests)'
|
||||
'';
|
||||
|
||||
strictDeps = true;
|
||||
@@ -86,27 +101,30 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
ctestCheckHook
|
||||
mesa.llvmpipeHook # ShapeMaterial needs an OpenGL context: https://gitlab.com/ubports/development/core/lomiri-ui-toolkit/-/issues/35
|
||||
xvfb-run
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (
|
||||
lib.concatStringsSep ";" [
|
||||
# Exclude tests
|
||||
"-E"
|
||||
(lib.strings.escapeShellArg "(${
|
||||
lib.concatStringsSep "|" [
|
||||
# Don't care about linter failures
|
||||
"^flake8"
|
||||
]
|
||||
})")
|
||||
]
|
||||
))
|
||||
(lib.cmakeBool "CLICK_MODE" false)
|
||||
(lib.cmakeBool "ENABLE_QT6" (lib.strings.versionAtLeast qtbase.version "6"))
|
||||
(lib.cmakeBool "WERROR" true)
|
||||
];
|
||||
|
||||
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||
|
||||
disabledTests = [
|
||||
# Don't care about linter failures
|
||||
"flake8"
|
||||
|
||||
# Temporarily broken while upstream is working on porting to Qt6
|
||||
"tst_QmlTests"
|
||||
|
||||
# Flaky
|
||||
"tst_HistoryModelTests"
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
export HOME=$TMPDIR
|
||||
export QT_PLUGIN_PATH=${listToQtVar qtbase.qtPluginPrefix [ qtbase ]}
|
||||
@@ -129,6 +147,17 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
ln -s $out/share/{morph-browser,icons/hicolor/scalable/apps}/morph-browser.svg
|
||||
ln -s $out/share/{morph-browser/morph-browser-splash.svg,lomiri-app-launch/splash/morph-browser.svg}
|
||||
''
|
||||
# This got broken when QML files got duplicated & split into Qt version-specific subdirs in source tree
|
||||
# Symlinks get installed as-is, and they currently point relatively to the versioned subdirs
|
||||
+ ''
|
||||
for link in $(find $out/${qtbase.qtQmlPrefix}/Ubuntu -type l); do
|
||||
ln -vfs "$(readlink "$link" | sed -e 's|/qml-qt5||g')" "$link"
|
||||
done
|
||||
''
|
||||
# Link target for this one just doesn't get installed ever it seems, yeet it
|
||||
+ ''
|
||||
rm -v $out/${qtbase.qtQmlPrefix}/Ubuntu/Web/handle@27.png
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
|
||||
Reference in New Issue
Block a user