mirror of
https://abf.rosa.ru/djam/firefox-esr68.git
synced 2025-02-23 18:02:56 +00:00
Restore KDE Background patch
Minor spec cleanups
This commit is contained in:
parent
77dbf49068
commit
661b1d809a
2 changed files with 165 additions and 27 deletions
51
firefox.spec
51
firefox.spec
|
@ -32,7 +32,7 @@ Summary: Next generation web browser
|
|||
Name: firefox
|
||||
Version: %{major}
|
||||
Epoch: %{ff_epoch}
|
||||
Release: 1
|
||||
Release: 2
|
||||
License: MPLv1+
|
||||
Group: Networking/WWW
|
||||
Url: http://www.mozilla.com/firefox/
|
||||
|
@ -49,7 +49,7 @@ Source1000: README.urpmi
|
|||
# http://www.rosenauer.org/hg/mozilla/summary
|
||||
Patch11: firefox-kde.patch
|
||||
Patch12: mozilla-kde.patch
|
||||
#Patch13: mozilla-kde-background.patch
|
||||
Patch13: mozilla-kde-background.patch
|
||||
Patch34: xulrunner_nojit.patch
|
||||
Patch35: firefox-37-build-with-time-independent-uuids.patch
|
||||
Patch36: firefox-38.0-enable-NTLMv1.patch
|
||||
|
@ -189,12 +189,11 @@ Files and macros mainly for building Firefox extensions.
|
|||
%setup -q
|
||||
|
||||
## KDE INTEGRATION
|
||||
# Disable kde integration , need refactoring
|
||||
%patch11 -p1 -b .kdepatch
|
||||
%patch12 -p1 -b .kdemoz
|
||||
#patch13 -p1 -b .kdebackground
|
||||
%patch13 -p1 -b .kdebackground
|
||||
|
||||
%ifarch %arm
|
||||
%ifarch %{arm}
|
||||
%if "%{_target_cpu}" != "armv7l"
|
||||
%patch34 -p1
|
||||
%endif
|
||||
|
@ -251,39 +250,37 @@ ac_add_options --enable-startup-notification
|
|||
ac_add_options --with-distribution-id=org.rosa
|
||||
ac_add_options --disable-crashreporter
|
||||
ac_add_options --enable-update-channel=%{update_channel}
|
||||
%ifarch %arm
|
||||
%ifarch %{arm}
|
||||
%if "%{_target_cpu}" != "armv7l"
|
||||
ac_add_options --disable-methodjit
|
||||
ac_add_options --disable-tracejit
|
||||
ac_add_options --disable-methodjit
|
||||
ac_add_options --disable-tracejit
|
||||
%endif
|
||||
ac_add_options --enable-system-ffi
|
||||
ac_add_options --enable-system-ffi
|
||||
%endif
|
||||
%ifnarch %arm %mips
|
||||
ac_add_options --with-valgrind
|
||||
%ifnarch %{arm} %{mips}
|
||||
ac_add_options --with-valgrind
|
||||
%endif
|
||||
|
||||
EOF
|
||||
|
||||
%__perl -p -i -e 's|\-0|\-9|g' config/make-jars.pl
|
||||
perl -p -i -e 's|\-0|\-9|g' config/make-jars.pl
|
||||
|
||||
export LDFLAGS="%ldflags"
|
||||
export LDFLAGS="%{ldflags}"
|
||||
make -f client.mk build
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
|
||||
# Make sure locale works for langpacks
|
||||
%{__cat} > %{_builddir}/obj/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF
|
||||
cat > %{_builddir}/obj/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF
|
||||
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
|
||||
EOF
|
||||
|
||||
make -C %{_builddir}/obj/browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
|
||||
|
||||
# Copy files to buildroot
|
||||
%{__mkdir_p} %{buildroot}%{mozillalibdir}
|
||||
mkdir -p %{buildroot}%{mozillalibdir}
|
||||
cp -rf %{_builddir}/obj/dist/firefox/* %{buildroot}%{mozillalibdir}
|
||||
|
||||
%{__mkdir_p} %{buildroot}%{_bindir}
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
ln -sf %{mozillalibdir}/firefox %{buildroot}%{_bindir}/firefox
|
||||
pushd %{buildroot}%{_bindir}
|
||||
ln -sf firefox mozilla-firefox
|
||||
|
@ -292,23 +289,23 @@ mkdir -p %{buildroot}%{mozillalibdir}/defaults/preferences/
|
|||
install -m 644 %{SOURCE9} %{buildroot}%{mozillalibdir}/defaults/preferences/kde.js
|
||||
|
||||
# Create and own %_libdir/mozilla/plugins & firefox extensions directories
|
||||
%{__mkdir_p} %{buildroot}%{pluginsdir}
|
||||
%{__mkdir_p} %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_appid}
|
||||
%{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid}
|
||||
mkdir -p %{buildroot}%{pluginsdir}
|
||||
mkdir -p %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_appid}
|
||||
mkdir -p %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid}
|
||||
|
||||
# (tpg) desktop entry
|
||||
%{__mkdir_p} %{buildroot}%{_datadir}/applications
|
||||
mkdir -p %{buildroot}%{_datadir}/applications
|
||||
install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop
|
||||
|
||||
# (tpg) icons
|
||||
%{__cp} %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}/%{mozillalibdir}/browser/icons/
|
||||
cp %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}/%{mozillalibdir}/browser/icons/
|
||||
for i in 16 22 24 32 48 256; do
|
||||
# (cg) Not all icon sizes are installed with make install, so just redo it here.
|
||||
%{__install} -m 644 browser/branding/official/default$i.png %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default$i.png
|
||||
%{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
|
||||
install -m 644 browser/branding/official/default$i.png %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default$i.png
|
||||
mkdir -p %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
|
||||
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/%{name}.png ;
|
||||
done
|
||||
%{__mkdir_p} %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
|
||||
mkdir -p %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
|
||||
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png
|
||||
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png
|
||||
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png
|
||||
|
@ -347,7 +344,7 @@ pref("general.config.obscure_value", 0); // use this to disable the byte-shift
|
|||
EOF
|
||||
|
||||
# display icon for Firefox button
|
||||
%{__mkdir_p} %{buildroot}%{mozillalibdir}/defaults/profile/chrome
|
||||
mkdir -p %{buildroot}%{mozillalibdir}/defaults/profile/chrome
|
||||
cat << EOF > %{buildroot}%{mozillalibdir}/defaults/profile/chrome/userChrome.css
|
||||
#appmenu-toolbar-button {
|
||||
list-style-image: url("chrome://branding/content/icon16.png");
|
||||
|
|
141
mozilla-kde-background.patch
Normal file
141
mozilla-kde-background.patch
Normal file
|
@ -0,0 +1,141 @@
|
|||
diff -urN firefox-50.0.2-orig/browser/components/shell/nsKDEShellService.cpp firefox-50.0.2-patched/browser/components/shell/nsKDEShellService.cpp
|
||||
--- firefox-50.0.2-orig/browser/components/shell/nsKDEShellService.cpp 2016-12-07 19:28:13.314146351 +1000
|
||||
+++ firefox-50.0.2-patched/browser/components/shell/nsKDEShellService.cpp 2016-12-07 19:31:50.211125939 +1000
|
||||
@@ -17,6 +17,21 @@
|
||||
#include "nsIMutableArray.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsArrayUtils.h"
|
||||
+#include "nsIImageLoadingContent.h"
|
||||
+#include "imgIRequest.h"
|
||||
+#include "nsIStringBundle.h"
|
||||
+#include "nsIDOMHTMLImageElement.h"
|
||||
+#include "prenv.h"
|
||||
+
|
||||
+#include <glib.h>
|
||||
+#include <glib-object.h>
|
||||
+#include <gtk/gtk.h>
|
||||
+#include <gdk/gdk.h>
|
||||
+#if defined(MOZ_WIDGET_GTK)
|
||||
+#include "nsIImageToPixbuf.h"
|
||||
+#endif
|
||||
+#include <limits.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
@@ -28,6 +43,28 @@
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
+static nsresult
|
||||
+WriteImage(const nsCString& aPath, imgIContainer* aImage)
|
||||
+{
|
||||
+#if !defined(MOZ_WIDGET_GTK)
|
||||
+ return NS_ERROR_NOT_AVAILABLE;
|
||||
+#else
|
||||
+ nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
|
||||
+ do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
|
||||
+ if (!imgToPixbuf)
|
||||
+ return NS_ERROR_NOT_AVAILABLE;
|
||||
+
|
||||
+ GdkPixbuf* pixbuf = imgToPixbuf->ConvertImageToPixbuf(aImage);
|
||||
+ if (!pixbuf)
|
||||
+ return NS_ERROR_NOT_AVAILABLE;
|
||||
+
|
||||
+ gboolean res = gdk_pixbuf_save(pixbuf, aPath.get(), "png", nullptr, nullptr);
|
||||
+
|
||||
+ g_object_unref(pixbuf);
|
||||
+ return res ? NS_OK : NS_ERROR_FAILURE;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
NS_IMPL_ISUPPORTS(nsKDEShellService, nsIGNOMEShellService, nsIShellService)
|
||||
|
||||
NS_IMETHODIMP
|
||||
@@ -88,19 +125,83 @@
|
||||
nsKDEShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
||||
PRInt32 aPosition)
|
||||
{
|
||||
- return NS_ERROR_NOT_IMPLEMENTED;
|
||||
+ nsresult rv;
|
||||
+ nsCOMPtr<nsIImageLoadingContent> imageContent = do_QueryInterface(aElement, &rv);
|
||||
+ if (!imageContent) return rv;
|
||||
+
|
||||
+ // get the image container
|
||||
+ nsCOMPtr<imgIRequest> request;
|
||||
+ rv = imageContent->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
|
||||
+ getter_AddRefs(request));
|
||||
+ if (!request) return rv;
|
||||
+ nsCOMPtr<imgIContainer> container;
|
||||
+ rv = request->GetImage(getter_AddRefs(container));
|
||||
+ if (!container) return rv;
|
||||
+
|
||||
+ // Set desktop wallpaper filling style
|
||||
+ nsAutoCString options;
|
||||
+ if (aPosition == BACKGROUND_TILE)
|
||||
+ options.Assign("TiledResize");
|
||||
+ else if (aPosition == BACKGROUND_STRETCH)
|
||||
+ options.Assign("ScaledResize");
|
||||
+ else if (aPosition == BACKGROUND_FILL)
|
||||
+ options.Assign("ScaledAndCroppedResize");
|
||||
+ else if (aPosition == BACKGROUND_FIT)
|
||||
+ options.Assign("MaxpectResize");
|
||||
+ else
|
||||
+ options.Assign("CenteredResize");
|
||||
+
|
||||
+ // Write the background file to the home directory.
|
||||
+ nsAutoCString filePath(PR_GetEnv("HOME"));
|
||||
+
|
||||
+ // get the product brand name from localized strings
|
||||
+ nsString brandName;
|
||||
+ nsCID bundleCID = NS_STRINGBUNDLESERVICE_CID;
|
||||
+ nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(bundleCID));
|
||||
+ if (bundleService) {
|
||||
+ nsCOMPtr<nsIStringBundle> brandBundle;
|
||||
+ rv = bundleService->CreateBundle(BRAND_PROPERTIES,
|
||||
+ getter_AddRefs(brandBundle));
|
||||
+ if (NS_SUCCEEDED(rv) && brandBundle) {
|
||||
+ rv = brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
|
||||
+ getter_Copies(brandName));
|
||||
+ NS_ENSURE_SUCCESS(rv, rv);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // build the file name
|
||||
+ filePath.Append('/');
|
||||
+ filePath.Append(NS_ConvertUTF16toUTF8(brandName));
|
||||
+ filePath.Append("_wallpaper.png");
|
||||
+
|
||||
+ // write the image to a file in the home dir
|
||||
+ rv = WriteImage(filePath, container);
|
||||
+ NS_ENSURE_SUCCESS(rv, rv);
|
||||
+
|
||||
+ nsCOMPtr<nsIMutableArray> command = do_CreateInstance( NS_ARRAY_CONTRACTID );
|
||||
+ nsCOMPtr<nsISupportsCString> cmdstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
|
||||
+ nsCOMPtr<nsISupportsCString> imgstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
|
||||
+ nsCOMPtr<nsISupportsCString> modestr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
|
||||
+ cmdstr->SetData( NS_LITERAL_CSTRING( "SETWALLPAPER" ));
|
||||
+ command->AppendElement( cmdstr, false );
|
||||
+ imgstr->SetData( filePath );
|
||||
+ command->AppendElement( imgstr, false );
|
||||
+ modestr->SetData( options );
|
||||
+ command->AppendElement( modestr, false );
|
||||
+ return nsKDEUtils::command( command ) ? rv : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsKDEShellService::GetDesktopBackgroundColor(PRUint32 *aColor)
|
||||
{
|
||||
- return NS_ERROR_NOT_IMPLEMENTED;
|
||||
+ aColor = 0;
|
||||
+ return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsKDEShellService::SetDesktopBackgroundColor(PRUint32 aColor)
|
||||
{
|
||||
- return NS_ERROR_NOT_IMPLEMENTED;
|
||||
+ return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
Loading…
Add table
Reference in a new issue