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
settings.json
errors.txt
@ -7,4 +7,5 @@ test_config.json
nbproject/*
*.o
*.app/*
OpenSQLManager
OpenSQLManager
*.app*

View File

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

View File

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

View File

@ -1,7 +1,9 @@
<?php
// Compile the binary
`make clean`;
`make all`;
`make release`;
`rm OpenSQLManager.o`;
define('VERSION', '0.2.0');
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
*/
function create_dirs()
{
if ( ! is_dir(APP_PATH)) mkdir(APP_PATH);
if ( ! is_dir(CONTENTS))
{
mkdir(CONTENTS);
//mkdir(CONTENTS.'/Frameworks');
}
if ( ! is_dir(RESOURCES))
{
mkdir(RESOURCES);
mkdir(RESOURCES.'/images');
}
$dir_tree = [
'OpenSQLManager.app' => [
'Contents' => [
'Frameworks',
'Resources' => [
'images'
],
'MacOS' => [
'sys' => [
'common',
'db' => [
'classes',
'drivers' => [
'mysql',
'pgsql',
'sqlite',
'odbc',
'firebird'
]
],
'widgets',
'windows'
]
]
]
]
];
if ( ! is_dir(MAC_OS))
{
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');
}
make_dir_tree($dir_tree);
}
/**
@ -82,7 +109,7 @@ function copy_src()
// Drop to shell because php treats it as text
$src = __DIR__.'/OpenSQLManager';
$dest = MAC_OS;
`cp {$src} {$dest}`;
`mv {$src} {$dest}`;
$raw_src_files = glob_recursive(SRC_DIR.'/*.php');
$src_files = array();
@ -119,13 +146,6 @@ function copy_src()
// Copy the files
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;
$plist = <<<XML
<?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">
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
<string>App for managing databases.</string>
<key>CFBundleExecutable</key>
<string>OpenSQLManager</string>
<key>CFBundleIdentifier</key>
<string>com.aviat4ion.OpenSQLManager</string>
<key>CFBundleName</key>
<string>OpenSQLManager</string>
<key>CFBundleIconFile</key>
<string>OpenSQLManager.icns</string>
<key>CFBundleShortVersionString</key>
<string>{$version}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSMinimumSystemVersion</key>
<string>10.6.0</string>
</dict>
</plist>
<?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">
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
<string>App for managing databases.</string>
<key>CFBundleExecutable</key>
<string>OpenSQLManager</string>
<key>CFBundleIdentifier</key>
<string>com.aviat4ion.OpenSQLManager</string>
<key>CFBundleName</key>
<string>OpenSQLManager</string>
<key>CFBundleIconFile</key>
<string>OpenSQLManager.icns</string>
<key>CFBundleShortVersionString</key>
<string>{$version}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSMinimumSystemVersion</key>
<string>10.6.0</string>
</dict>
</plist>
XML;
// Add the plist to the bundle

View File

@ -1,5 +1,4 @@
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`
all: OpenSQLManager.c
@ -11,4 +10,6 @@ release: OpenSQLManager.c
${CC} -Os -o OpenSQLManager OpenSQLManager.o ${LDFLAGS}
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