X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id BBDD3DC0082 for ; Wed, 12 Nov 2014 19:35:41 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id l18so15405915wgh.10 for ; Wed, 12 Nov 2014 11:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Y+y3mB473QmgMIRb74HtM9TUp+KQwJH11XBtfRS6XWw=; b=rYfKQlVoM7x7cCf8Su6+n3WRrMS1cQq4N//zIselo2RStICIYY5Lzl7pNio1j1VL7g F5zRJtXX0GldlcQTb4JLKVEjdeSE/BoGzKwdJlPk93GoO3I/W/Azg3GUa/v6wBh7Fbp0 4k16w2PBXiNCZCas2GdMqdcfYdd1BXUrYqAYvO5QwaNJdRz1RR0YPWMAgeut7qP0ZXR3 QSPOc0IZUGii9EwX7mZA1YNIkuCJB7zgBsUR1kGO3itda/SPZtLBL6lftBGPhJYvRt0t VjEdz0lLxvSi4PE9J+D1sSlQ1/iXvbLgnU2VZ1xuHubSp24FZi6EA2ge8ZgpWUovVXHo ZyZg== X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 X-Received: by 10.194.90.244 with SMTP id bz20mr36842617wjb.125.1415820940369; Wed, 12 Nov 2014 11:35:40 -0800 (PST) Received: by 10.216.115.70 with HTTP; Wed, 12 Nov 2014 11:35:40 -0800 (PST) In-Reply-To: <20141112183645.GA1861@newbook> References: <1415813332-3112-1-git-send-email-amatcoder@gmail.com> <20141112183645.GA1861@newbook> Date: Wed, 12 Nov 2014 19:35:40 +0000 Message-ID: Subject: Re: [alpine-devel] [PATCH] testing/mednafen: new aport From: Amat Coder To: Isaac Dunham Cc: alpine-devel@lists.alpinelinux.org Content-Type: multipart/alternative; boundary=047d7bfd090a37636a0507ae80ad --047d7bfd090a37636a0507ae80ad Content-Type: text/plain; charset=UTF-8 That patch is because a wrapper is needed to make it work. Mednafen requires LD_PRELOAD=libGL.so because this library is not found by dlopen() with musl (same issue than firefox): https://bugs.freedesktop.org/show_bug.cgi?id=35268 So we need to rename executable to 'mednafen-bin' and to create a script called 'mednafen' to process: 'LD_PRELOAD=libGL.so exec mednafen-bin $@' Then, argv[0] points to '/usr/bin/mendnafen-bin' which is not correct. argv[0] it is only used when invoking '--help' so I changed to avoid confusion. Regards. 2014-11-12 18:36 GMT+00:00 Isaac Dunham : > On Wed, Nov 12, 2014 at 05:28:52PM +0000, AmatCoder wrote: > > --- /dev/null > > +++ b/testing/mednafen/01-fix_help.patch > > @@ -0,0 +1,25 @@ > > +--- origin/src/drivers/main.cpp > > ++++ mednafen/src/drivers/main.cpp > > +@@ -696,7 +696,7 @@ > > + if(argc <= 1) > > + { > > + printf(_("No command-line arguments specified.\n\n")); > > +- printf(usage_string, argv[0]); > > ++ printf(usage_string, "/usr/bin/mednafen"); > > > It looks like this diff is basically 's_argv[0]_"/usr/bin/mednafen"_g' > > And I'm wondering what the benefit of that is, because every program > I have seen uses argv[0], a synonym thereof, or even basename(argv[0]). > In fact, *not* having the full path unless it was specified is something > I'd find desireable enough to justify a patch. > > Thanks, > Isaac Dunham > > > --047d7bfd090a37636a0507ae80ad Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
That patch is because a wrapper is needed to mak= e it work.

Mednafen requires LD_PRELOAD=3DlibGL.so because this library i= s not
found by dlopen() with musl (same issue than firefox):https://= bugs.freedesktop.org/show_bug.cgi?id=3D35268

=
So we need to rename executable to = 9;mednafen-bin' and to create a script
called 'mednafen'=C2=A0 to process:=C2=A0
'LD_PRELOAD=3DlibGL.so exec mednafen-bin $@'
Then, argv[0] points to '/usr/bin/me= ndnafen-bin'
which is not correct.

argv[0] it = is only used when invoking '--help' so I changed to avoid
confusion.

=C2=A0 Regards.=C2=A0

=
2014-11-12 = 18:36 GMT+00:00 Isaac Dunham <ibid.ag@gmail.com>:
On Wed, Nov 12,= 2014 at 05:28:52PM +0000, AmatCoder wrote:
> --- /dev/null
> +++ b/testing/mednafen/01-fix_help.patch
> @@ -0,0 +1,25 @@
> +--- origin/src/drivers/main.cpp
> ++++ mednafen/src/drivers/main.cpp
> +@@ -696,7 +696,7 @@
> +=C2=A0 =C2=A0 =C2=A0if(argc <=3D 1)
> +=C2=A0 =C2=A0 =C2=A0{
> +=C2=A0 =C2=A0 =C2=A0 printf(_("No command-line arguments specifi= ed.\n\n"));
> +-=C2=A0 =C2=A0 =C2=A0printf(usage_string, argv[0]);
> ++=C2=A0 =C2=A0 =C2=A0printf(usage_string, "/usr/bin/mednafen&quo= t;);
>
It looks like this diff is basically 's_argv[0]_"/usr/bin/m= ednafen"_g'

And I'm wondering what the benefit of that is, because every program I have seen uses argv[0], a synonym thereof, or even basename(argv[0]).
In fact, *not* having the full path unless it was specified is something I'd find desireable enough to justify a patch.

Thanks,
Isaac Dunham



--047d7bfd090a37636a0507ae80ad-- --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---