Installation snapshot question

Ask for help with ScummVM problems

Moderator: ScummVM Team

Post Reply
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Installation snapshot question

Post by Raziel »

Hi devs,

I have a question regarding installing a snapshot build with shared plugins.

Right now I can use (in the .mk file)
cp ($PLUGINS) ($INSTALLATIONPATH)/plugins/
to copy the whole lot of engines.
But of course they will be non-stripped.

Is there a way to also access all plugins as single files?
Like, I want to do something like that
($STRIP) single_plugin -o ($INSTALLATIONPATH)/plugins/single_plugin
without adding a line for all the plugins (since they will change in the future anyway).

Would that be possible with already available (makefile/.mk) variables, or do I need to solve this locally (which I could do aswell, just wanted to know if It could be done with "on-board" methods)?

The problem I have is, that
strip plugins/*
do strip all the files, however also somehow mangles or breaks them and makes them unusable in ScummVM afterwards. (Probably a bug in my strip command)

Thanks a lot
User avatar
sev
ScummVM Lead
Posts: 2277
Joined: Wed Sep 21, 2005 1:06 pm
Contact:

Re: Installation snapshot question

Post by sev »

Code: Select all

for i in plugins/*; do
     ($STRIP) $i -o ($INSTALLATIONPATH)/$i
done

Eugene
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Re: Installation snapshot question

Post by Raziel »

@sev

Awesome

Thanks a lot
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Re: Installation snapshot question

Post by Raziel »

sev wrote: Mon Oct 14, 2019 11:05 pm

Code: Select all

for i in plugins/*; do
     ($STRIP) $i -o ($INSTALLATIONPATH)/$i
done

Eugene
I use

Code: Select all

ifdef DYNAMIC_MODULES
	mkdir -p $(AMIGAOSPATH)/plugins
	for i in plugins/*; do
		($STRIP) $i -o $(AMIGAOSPATH)/plugins/$i
	done
endif
and get an error message
for i in plugins/*; do
T:gmake.sh.249.GMWPEH[1]: syntax error: `for' unmatched
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Re: Installation snapshot question

Post by Raziel »

The reason is that on my system every command is sent to a temporary file in ram:, which consists only of the first line and will be processed.

I can circumvent this with

Code: Select all

for i in plugins/*; do "$(STRIP) $i -o $(AMIGAOSPATH)/$i"; done
but with that line in place every "$i" produces a blank field, so i end up with
"strip -o path/ "
Help?

The same works fine when using it in a text file and processing it with "sh test.sh"
User avatar
criezy
ScummVM Developer
Posts: 950
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Installation snapshot question

Post by criezy »

I suspect the substitution is done when writing the line to the file. For the $i it needs to be done when running the script. I don't know how your system handles this, but you would need to escape the $ of $i, which is typically done using a backslash, to avoid the substitution happening when writing it to the file:

Code: Select all

for i in plugins/*; do "$(STRIP) \$i -o $(AMIGAOSPATH)/\$i"; done
Escaping might work differently for you, so the syntax might be different, but that is the idea.
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Re: Installation snapshot question

Post by Raziel »

@criezy

For some reason my system is still messing around
This

Code: Select all

for i_plugin in plugins/*; do "$(STRIP) \$i_plugin -o $(AMIGAOSPATH)/\$i_plugin"; done
becomes this

Code: Select all

for i_plugin in plugins/*; do "strip \_plugin -o Games:ScummVM/\_plugin"; done
It doesn't matter how i call the variable/counter, it always eats away the first char (probably because of the $, but i'm not sure)

edit:
The same happens when i don't use backslash, so i guess this character doesn't ESCAPE it for me.

edit2: Why it works fine with $(STRIP) and $(AMIGAOSPATH) is beyond me

Thank you
ccawley2011
Posts: 17
Joined: Sat Feb 03, 2018 3:45 pm

Re: Installation snapshot question

Post by ccawley2011 »

In this case, it might be better to use the foreach function in Make instead of using shell functionality. For example:

Code: Select all

$(foreach plugin, $(PLUGINS), $(STRIP) $(plugin) -o $(AMIGAOSPATH)/$(plugin);)
This should work, however I haven't tried it.
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Re: Installation snapshot question

Post by Raziel »

@ccawley2011

That did it, thanks a bunch :-)

Thank you to the others as well, learned a thing or two today (hopefully nothing important was wiped from my memory during the process)
Post Reply