Compiler GUI and other packaging tools

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#21 Post by Gedrean »

So, I tested out Pcompile 0.1.0, found a minor issue - in src2all, the following line:

Code: Select all

CFLAGS=" -pipe -combine -Os -ffunction-sections -fdata-sections -momit-leaf-frame-pointer -fomit-frame-pointer -march=i486 -mtune=i486 " CXXFLAGS=" -pipe -combine -Os -ffunction-sections -fdata-sections -momit-leaf-frame-pointer -fomit-frame-pointer -march=i486 -mtune=i486 " LDFLAGS=" -Wl,-Os,--gc-sections,-s "./configure --build=i486-t2-linux-gnu --prefix=/usr --sysconfdir=/etc --localstatedir=/var  $CONFOPTS
If you notice, there is no space between LDFLAGS=" -Wl,-Os,--gc-sections,-s " and ./configure --build=i486-t2-linux-gnu --prefix=/usr --sysconfdir=/etc --localstatedir=/var $CONFOPTS -- I inserted a space and that configure command ran after displaying the configure help in gtkdialog - thus guaranteeing that it actually configged with the options I chose.

Should probably be fixed if that is in error.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#22 Post by technosaurus »

good catch, I'll make sure to fix that in the meantime the file is /usr/bin/src2all

use this code to automagically patch it

Code: Select all

sed -i 's/.\/configure/ .\/configure/' /usr/bin/src2all
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#23 Post by Gedrean »

Yeah. My only problem now is I tried to build Transmission (newest 1.74) and got everything BUT the program, using pcompile. LOL.

Something odd, I'll figure it out I guess, but still. It works at least. :)

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

My changes, submitting a modified pet...

#24 Post by Gedrean »

Thought I'd revisit this little topic, and take another look at src2all and its buddies.

I made a few changes I thought you'd like, technosaurus.

First, fixed the bug we found earlier, with the space before ./configure
Second, put the "default" extras straight into the already-included options, changed the text to reflect.
Cleaned up the pcompile interface window with that in mind a bit.

Tried to make the labels look a bit better and not be over-spaced, but no dice - text formatting in gtkdialog is spotty with that kind of wording.

Wanted to add in a button that would trigger the ./configure --help but no dice there either, too complicated to pull off.

Well anyhow, have a look see if it plays nice for you. I used these changes to compile and build SDL and various SDL-Subgroup PETs, with plenty of success.
Attachments
pcompile-0.1.1.pet
PCompile 0.1.0 with changes made, 0.1.1 resulting version suggested. This is an unofficial pcompile version.
(4.11 KiB) Downloaded 806 times

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#25 Post by technosaurus »

Maybe some checkboxes that default to TRUE that way they can be unchecked for packages that fail if that option is not available... then put them together in one string to pass to src2all (maybe src2all can just be part of pcompile now)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#26 Post by Gedrean »

Spoke too soon, found another glitch I never found before -- out of sheer luck apparently.

When handling bzip/bz2, src2all passes the arg -xyf to tar. Sadly, the tar version in Puppies 431 (and probably puppy 4.3.0 / upcoming 4.3.1) doesn't like y, and fails out. tar -xf <arg> seems to work, so modified it too.

I'll reply to your other suggestion in a moment.

*sigh*. Now to rebuild the damn pet and repost.
Attachments
pcompile-0.1.1.pet
use this one, not the previous one. Fixed tar bug in src2all
(4.1 KiB) Downloaded 785 times

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#27 Post by Gedrean »

technosaurus wrote:Maybe some checkboxes that default to TRUE that way they can be unchecked for packages that fail if that option is not available... then put them together in one string to pass to src2all (maybe src2all can just be part of pcompile now)
To be honest that sounds really spectacular. Have it trigger a default options dialog with those checkbox to turn them off if need be, and instead of having default settings in src2all just have them passed in the config file that's passed.

While joining them together may theoretically speed things up a little bit, I don't think the time is that big of an issue. Compared to the fact that src2all is already rather... disconcertingly complicated...

