Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 239661 - glsnake-0.9.1.ebuild (New Package)
Summary: glsnake-0.9.1.ebuild (New Package)
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement with 1 vote (vote)
Assignee: Default Assignee for New Packages
URL: https://spacepants.org/src/glsnake/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-04 19:32 UTC by Denilson Sá Maia
Modified: 2023-07-25 02:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
glsnake-0.9.1.ebuild (glsnake-0.9.1.ebuild,1.08 KB, text/plain)
2008-10-04 19:33 UTC, Denilson Sá Maia
Details
glsnake-0.9.1-offensive.patch (glsnake-0.9.1-offensive.patch,1.42 KB, text/plain)
2008-10-04 19:34 UTC, Denilson Sá Maia
Details
glsnake-0.9.1.ebuild (glsnake-0.9.1.ebuild,1.22 KB, text/plain)
2008-10-05 00:14 UTC, Denilson Sá Maia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denilson Sá Maia 2008-10-04 19:32:28 UTC
glsnake is the interactive version of the famous glsnake xscreensaver hack.
This is a simple ebuild for a simple program.
It requires GLUT to compile and run.
It installs only one binary plus the documentation.

The build system is scons, but, as the source contains only one file, I think it might be a good idea to "hardcode" the compile command (which will avoid the scons dependency). I've added such command as comments.

As the xscreensaver version, this ebuild also patches some offensive glsnake names. (see bug 46256, or look at xscreensaver patches)

I've tested this ebuild on amd64, and I'm pretty sure it will work on x86.

BUT I know this ebuild has a file collision with xscreensaver package. Both try to install glsnake.6 manpage. I guess the solution is to rename one of the manpages (probably this one). If that's the case, probably rename the glsnake executable too. I'm expecting someone else to have a better solution, or to at least suggest a name.
Comment 1 Denilson Sá Maia 2008-10-04 19:33:50 UTC
Created attachment 167210 [details]
glsnake-0.9.1.ebuild

I'm suggesting the x11-misc category, which is the same as xscreensaver package.
Comment 2 Denilson Sá Maia 2008-10-04 19:34:29 UTC
Created attachment 167212 [details]
glsnake-0.9.1-offensive.patch

This patch was copied directly from xscreensaver.
Comment 3 Thomas Sachau gentoo-dev 2008-10-04 22:52:21 UTC
Just a few comments:

-you can use ${PN} in SRC_URI
-dobin should get a "|| die"
-if you want to avoid scons, you should have a look at the toolchain-funcs.eclass to avoid hardcoding things

So far from my side
Comment 4 Denilson Sá Maia 2008-10-05 00:14:00 UTC
Created attachment 167229 [details]
glsnake-0.9.1.ebuild

