From 6c75001583ca780f5ab94c211455fd106c6ff2b2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 16 Aug 2009 07:41:52 +0000 Subject: [PATCH] 2009-08-16 09:39 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/global.cf ! Fixed to process HB_BUILD_NAME when forming package install dir inside /pkg dir. % Delete an unnecessary line. * package/mpkg_win.nsi * config/global.cf * bin/postinst.bat * Little bit changed the way dirs/names are communicated from GNU Make to postinst package creation code. The goal was to have an internal PKG_DIR var which is similar to other *_DIR vars. It was also possible to delete some exported vars this way. - Disabled package creation for non-NT shells (= pure MS-DOS). I found no way to make this work cleanly on pure MS-DOS. + Documented weird requirements of zip building. Also to better clarify why abspath is needed in GNU Make. * config/instsh.cf * Updated OS/2 comment to clarify some issues according to information from Maurilio. --- harbour/ChangeLog | 23 +++++++++++++++++++++++ harbour/bin/postinst.bat | 20 +++++++++++++++----- harbour/config/global.cf | 8 +++----- harbour/config/instsh.cf | 2 +- harbour/package/mpkg_win.nsi | 2 +- 5 files changed, 43 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c7a74afbc6..3aa40d6a9d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,29 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-16 09:39 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/global.cf + ! Fixed to process HB_BUILD_NAME when forming package install dir + inside /pkg dir. + % Delete an unnecessary line. + + * package/mpkg_win.nsi + * config/global.cf + * bin/postinst.bat + * Little bit changed the way dirs/names are communicated from + GNU Make to postinst package creation code. + The goal was to have an internal PKG_DIR var which is similar + to other *_DIR vars. It was also possible to delete some + exported vars this way. + - Disabled package creation for non-NT shells (= pure MS-DOS). + I found no way to make this work cleanly on pure MS-DOS. + + Documented weird requirements of zip building. Also to better + clarify why abspath is needed in GNU Make. + + * config/instsh.cf + * Updated OS/2 comment to clarify some issues according to + information from Maurilio. + 2009-08-16 03:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * ChangeLog * source/rtl/Makefile diff --git a/harbour/bin/postinst.bat b/harbour/bin/postinst.bat index 8cb9fcef2e..7e3c2c2b9a 100644 --- a/harbour/bin/postinst.bat +++ b/harbour/bin/postinst.bat @@ -100,16 +100,26 @@ goto INST_%HB_ARCHITECTURE% :MK_PKG - echo ! Making Harbour .zip install package: '%HB_PKGPATH%.zip' - if exist "%HB_PKGPATH%.zip" del "%HB_PKGPATH%.zip" + if not "%OS%" == "Windows_NT" echo ! postinst.bat Harbour install package creation requires Windows NT or upper. + if not "%OS%" == "Windows_NT" goto :EOF + + rem NOTE: Believe it or not this is the official method to zip a different dir with subdirs + rem without including the whole root path in filenames; you have to 'cd' into it. + rem Even with zip 3.0. For this reason this can't work with plain MS-DOS and we need + rem absolute path in HB_TOP. There is also no zip 2.x compatible way to force creation + rem of a new .zip, so we have to delete it first to avoid mixing in an existing .zip + rem files. [vszakats] + + echo ! Making Harbour .zip install package: '%HB_TOP%\%HB_PKGNAME%.zip' + if exist "%HB_TOP%\%HB_PKGNAME%.zip" del "%HB_TOP%\%HB_PKGNAME%.zip" pushd - cd "%HB_PKGBASE%" - "%HB_DIR_ZIP%zip.exe" -q -9 -X -r -o "%HB_PKGPATH%.zip" . -i "%HB_PKGNAME%\*" -x *.tds -x *.exp + cd "%HB_INSTALL_PREFIX%\.." + "%HB_DIR_ZIP%zip.exe" -q -9 -X -r -o "%HB_TOP%\%HB_PKGNAME%.zip" . -i "%HB_PKGNAME%\*" -x *.tds -x *.exp popd if "%HB_ARCHITECTURE%" == "dos" goto :EOF - echo ! Making Harbour .exe install package: '%HB_PKGPATH%.exe' + echo ! Making Harbour .exe install package: '%HB_TOP%\%HB_PKGNAME%.exe' "%HB_DIR_NSIS%makensis.exe" /V2 "%~dp0..\package\mpkg_win.nsi" goto :EOF diff --git a/harbour/config/global.cf b/harbour/config/global.cf index 6d213098f3..3e2202e375 100644 --- a/harbour/config/global.cf +++ b/harbour/config/global.cf @@ -606,6 +606,7 @@ ARCH_COMP := $(HB_ARCHITECTURE)/$(HB_COMPILER)$(subst \,/,$(HB_BUILD_NAME)) OBJ_DIR := obj/$(ARCH_COMP) BIN_DIR := $(TOP)$(ROOT)bin/$(ARCH_COMP) LIB_DIR := $(TOP)$(ROOT)lib/$(ARCH_COMP) +PKG_DIR := $(TOP)$(ROOT)pkg/$(ARCH_COMP) # Assemble relative path from OBJ_DIR to source. GRANDP := $(subst $(subst x,x, ),,$(foreach item, $(subst /, ,$(OBJ_DIR)), ../)) @@ -830,11 +831,8 @@ export HB_PKGNAMI HB_INSTALL_PREFIX_ORI := $(HB_INSTALL_PREFIX) ifeq ($(HB_BUILD_PKG),yes) ifeq ($(HB_INIT_DONE),) - PKG_DIR := $(TOP)$(ROOT)pkg - export HB_PKGBASE := $(subst /,$(DIRSEP),$(PKG_DIR)/$(HB_ARCHITECTURE)/$(HB_COMPILER)) - export HB_PKGPATH := $(subst /,$(DIRSEP),$(abspath $(PKG_DIR)/$(HB_PKGNAME))) - HB_INSTALL_PREFIX := $(subst /,$(DIRSEP),$(abspath $(HB_PKGBASE)/$(HB_PKGNAME))) - PKG_DIR := $(subst /,$(DIRSEP),$(PKG_DIR)) + export HB_TOP := $(subst /,$(DIRSEP),$(abspath $(TOP)$(ROOT))) + HB_INSTALL_PREFIX := $(subst /,$(DIRSEP),$(abspath $(PKG_DIR)/$(HB_PKGNAME))) HB_BIN_INSTALL := HB_INC_INSTALL := diff --git a/harbour/config/instsh.cf b/harbour/config/instsh.cf index e377bc1e8e..1ce2102ff9 100644 --- a/harbour/config/instsh.cf +++ b/harbour/config/instsh.cf @@ -57,7 +57,7 @@ ifeq ($(HB_SHELL),os2) # I don't like doing the "if not exist..." test for every file copied # but I could not find any other way to make this work around the shell # command line length limit. - # 'dos' method doesn't seem to work for some reason [vszakats] + # 'dos' method causes freeze on OS/2 (with or without COMPSPEC). [vszakats] # $(COMSPEC) /C is needed to overcome freezes. [vszakats] # NOTE: The empty line directly before 'endef' HAVE TO exist! diff --git a/harbour/package/mpkg_win.nsi b/harbour/package/mpkg_win.nsi index cb1864c25c..087d93c570 100644 --- a/harbour/package/mpkg_win.nsi +++ b/harbour/package/mpkg_win.nsi @@ -30,7 +30,7 @@ CRCCheck on Name "Harbour Project" ; The file to write -OutFile "$%HB_PKGPATH%.exe" +OutFile "$%HB_TOP%\$%HB_PKGNAME%.exe" InstallDir C:\$%HB_PKGNAMI%