It is currently 16 Apr 2024, 21:00
   
Text Size

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

by Nate and Snacko

Moderators: Snacko, CCGHQ Admins

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

Postby Snacko » 09 Aug 2008, 22:12

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
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

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

Postby Fritti » 11 Aug 2008, 18:07

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.
Fritti
 
Posts: 26
Joined: 04 Aug 2008, 11:46
Has thanked: 0 time
Been thanked: 0 time

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

Postby Snacko » 11 Aug 2008, 18:31

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
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

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

Postby Fritti » 11 Aug 2008, 19:00

$ 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;
    }
Fritti
 
Posts: 26
Joined: 04 Aug 2008, 11:46
Has thanked: 0 time
Been thanked: 0 time

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

Postby Snacko » 11 Aug 2008, 19:40

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
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

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

Postby tengence » 26 Nov 2008, 03:55

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
tengence
 
Posts: 3
Joined: 24 Nov 2008, 17:51
Has thanked: 0 time
Been thanked: 0 time

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

Postby Snacko » 26 Nov 2008, 15:57

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)
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

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

Postby tengence » 29 Nov 2008, 02:42

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
tengence
 
Posts: 3
Joined: 24 Nov 2008, 17:51
Has thanked: 0 time
Been thanked: 0 time

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

Postby telengard » 19 Mar 2011, 18:29

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
Author of Dreamblade:
viewtopic.php?f=51&t=1215
User avatar
telengard
DEVELOPER
 
Posts: 379
Joined: 23 May 2009, 23:04
Has thanked: 2 times
Been thanked: 27 times

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

Postby Snacko » 19 Mar 2011, 21:48

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
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

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

Postby BaconCatBug » 20 Mar 2011, 04:10

I actually have the generator working in linux without wine, via your native.sh scripts.

(p.s. +9001 thanks for that! :P)
User avatar
BaconCatBug
Apprentice
 
Posts: 253
Joined: 17 Dec 2010, 12:13
Has thanked: 6 times
Been thanked: 41 times


Return to HQ Card Generator

Who is online

Users browsing this forum: No registered users and 21 guests

cron

Who is online

In total there are 21 users online :: 0 registered, 0 hidden and 21 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 21 guests

Login Form