[Dextrose] [PATCH 5/5] Sweet build

Bernie Innocenti bernie at codewiz.org
Sat Oct 22 14:15:35 EDT 2011


On Sat, 2011-10-22 at 01:39 +0000, Aleksey Lim wrote:

> diff --git a/Makefile.am b/Makefile.am
> index 9e252af..cf526f8 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -9,6 +9,11 @@ EXTRA_DIST =                    \
>  	$(bin_SCRIPTS)		\
>  	intltool-merge.in       \
>  	intltool-update.in      \
> -	intltool-extract.in
> +	intltool-extract.in \
> +	sweets.recipe

The backslash isn't aligned here. Also, to reduce the churn in diffs
when we append a new line, I'd recommend this style which is also used
by some GNU projects:

    
	intltool-extract.in \
	sweets.recipe \
        #
 

>  DISTCHECK_CONFIGURE_FLAGS = --disable-update-mimedb
> +
> +all:
> +	mkdir -p share
> +	test -e share/sugar || ln -s .. share/sugar

1. Shouldn't these actions happen on make install?

2. This will break when we're building outside of srcdir. You should use
automake variables to determine what's the top of the source dir.

3. I'd recommend letting make determine when to run these commands

Here's how I'd rewrite this:

  install: share/sugar

  share/sugar:
          mkdir -p share
          ln -sf $(top_srcdir) share/sugar

(top_srcdir is off my flaky memory, probably incorrect)


> +sugar:
> +	ln -fs sugar.in sugar

If sugar is no longer being generated from sugar.in, then we could just
rename the source file to sugar instead of symlinking it!


>  if test -z "$SUGAR_SCALING"; then
> -    export SUGAR_SCALING=100
> +    dpi=$(xdpyinfo | grep resolution: | grep -o '[0-9]\+' | head -n1)
> +    if [ $dpi -ge 200 ]; then
> +        export SUGAR_SCALING=100
> +    else
> +        export SUGAR_SCALING=72
> +    fi
>  fi

Finally! However, this is unrelated to sweets and should come as a
separate patch. Perhaps it could also be simplified using

  xprop -root RESOURCE_MANAGER


> -exec sugar-session
> +# Launch new DBus session to take into account new DBus services came from sweets
> +exec dbus-launch --exit-with-session sugar-session "$@"

Didn't we get rid of the sugar-specific dubs session a while ago? Why do
we need to reintroduce it now?

-- 
 _ // Bernie Innocenti
 \X/  http://codewiz.org




More information about the Dextrose mailing list