Page 1 of 1

HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 09 Aug 2008, 22:12
by Snacko
I went ahead and wrote all the sh files for all the functions.
I only tested it under linux with no X, so I don't know how the drag and drop functionality works (might depend on your application providing the shell prompt).
You need to have wine installed and in your path for the scripts to work.
The speed is ok considering it's running non native code.
It would be great, if someone could test it on a mac and provide some feedback.
http://www.mediafire.com/?oszn2mmhvmq

Re: HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 11 Aug 2008, 18:07
by Fritti
Hey,

You prompted me to investigate whether this worked on my Fedora 9 box. Color me surprised when I found out that most of your magic was scripted in PHP. Did you know that there is a native version of the PHP command line for Linux?

On my Fedora 9 box I just needed to "yum install" the following packages:

  • php-cli
  • php-common
  • php-gd

I imagine Ubuntu needs "apt-get" but it should work about the same. After that, this command appeared to work:

Code: Select all
php scripts/generate.php pagedOutput=false decklistOnlyOutput=false decks/MBC.csv
I did run into the memory limit problem but I just put the following line in scripts/includes/global.php:

Code: Select all
ini_set('memory_limit', '128M');
Presto, generate.php generated 23 nice cards for me, using the native PHP!

Thanks for the utility, I'll explore it a bit more.

Re: HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 11 Aug 2008, 18:31
by Snacko
What's your php version (php -v)?
The code was designed with some php6 functionality in mind and it might give some errors or don't work properly on php5.
But it's good to know it works with some php bundles form your local distro repository.

You can easily change to omit wine for all other scripts if you only change the 2 scripts in php/*.sh

Re: HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 11 Aug 2008, 19:00
by Fritti
$ php -v
PHP 5.2.6 (cli) (built: May 8 2008 10:25:11)

I guess that's the default Fedora version.

BTW, it turns out that this patch is also needed (stoopid case insensitivity on filesystems issues):

EDIT: and another case of FS case sensitivity added

Code: Select all
--- scripts/classes/ArtDB.php.orig   2008-08-11 20:50:41.000000000 +0200
+++ scripts/classes/ArtDB.php   2008-08-11 21:03:33.000000000 +0200
@@ -112,6 +112,8 @@
                echo "\n";
             }
             if (file_exists($fileName)) return $fileName;
+            $fileName = $path . strtolower($name) . str_replace('%', $pic, $pattern) . $this->ext;
+            if (file_exists($fileName)) return $fileName;
          }
       } else {
          $fileName = $path . $name . $this->ext;
@@ -121,6 +123,8 @@
             echo "\n";
          }
          if (file_exists($fileName)) return $fileName;
+         $fileName = $path . strtolower($name) . $this->ext;
+         if (file_exists($fileName)) return $fileName;
       }
       return null;
    }

Re: HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 11 Aug 2008, 19:40
by Snacko
If you're using php5 you probably are getting some junk characters like ďťżďťżďťż every time a php file is included also something mysteriously might break (I observed php5->php6 breakage on common functions and this might go the other way around).
For the FS case sensitivity you also need to rename scripts/classes/renderers/PlaneswalkerRenderer.php to PlanesWalkerRenderer.php

Re: HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 26 Nov 2008, 03:55
by tengence
I dont want to sound like a dumbass but i do not know anything about php programming, but i am trying to get the card generator to work on an intel based mac and not having any luck. I am using the mac os ver 10.4. Any help would be appreciated.

Thanks
Jason

Re: HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 26 Nov 2008, 15:57
by Snacko
You either need Darwine or a native installation of php with gd.
The bash scripts should work fine with Darwine (haven't tested) and need little customization for a native php (2 scripts in php/*.sh)

Re: HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 29 Nov 2008, 02:42
by tengence
I have no idea what any of those programs are. I am just trying to make this program that is supposed to work on a mac work. I dont know how to code or any of that other stuff but i can follow directions. i tried to download darwine and had no luck getting it to run after i put it in my app folder. If you dont know how to make it work its ok just say that and ill try and find someone who knows how to make the cardgen work on a mac if it actually does work on one.

Jason

Re: HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 19 Mar 2011, 18:29
by telengard
Snacko wrote:I went ahead and wrote all the sh files for all the functions.
I only tested it under linux with no X, so I don't know how the drag and drop functionality works (might depend on your application providing the shell prompt).
You need to have wine installed and in your path for the scripts to work.
The speed is ok considering it's running non native code.
It would be great, if someone could test it on a mac and provide some feedback.
http://www.mediafire.com/?oszn2mmhvmq
I'm running fine under Linux without having to drag and drop. I did have to make a few changes to the shell scripts (I'd have to diff them to remember the changes). Works a treat! No WINE necessary.

I didn't have as much luck on the Mac due to the way a particular library (again, can't remember) was built. I can try again if you'd like.

(EDIT: Whoops, this thread is like 3 yrs old lol)

~telengard

Re: HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 19 Mar 2011, 21:48
by Snacko
I had scripts sans wine uploaded; it's native.tar.gz probably the same you ended up modifying the wine ones.
Someone had it working under Mac with MacPorts and contributed a short howto on the wiki http://www.slightlymagic.net/wiki/CardGenerator

Re: HQ Card Generator with WINE (Linux/BSD/MacOS)

PostPosted: 20 Mar 2011, 04:10
by BaconCatBug
I actually have the generator working in linux without wine, via your native.sh scripts.

(p.s. +9001 thanks for that! :P)