(In reply to comment #3)
> -you can use ${PN} in SRC_URI

Hum... True. Well, we can then use ${PN} everywhere where we use the string glsnake. But, will this really improve anything? In my humble opinion, it doesn't.

I think it makes sense for sourceforge URLs, for example, but for this one, I don't see any reason to use ${PN}. Just my 2 cents, of course feel free to use ${PN} anyway.

> -dobin should get a "|| die"

Ok, missed that. Fixed that.

> -if you want to avoid scons, you should have a look at the
> toolchain-funcs.eclass to avoid hardcoding things

You're right.
I'm attaching an updated ebuild without scons dependency and with fixed src_compile/src_install.
I've not replaced "glsnake" by "${PN}", maybe it could make sense to do it in src_compile and src_install.
Comment 5 Thomas Sachau gentoo-dev 2008-10-05 12:07:19 UTC
(In reply to comment #4)
> Created an attachment (id=167229) [edit]
> glsnake-0.9.1.ebuild

-Why do you set RESTRICT="test"?
-You could set DEPEND="virtual/glut" and remove RDEPEND. Without a RDEPEND the package manager assumes RDEPEND="${DEPEND}".

> 
> (In reply to comment #3)
> > -you can use ${PN} in SRC_URI
> 
> Hum... True. Well, we can then use ${PN} everywhere where we use the string
> glsnake. But, will this really improve anything? In my humble opinion, it
> doesn't.
> 
> I think it makes sense for sourceforge URLs, for example, but for this one, I
> don't see any reason to use ${PN}. Just my 2 cents, of course feel free to use
> ${PN} anyway.

Why only for sf urls?
It does not happen often, but if a package gets renamed, the ebuild could just be renamed. Without ${PN}, you have to search the ebuild and change every entry of the name (In principle the same reason as why you should not hardcode the version, but use ${PV}).
Comment 6 Denilson Sá Maia 2008-10-05 14:10:52 UTC
(In reply to comment #5)
> -Why do you set RESTRICT="test"?

Because this package has no tests, so I thought it was a good idea to tell portage to don't even try testing it. If it wasn't a good idea, then sorry, and please tell me why, so I won't repeat this in future.

> -You could set DEPEND="virtual/glut" and remove RDEPEND. Without a RDEPEND the
> package manager assumes RDEPEND="${DEPEND}".

Ok. <offtopic>(but then I remember "The Zen of Python": Explicit is better than implicit.)</offtopic>

> Why only for sf urls?
> It does not happen often, but if a package gets renamed, the ebuild could just
> be renamed. Without ${PN}, you have to search the ebuild and change every entry
> of the name (In principle the same reason as why you should not hardcode the
> version, but use ${PV}).

I guess that, if the package gets renamed, probably this URL will remain the same. Or, the URL will change a lot more than just the package name. I feel that, if a package (or this package) gets renamed, we will need to change more than just renaming the ebuild.
Also, running a simple "s/glsnake/something/g" is not very difficult.
But, anyway, feel free to use ${PN} then. But should it be also used in src_compile/src_install?
Comment 7 Thomas Sachau gentoo-dev 2008-10-05 17:27:21 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > -Why do you set RESTRICT="test"?
> 
> Because this package has no tests, so I thought it was a good idea to tell
> portage to don't even try testing it. If it wasn't a good idea, then sorry, and
> please tell me why, so I won't repeat this in future.

It is simple: If there is no test, portage/make will see it and move on. It is the same as e.g. for missing configure or makefile.
RESTRICT="test" would only be usefull if there exists a testcase, but it is borked and would always fail.

> 
> > -You could set DEPEND="virtual/glut" and remove RDEPEND. Without a RDEPEND the
> > package manager assumes RDEPEND="${DEPEND}".
> 
> Ok. <offtopic>(but then I remember "The Zen of Python": Explicit is better than
> implicit.)</offtopic>

There is some rule for ebuilds: Make them simple and readable. So e.g. if you have nothing to patch, you can just drop the complete src_unpack function. Those things are defined as default, so you can count on them.

> 
> > Why only for sf urls?
> > It does not happen often, but if a package gets renamed, the ebuild could just
> > be renamed. Without ${PN}, you have to search the ebuild and change every entry
> > of the name (In principle the same reason as why you should not hardcode the
> > version, but use ${PV}).
> 
> I guess that, if the package gets renamed, probably this URL will remain the
> same. Or, the URL will change a lot more than just the package name. I feel
> that, if a package (or this package) gets renamed, we will need to change more
> than just renaming the ebuild.
> Also, running a simple "s/glsnake/something/g" is not very difficult.
> But, anyway, feel free to use ${PN} then. But should it be also used in
> src_compile/src_install?
> 

I am just giving out some hints for improved ebuild writing, i am not able nor do i plan to maintain it in the main tree.
Comment 8 Matthew Marchese Gentoo Infrastructure gentoo-dev 2023-07-25 02:15:27 UTC
Software moved GitHub for hosting: https://github.com/jaqx0r/glsnake

Latest activity 2020-12-20. No packaged releases, so it would need pulling based on commit or manually packaged, published, and pulled into the distfile mirrors.