On 2014-01-27 00:37:13, Jerome Charaoui wrote:
> That should do the trick. Antoine, I should note that instead of creating a 
> distinct "update-photofloat-js" as we discussed, I reverted to shipping the 
> upstream Makefile and simply call that to minify+bundle js.

Oh yeah, good idea.

Quick review of the patch...

> diff --git a/debian/photofloat.triggers b/debian/photofloat.triggers
> new file mode 100644
> index 0000000..db0ecc7
> --- /dev/null
> +++ b/debian/photofloat.triggers
> @@ -0,0 +1,2 @@
> +interest /usr/share/javascript/jquery/jquery.js
> +interest /usr/share/javascript/jquery-mousewheel/jquery.mousewheel.js

That seems absurdly easy. Did you actually try this out and it works? :)

> diff --git a/debian/rules b/debian/rules
> index 118de9d..49f0824 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -20,11 +20,5 @@ export DH_OPTIONS
>  %:
>       dh $@  --with=python2
>  
> -override_dh_auto_build:
> -     dh_auto_build
> -     ln -s /usr/share/javascript/jquery/jquery.js 
> $(CURDIR)/web/js/000-jquery-1.7.2.js
> -     ln -s /usr/share/javascript/jquery-mousewheel/jquery.mousewheel.js 
> $(CURDIR)/web/js/003-mousewheel.js
> -     cd $(CURDIR)/web && $(MAKE)
> -
>  override_dh_install:
> -     dh_install -X.gitignore -XMakefile -Xutils/
> +     dh_install -X.gitignore -X*.min.js -Xutils/

Does that mean we still build the minified versions during build, but
then don't ship them? Shouldn't just skip that?

> diff --git a/web/Makefile b/web/Makefile
> index 72aea0d..8224ac5 100644
> --- a/web/Makefile
> +++ b/web/Makefile
> @@ -7,7 +7,7 @@ CSS_MIN = $(CSS_DIR)/styles.min.css
>  JS_MIN_FILES := $(sort $(patsubst %.js, %.min.js, $(filter-out %.min.js, 
> $(wildcard $(JS_DIR)/*.js))))
>  CSS_MIN_FILES := $(sort $(patsubst %.css, %.min.css, $(filter-out %.min.css, 
> $(wildcard $(CSS_DIR)/*.css))))
>  
> -JS_COMPILER = yui-compressor --type js
> +JS_COMPILER = uglifyjs
>  CSS_COMPILER = yui-compressor --type css
>  
>  .PHONY: all clean

Another patch with upstream, but nothing in debian/patches. I think we
should instead use:

JS_COMPILER ?= yui-compressor --type js

... to respect upstream's default yet allow ourselves an override. Then
we just call make with:

cd /usr/share/photofloat/web && make JS_COMPILER=uglifyjs

We should also add a ?= to the CSS_COMPILER while we're there to make
sure we can replace that one as well per #721568.

Thanks for the patch!

A.

-- 
Wire telegraph is a kind of a very, very long cat. You pull his tail
in New York and his head is meowing in Los Angeles. Radio operates
exactly the same way: you send signals here, they receive them
there. The only difference is that there is no cat.
                         - Albert Einstein

Attachment: pgpenPzA4VH06.pgp
Description: PGP signature

Reply via email to