Le 24/07/16 à 01:29, Laurent Bigonville a écrit :
Le 24/07/16 à 00:58, Laurent Bigonville a écrit :
On Sun, 24 Jul 2016 00:27:04 +0200 Laurent Bigonville <bi...@debian.org> wrote:
>
> Hi,
>
> When clicking a the button in the options to set the default browser, it
> creates a new .desktop file in ~/.local/share/applications.
>
> This confuse gnome-control-center. Also, I don't see this happening in
> Fedora and this shouldn't happen in debian.
>
> What I can see is that in this .desktop file the path to the executable
> is /usr/lib/firefox/firefox and not just "firefox", I feel this is
> related.

OK, the issue is that in debian, the MOZ_APP_LAUNCHER environment variable is not set like it is in fedora.

In Fedora it set in a wrapper script (along with other environment variables), see [0]

Shouldn't this wrapper script (or something similar) be added in debian too?

The run-mozilla.sh script should probably be shipped in the package as well.

Installing the attached file as /usr/bin/firefox and installing run-mozilla.sh /usr/lib/firefox seems to solve the issue.

The attached file is a modified version of the build/unix/mozilla.in file shipped in the sources.

I'm not too sure how the build system is working to be honest so I don't have a patch to apply to the debian package.
#!/bin/sh
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

## 
## Usage:
##
## $ mozilla [args]
##
## This script is meant to run the application binary from mozilla/dist/bin.
##
## The script will setup all the environment voodoo needed to make
## the application binary to work.
##

#uncomment for debugging
#set -x

moz_libdir=/usr/lib/firefox

# Use run-mozilla.sh in the current dir if it exists
# If not, then start resolving symlinks until we find run-mozilla.sh
found=0
progname="$0"
curdir=`dirname "$progname"`
progbase=`basename "$progname"`
run_moz="$curdir/run-mozilla.sh"
if test -x "$run_moz"; then
  dist_bin="$curdir"
  found=1
else
  here=`/bin/pwd`
  while [ -h "$progname" ]; do
    bn=`basename "$progname"`
    cd `dirname "$progname"`
    # Resolve symlink of dirname
    cd `/bin/pwd`
    progname=`/bin/ls -l "$bn" | sed -e 's/^.* -> //' `
    progbase=`basename "$progname"`
    if [ ! -x "$progname" ]; then
      break
    fi
    curdir=`dirname "$progname"`
    run_moz="$curdir/run-mozilla.sh"
    if [ -x "$run_moz" ]; then
      cd "$curdir"
      dist_bin=`/bin/pwd`
      run_moz="$dist_bin/run-mozilla.sh"
      found=1
      break
    fi
  done
  cd "$here"
fi
if [ $found = 0 ]; then
  # Check default compile-time libdir
  if [ -x "$moz_libdir/run-mozilla.sh" ]; then
    dist_bin="$moz_libdir"
    run_moz="$moz_libdir/run-mozilla.sh"
  else
    echo "Cannot find %MOZ_APP_DISPLAYNAME% runtime directory. Exiting."
    exit 1
  fi
fi

##
## Set MOZ_APP_LAUNCHER for gnome-session
## https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=832298
##
export MOZ_APP_LAUNCHER="/usr/bin/firefox"

script_args=""
debugging=0
MOZILLA_BIN="${progbase}-bin"

if [ "$OSTYPE" = "beos" ]; then
  mimeset -F "$MOZILLA_BIN"
fi

pass_arg_count=0
while [ $# -gt $pass_arg_count ]
do
  case "$1" in
    -p | --pure | -pure)
      MOZILLA_BIN="${MOZILLA_BIN}.pure"
      shift
      ;;
    -g | --debug)
      script_args="$script_args -g"
      debugging=1
      shift
      ;;
    -d | --debugger)
      script_args="$script_args -d $2"
      shift 2
      ;;
    *)
      # Move the unrecognized argument to the end of the list.
      arg="$1"
      shift
      set -- "$@" "$arg"
      pass_arg_count=`expr $pass_arg_count + 1`
      ;;
  esac
done

if [ $debugging = 1 ]
then
  echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
fi
exec "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"
# EOF.

Reply via email to