Various build-process updates

This commit is contained in:
Timothy Warren 2012-11-30 08:29:39 -05:00
parent f9d97aa25d
commit ceeb5d826d
8 changed files with 92 additions and 68 deletions

5
.gitignore vendored
View File

@ -1,4 +1,4 @@
# Ignore the stupid .DS_Store files # Ignore stupid files and build-specific files
*.DS_Store *.DS_Store
settings.json settings.json
errors.txt errors.txt
@ -7,4 +7,5 @@ test_config.json
nbproject/* nbproject/*
*.o *.o
*.app/* *.app/*
OpenSQLManager OpenSQLManager
*.app*

View File

@ -9,9 +9,9 @@ before_script:
- sh -c "psql -c 'create database test;' -U postgres" - sh -c "psql -c 'create database test;' -U postgres"
- sh -c "mysql -e 'create database IF NOT EXISTS test;'" - sh -c "mysql -e 'create database IF NOT EXISTS test;'"
- git submodule update --init - git submodule update --init
- cd sys/db - cd src/sys/db
- git checkout master - git checkout master
- git pull origin master - git pull origin master
- cd ../../ - cd ../../../
script: php ./tests/index.php script: php ./tests/index.php

View File

@ -20,6 +20,8 @@ int main(int argc, char *argv[])
{ {
PHP_EMBED_START_BLOCK(argc,argv) PHP_EMBED_START_BLOCK(argc,argv)
zend_eval_string(" \ zend_eval_string(" \
$name = 'wxwidgets.'.PHP_SHLIB_SUFFIX; \
dl($name); \
chdir(dirname($argv[0])); \ chdir(dirname($argv[0])); \
require ('OpenSQLManager.php'); \ require ('OpenSQLManager.php'); \
", NULL, "TEST" TSRMLS_CC); ", NULL, "TEST" TSRMLS_CC);

View File

@ -1,7 +1,9 @@
<?php <?php
// Compile the binary // Compile the binary
`make clean`; `make clean`;
`make all`; `make release`;
`rm OpenSQLManager.o`;
define('VERSION', '0.2.0'); define('VERSION', '0.2.0');
define('APP_PATH', __DIR__.'/OpenSQLManager.app'); define('APP_PATH', __DIR__.'/OpenSQLManager.app');
@ -31,41 +33,66 @@ if ( ! function_exists('glob_recursive'))
} }
} }
/**
* Creates directories based on the array given
*
* @param array $structure
* @param string $path
* @return void
*/
function make_dir_tree($structure, $path=__DIR__)
{
foreach ($structure as $folder => $sub_folder)
{
// Folder with subfolders
if (is_array($sub_folder))
{
$new_path = "{$path}/{$folder}";
if ( ! is_dir($new_path)) mkdir($new_path);
call_user_func(__FUNCTION__, $sub_folder, $new_path);
}
else
{
$new_path = "{$path}/{$sub_folder}";
if ( ! is_dir($new_path)) mkdir($new_path);
}
}
}
/** /**
* Create bundle folder structure * Create bundle folder structure
*/ */
function create_dirs() function create_dirs()
{ {
if ( ! is_dir(APP_PATH)) mkdir(APP_PATH); $dir_tree = [
'OpenSQLManager.app' => [
if ( ! is_dir(CONTENTS)) 'Contents' => [
{ 'Frameworks',
mkdir(CONTENTS); 'Resources' => [
//mkdir(CONTENTS.'/Frameworks'); 'images'
} ],
'MacOS' => [
if ( ! is_dir(RESOURCES)) 'sys' => [
{ 'common',
mkdir(RESOURCES); 'db' => [
mkdir(RESOURCES.'/images'); 'classes',
} 'drivers' => [
'mysql',
'pgsql',
'sqlite',
'odbc',
'firebird'
]
],
'widgets',
'windows'
]
]
]
]
];
if ( ! is_dir(MAC_OS)) make_dir_tree($dir_tree);
{
mkdir(MAC_OS);
mkdir(MAC_OS.'/sys');
mkdir(MAC_OS.'/sys/common');
mkdir(MAC_OS.'/sys/db');
mkdir(MAC_OS.'/sys/widgets');
mkdir(MAC_OS.'/sys/windows');
mkdir(MAC_OS.'/sys/db/classes');
mkdir(MAC_OS.'/sys/db/drivers');
mkdir(MAC_OS.'/sys/db/drivers/mysql');
mkdir(MAC_OS.'/sys/db/drivers/pgsql');
mkdir(MAC_OS.'/sys/db/drivers/sqlite');
mkdir(MAC_OS.'/sys/db/drivers/odbc');
mkdir(MAC_OS.'/sys/db/drivers/firebird');
}
} }
/** /**
@ -82,7 +109,7 @@ function copy_src()
// Drop to shell because php treats it as text // Drop to shell because php treats it as text
$src = __DIR__.'/OpenSQLManager'; $src = __DIR__.'/OpenSQLManager';
$dest = MAC_OS; $dest = MAC_OS;
`cp {$src} {$dest}`; `mv {$src} {$dest}`;
$raw_src_files = glob_recursive(SRC_DIR.'/*.php'); $raw_src_files = glob_recursive(SRC_DIR.'/*.php');
$src_files = array(); $src_files = array();
@ -119,13 +146,6 @@ function copy_src()
// Copy the files // Copy the files
copy($resource, $new_rs); copy($resource, $new_rs);
} }
// Copy frameworks
/*if (is_dir('/Library/Frameworks/Firebird.Framework'))
{
$new_path = FRAMEWORKS;
`cp -R /Library/Frameworks/Firebird.framework/ {$new_path}/Firebird.framework`;
}*/
} }
/** /**
@ -136,30 +156,30 @@ function create_plist()
$version = VERSION; $version = VERSION;
$plist = <<<XML $plist = <<<XML
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>App for managing databases.</string> <string>App for managing databases.</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>OpenSQLManager</string> <string>OpenSQLManager</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.aviat4ion.OpenSQLManager</string> <string>com.aviat4ion.OpenSQLManager</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>OpenSQLManager</string> <string>OpenSQLManager</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>OpenSQLManager.icns</string> <string>OpenSQLManager.icns</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>{$version}</string> <string>{$version}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>10.6.0</string> <string>10.6.0</string>
</dict> </dict>
</plist> </plist>
XML; XML;
// Add the plist to the bundle // Add the plist to the bundle

View File

@ -1,5 +1,4 @@
CFLAGS = -c `/opt/php-embed/bin/php-config --includes` -Wall -g CFLAGS = -c `/opt/php-embed/bin/php-config --includes` -Wall -g
LDFLAGS = -L/Library/Frameworks/Firebird.framework/Libraries -L/opt/php-embed/lib -lphp5 `/opt/php-embed/bin/php-config --libs` LDFLAGS = -L/Library/Frameworks/Firebird.framework/Libraries -L/opt/php-embed/lib -lphp5 `/opt/php-embed/bin/php-config --libs`
all: OpenSQLManager.c all: OpenSQLManager.c
@ -11,4 +10,6 @@ release: OpenSQLManager.c
${CC} -Os -o OpenSQLManager OpenSQLManager.o ${LDFLAGS} ${CC} -Os -o OpenSQLManager OpenSQLManager.o ${LDFLAGS}
clean: clean:
rm -f OpenSQLManager.o rm -f OpenSQLManager.o
rm -f OpenSQLManager
rm -rf OpenSQLManager.app

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB