Introducing the Formula for scale2x #15276

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

mwurth commented Oct 3, 2012

Simple Formula and test. Had to modify a File to cope with libpng. Included changes suggested by adamv.

@mwurth mwurth Introducing the Formula for scale2x
Simple Formula and test. Had to modify a File to cope with libpng.
77fb142

@jacknagel jacknagel commented on the diff Oct 3, 2012

Library/Formula/scale2x.rb
@@ -0,0 +1,27 @@
+require 'formula'
+
+class Scale2x < Formula
+ homepage 'http://http://scale2x.sourceforge.net'
+ url 'http://sourceforge.net/projects/scale2x/files/scale2x/2.4/scale2x-2.4.tar.gz'
+ sha1 '30bbd674dcdf134a58b34e75f87ed05bd716d484'
+
+ depends_on :x11
@jacknagel

jacknagel Oct 3, 2012

Contributor

Does this require x11 or just libpng?

@mwurth

mwurth Oct 3, 2012

Contributor

It uses the system libpng. It needs this line to get the correct path.

@jacknagel

jacknagel Oct 3, 2012

Contributor

On 10.8+ we don't require X11 just to get libpng, so use the :libpng dep here which encapsulates that conditional.

@jacknagel jacknagel commented on the diff Oct 3, 2012

Library/Formula/scale2x.rb
+ def install
+ #This function was renamed in libpng
+ inreplace 'file.c', 'png_set_gray_1_2_4_to_8', 'png_set_expand_gray_1_2_4_to_8'
+ system "./configure", "--prefix=#{prefix}"
+ system "make install"
+ end
+
+ def test
+ mktemp do
+ src_img = "/System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/Key_Large.png"
+ dst_img = (Pathname.pwd / "Key_Large.png")
+ #Double the size of an image
+ system "scalerx",src_img,dst_img
+ #Check if the output file exists
+ dst_info = system "file", dst_img
+ end
@jacknagel

jacknagel Oct 3, 2012

Contributor

indents are 2sp, not 3.

Contributor

adamv commented Oct 3, 2012

Note that if you make a pull request from a non-master branch, you can git push -f to update the request inplace, without having to open a new one.

Contributor

adamv commented Nov 1, 2012

Ping

Contributor

adamv commented Jan 8, 2013

MacPorts also sets mandir.

Contributor

adamv commented Jan 8, 2013

Snow Leopard doesn't seem to have the system file used as test input.

adamv closed this in d2d71ed Jan 8, 2013

@dholm dholm added a commit to dholm/homebrew that referenced this pull request Jan 14, 2013

@mwurth @dholm mwurth + dholm scale2x 2.4
Closes #15276.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
4cf8909

xu-cheng locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.