Skip to content

Commit

Permalink
make build scripts easier usable on windows systems
Browse files Browse the repository at this point in the history
  • Loading branch information
pinhead84 committed Jan 13, 2017
1 parent 18d338b commit 99534db
Show file tree
Hide file tree
Showing 12 changed files with 312 additions and 19 deletions.
38 changes: 38 additions & 0 deletions build.bat
@@ -0,0 +1,38 @@
@echo off
goto :TopOfCode

================================================================================

Build application bundles.

Copyright (c) 2015-2017 OpenIndex.de

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

================================================================================

:TopOfCode

set BASE_DIR=%~dp0
set BASE_DIR=%BASE_DIR:~0,-1%
set TCLKITSH=%BASE_DIR%\utils\tclkitsh-win32.upx.exe
%TCLKITSH% %BASE_DIR%\build.tcl

echo.
pause
13 changes: 11 additions & 2 deletions build.tcl
Expand Up @@ -21,6 +21,7 @@ puts ""
proc create_package {output tclkit arch {archTarget ""}} {
global BUILD_DIR
global BUILD_SRC_DIR
global BUILD_TCLKIT
global SRC_DIR
global TCLKIT
global SDX
Expand All @@ -33,7 +34,7 @@ proc create_package {output tclkit arch {archTarget ""}} {
file copy -force $tclkit $tclkit_temp
file copy -force [file join $SRC_DIR "data" $arch] [file join $BUILD_SRC_DIR "data" $archTarget]

if { [catch {exec $TCLKIT $SDX wrap $output -vfs $BUILD_SRC_DIR -runtime $tclkit_temp} result] } {
if { [catch {exec $BUILD_TCLKIT $SDX wrap $output -vfs $BUILD_SRC_DIR -runtime $tclkit_temp} result] } {
puts "ERROR: Can't create binary package!"
puts $::errorInfo
}
Expand Down Expand Up @@ -104,6 +105,14 @@ proc postprocess_exe {dir} {

set BUILD_SRC_DIR [file join $BUILD_DIR "$PROJECT.vfs"]

if {[is_windows]} {
# Use tclkitsh binary on windows system for packaging.
set BUILD_TCLKIT $TCLKITSH_WINDOWS
} else {
# Use tclkit binary on other systems for packaging.
set BUILD_TCLKIT $TCLKIT
}

puts "cleanup"
if {[file exists $BUILD_DIR]} {
file delete -force $BUILD_DIR
Expand All @@ -121,7 +130,7 @@ foreach log [glob -nocomplain -directory $BUILD_SRC_DIR -type f "*.log"] {
}

puts "create $PROJECT-$VERSION.kit"
if { [catch {exec $TCLKIT $SDX wrap [file join $TARGET_DIR "$PROJECT-$VERSION.kit"] -vfs $BUILD_SRC_DIR} result] } {
if { [catch {exec $BUILD_TCLKIT $SDX wrap [file join $TARGET_DIR "$PROJECT-$VERSION.kit"] -vfs $BUILD_SRC_DIR} result] } {
puts "ERROR: Can't starkit bundle!"
puts $::errorInfo
}
Expand Down
38 changes: 38 additions & 0 deletions clean.bat
@@ -0,0 +1,38 @@
@echo off
goto :TopOfCode

================================================================================

Remove files created from previous builds.

Copyright (c) 2015-2017 OpenIndex.de

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

================================================================================

:TopOfCode

set BASE_DIR=%~dp0
set BASE_DIR=%BASE_DIR:~0,-1%
set TCLKITSH=%BASE_DIR%\utils\tclkitsh-win32.upx.exe
%TCLKITSH% %BASE_DIR%\clean.tcl

echo.
pause
38 changes: 38 additions & 0 deletions i18n-compile.bat
@@ -0,0 +1,38 @@
@echo off
goto :TopOfCode

================================================================================

Compile messages (msg files) from translation files (po files).

Copyright (c) 2015-2017 OpenIndex.de

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

================================================================================

:TopOfCode

set BASE_DIR=%~dp0
set BASE_DIR=%BASE_DIR:~0,-1%
set TCLKITSH=%BASE_DIR%\utils\tclkitsh-win32.upx.exe
%TCLKITSH% %BASE_DIR%\i18n-compile.tcl

echo.
pause
38 changes: 38 additions & 0 deletions i18n-extract.bat
@@ -0,0 +1,38 @@
@echo off
goto :TopOfCode

================================================================================

Extract translations from source codes into a translation template (pot file).

Copyright (c) 2015-2017 OpenIndex.de

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

================================================================================

:TopOfCode

set BASE_DIR=%~dp0
set BASE_DIR=%BASE_DIR:~0,-1%
set TCLKITSH=%BASE_DIR%\utils\tclkitsh-win32.upx.exe
%TCLKITSH% %BASE_DIR%\i18n-extract.tcl

echo.
pause
38 changes: 38 additions & 0 deletions i18n-merge.bat
@@ -0,0 +1,38 @@
@echo off
goto :TopOfCode

================================================================================

Merge translation template (pot file) into translation files (po files).

Copyright (c) 2015-2017 OpenIndex.de

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

================================================================================

:TopOfCode

set BASE_DIR=%~dp0
set BASE_DIR=%BASE_DIR:~0,-1%
set TCLKITSH=%BASE_DIR%\utils\tclkitsh-win32.upx.exe
%TCLKITSH% %BASE_DIR%\i18n-merge.tcl

echo.
pause
11 changes: 3 additions & 8 deletions init.tcl
Expand Up @@ -19,12 +19,10 @@ set AUTHOR_EMAIL "info@openindex.de"

# preferred applications
set TAR ""
set TCLSH ""
set XGETTEXT ""
set MSGFMT ""
set MSGMERGE ""
set WINE ""
set SEVENZIP ""

# setup internal pathes
set BASE_DIR [file normalize [file dirname $argv0]]
Expand All @@ -39,10 +37,13 @@ set I18N_PO_DIR [file join $I18N_DIR "app-support"]
set I18N_POT [file join $I18N_DIR "app-support.pot"]
set SDX [file join $UTILS_DIR "sdx-20110317.kit"]
set RESHACK [file join $UTILS_DIR "ResourceHacker.exe"]
set SEVENZIP [file join $UTILS_DIR "7za.exe"]
set TCLKIT_LINUX_AMD64 [file join $UTILS_DIR "tclkit-8.6.6-linux-amd64"]
set TCLKIT_LINUX_I386 [file join $UTILS_DIR "tclkit-8.6.6-linux-i386"]
set TCLKIT_MAC [file join $UTILS_DIR "tclkit-8.6.6-macosx"]
set TCLKIT_WINDOWS [file join $UTILS_DIR "tclkit-8.6.6-windows.exe"]
set TCLKITSH_WINDOWS [file join $UTILS_DIR "tclkitsh-win32.upx.exe"]



#
Expand All @@ -54,9 +55,6 @@ source [file join $UTILS_DIR "utils.tcl"]

# detect application pathes
set TCLKIT [get_tclkit]
if {![info exists TCLSH] || $TCLSH == ""} {
set TCLSH [which "tclsh"]
}
if {![info exists XGETTEXT] || $XGETTEXT == ""} {
set XGETTEXT [which "xgettext"]
}
Expand All @@ -74,6 +72,3 @@ if {![is_windows]} {
set WINE [which "wine"]
}
}
if {[is_windows]} {
set SEVENZIP [file join $UTILS_DIR "7z.exe"]
}
38 changes: 38 additions & 0 deletions ssh-keygen.bat
@@ -0,0 +1,38 @@
@echo off
goto :TopOfCode

================================================================================

Generate a keypair for SSH encryption.

Copyright (c) 2015-2017 OpenIndex.de

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

================================================================================

:TopOfCode

set BASE_DIR=%~dp0
set BASE_DIR=%BASE_DIR:~0,-1%
set TCLKITSH=%BASE_DIR%\utils\tclkitsh-win32.upx.exe
%TCLKITSH% %BASE_DIR%\ssh-keygen.tcl

echo.
pause
38 changes: 38 additions & 0 deletions start.bat
@@ -0,0 +1,38 @@
@echo off
goto :TopOfCode

================================================================================

Start application from source code.

Copyright (c) 2015-2017 OpenIndex.de

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

================================================================================

:TopOfCode

set BASE_DIR=%~dp0
set BASE_DIR=%BASE_DIR:~0,-1%
set TCLKITSH=%BASE_DIR%\utils\tclkitsh-win32.upx.exe
%TCLKITSH% %BASE_DIR%\start.tcl

echo.
pause
Binary file added utils/7za.exe
Binary file not shown.
Binary file added utils/tclkitsh-win32.upx.exe
Binary file not shown.

0 comments on commit 99534db

Please sign in to comment.