But I love the checkbox idea.

Pity my skills with gtkdialog have already proven... lacking.

That being said, some of the options are almost guaranteed to be there, like prefix, and build. So those can remain.

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#28 Post by Gedrean »

Another thought.

Some packages (like GlibC which I'm trying desparately to compile the newest version for puppy - a game requires 2.7, and all the depos have 2.6, and I can't compile 2.10 due to some falloc call being undefined) require building from a separate build directory.

I tried building and doing 2dirs and dir2pet from a separate directory, called pcompile_build, located inside several different package dirs.
doing all the commands, building, doing 2dirs, and then doing dir2pet on the proper location, all worked from inside that build directory.

In the interests of keeping everything clean and orderly in the main package directory, pcompile should probably do that, I think.
I can rewrite some lines here and there to make it work, and post that later today.

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#29 Post by Gedrean »

Alright, can't compile GlibC as it'll put puppy in a bag and drown it in the river:( ... but I put in the changes to make it do what I mentioned above, and it seems complacent...

One question, though, there's the python setup.py command in there, does setup.py get created by ../configure or is it usually in the main src directory anyhow? I'm not sure whether to drop back to the main directory to run that setup.py or not...

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#30 Post by Gedrean »

Also, and this is just my personal thing with it, since /root/my-applications is in the Path and LD Lib path, my changes put the files into that location, specifically /root/my-applications/bin -- This way I can find them easier for those on-the-fly changes and tests... <G> this is just for the pcompile files, not the files compiled - those still sit in /usr since there's no corresponding directories for etc, share, and the like.

As far as the checkboxes, I can put them in but damned if I understand how parsing works in Linux, so I'll leave that up to you techno. :)

But I'll have them in there, and comments, and lots of documentation on what I can document for the script, so it's understandable kinda...

God, nobody tell my programming professor I've been *gasp* documenting code, it'll give him a conniption.

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#31 Post by Gedrean »

Alright, done. Pcompile 0.1.2, now installing pcompile to /root/my-applications/bin (you can change it in the pet/tgz if you want to, this is more of a bugfix and minor change to see if it works, then I'd suggest building a pet that puts it where it should go. :) )

Works great by making the pcompile_build directory, which makes for figuring out what got built where easier.

Used it to build the new Glade3, which didn't help in my GUI developing any because it doesn't seem to include things -- and it wouldn't have mattered, because gtkdialog3 requires certain libs that should be included with GTK but aren't, to make Glade files readable as interfaces... so back to the drawing board. Though I did find techno's handy-dandy reference of different functions to copy paste... so I think I'll do that, and then just copy out some stuff and do some copypasta to make it work with the checkboxes.

Anyhow, here's 0.1.2.
Attachments
pcompile-0.1.2.pet
Pcompile 0.1.2, see above for changes.
(4.18 KiB) Downloaded 868 times

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#32 Post by Gedrean »

And I think now I've figured out how to do it. Thanks to your tutorial, and a little help here and there, I've figured out the elusive "notebook" tag, which has made doing this easier, though it's still not pretty.

In any case, it'll be better-ish for those tabs.
I might think it would be a good idea to split the actual file for the dialog to another file, and pcompile be designed to call that dialog and parse the results, then send those to src2all -- since it's a standalone program and can run easily without more than one argument, since it by default just takes a tarball of various types and compiles builds and pets it.

The only thing that concerns me is trying to figure out how to make pcompile pass arguments that have an = in them, as those were previously a challenge... I recall that was funky.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#33 Post by technosaurus »

Here are the Flags that work 99% of the time and make the compile faster and smaller.

CFLAGS=" -pipe -combine -Os -momit-leaf-frame-pointer -fomit-frame-pointer \
-fmerge-all-constants -mpreferred-stack-boundary=2 -march=i386 -mtune=i686 " \
CXXFLAGS=" -pipe -combine -Os -momit-leaf-frame-pointer -fomit-frame-pointer \
-fmerge-all-constants -mpreferred-stack-boundary=2 -march=i386 -mtune=i686 " \
LDFLAGS=" -Wl,-O4,-Os,-relax,--sort-common,--no-keep-memory,-s " \
./configure ....................
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#34 Post by Gedrean »

Okay. I'm at a wall here, so until I can figure that out I can't fix the "= in entry" bug we had before.

Instead of sed'ing out the " and = chars beforehand, then grepping, I grep first to get down to the varname="value" level.
From there I strip out the 'varname=' entirely, leaving me with "value".

I can sed out the first ", but I'm trying to kill the second ", and having a hell of a time figuring out a way. All the options with sed seem to match first occurrence, and anything with " in it needs to be preserved, but the last " does NOT need to be preserved, imho.

So, ideas?

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#35 Post by technosaurus »

That is why I was suggesting integrating src2all - maybe a newer version of sed/grep/cat etc... who knows? I never figured that one out, but it is not applicable if you don't have to pass the parameters outside of the script (just paste src2all into the end of pcompile and fix $1, $2 and $3 to use the parameters in pcompile - noone really uses src2all directly - that is what T2 and src2pkg are for)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#36 Post by seaside »

Gedrean,
but I'm trying to kill the second "
Perhaps you could knock off the last quote by

Code: Select all

 pipe input | cut -d'"' -f1
There's probably some way to do it in sed also, but this seems easier.

Cheers,
s

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#37 Post by technosaurus »

actually if you look back at Barry's post maybe you can decode and apply it - at the time it was completely foreign to me - now its still like a 3rd language as I continue to learn the useful bash commands
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#38 Post by Gedrean »

Nevermind, found it. Thanks for the suggestion @seaside, but I found a bash integrated function (faster to call these than sed)

Code: Select all

CFG1="`echo "$CHOOSER2" | grep WORD1 | sed 's/WORD1=//' | sed 's/\"//'`"
CFG1=${CFG1%\"}
First echo's out the value, sends it to grep to pull only WORD1, strips WORD1= (gets rid of that first =, sed's the first ", then does a end-strip of the last ".

Provided gtkdialog doesn't change its behavior for passing back values... this should work. I'd honestly be happy if there was a way to do it without sed...

And I've found that I can do it with that same expansion.
I'm building this as a complex function (well, not THAT complex) but so I can just remember what is happening without quite as hard to read...?

well hell, I got nearly everything I wanted... but I use an eval statement to push a value back OUT to the calling argument from a function... and it strips double quotes, and freaks out with single quotes.

Here's the code I have so far...

Code: Select all

function pc_strip () # pc_strip arg1 arg2.
{
	# arg1 should be the name of the var to strip with.
	# arg2 should be the name of the variable from gtkdialog.
	
	y=\$"$1"   # y becomes "$arg1".
	x=`eval "expr \"$y\" "` # x becomes value of $arg1, so $x = $arg1.
	# finally start our strips.
	x=${x#$2=\"} # strip out arg2=" from beginning
	x=${x%\"} # strip out " from end
	# now to protect any quotes.
	echo $x " - that was arg1!"
	eval "$1=$x" # push value back onto $arg1
}
Apparently, ${x#$2=\"} says: Take $x, strip out from it the contents of $2 plus = plus ", from teh beginning.
Then, ${x%\"} says "take $x, strip the " from the end"
That gets rid of all the questionables, but if the user passes quotes in their args, unfortunately in that "echo $x " - that was arg1" line, it shows them, but when pushed back onto $arg1 using the eval the quotes get nuked by our good friend eval. How to resolve? I do want to do this with functions, so that the actual text in the script is more legible, and to minimize retyped stuff.

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#39 Post by Gedrean »

technosaurus wrote:actually if you look back at Barry's post maybe you can decode and apply it - at the time it was completely foreign to me - now its still like a 3rd language as I continue to learn the useful bash commands
I'm braindead as to which post you mean. :)

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#40 Post by technosaurus »

nope its me, must have been somewhere else
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply