mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-22 22:00:49 +00:00
Backports from trunk
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/branches/stable@25810 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e9d2c268bc
commit
10db7fd80a
4 changed files with 282 additions and 0 deletions
158
Master/nsis.make
Normal file
158
Master/nsis.make
Normal file
|
@ -0,0 +1,158 @@
|
|||
#
|
||||
# nsis.make
|
||||
#
|
||||
# Makefile rules to build a NSIS installer
|
||||
#
|
||||
# Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# Author: Adam Fedor <fedor@gnu.org>
|
||||
#
|
||||
# This file is part of the GNUstep Makefile Package.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 3
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this library; see the file COPYING.
|
||||
# If not, write to the Free Software Foundation,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# BUGS: Currently only works for applications
|
||||
# Pathnames only work with the GUI NSIS installer (not on msys at least)
|
||||
#
|
||||
# make nsifile will build the nsi installer script
|
||||
# make nsis will compile it, assuming there is a suitable
|
||||
# nsis compiler availabe.
|
||||
|
||||
# [1] Add - after common.make - the following lines in your GNUmakefile:
|
||||
#
|
||||
# PACKAGE_NAME = Gomoku
|
||||
# PACKAGE_VERSION = 1.1.1
|
||||
#
|
||||
# The other important variable you may want to set in your makefiles is
|
||||
#
|
||||
# GNUSTEP_INSTALLATION_DOMAIN - Installation domain (defaults to LOCAL)
|
||||
#
|
||||
# [2] Provide a $(PACKAGE_NAME).nsi.in file, which contains the NSIS
|
||||
# installer template. An example is in the gnustep-make package - which
|
||||
# will be used if you don't provide your own template
|
||||
#
|
||||
# You can use the following if you need:
|
||||
# @gs_name@ expands to the value of the make variable PACKAGE_NAME
|
||||
# @gs_version@ expands to the value of the make variable PACKAGE_VERSION
|
||||
#
|
||||
# A special note: if you need `./configure' to be run before
|
||||
# compilation (usually only needed for GNUstep core libraries
|
||||
# themselves), define the following make variable:
|
||||
#
|
||||
# PACKAGE_NEEDS_CONFIGURE = YES
|
||||
#
|
||||
# in your makefile.
|
||||
MAKENSIS=makensis
|
||||
|
||||
# the GNUstep Windows Installer always puts things in, e.g. /GNUstep/System,
|
||||
# so we need to match these regardless of the local filesystem layout
|
||||
# Hackish way to get the installation dir/domain
|
||||
NSI_DOMAIN=System
|
||||
ifeq ($(GNUSTEP_INSTALLATION_DOMAIN), LOCAL)
|
||||
NSI_DOMAIN=Local
|
||||
endif
|
||||
# FIXME: What should this be on Windows?
|
||||
ifeq ($(GNUSTEP_INSTALLATION_DOMAIN), USER)
|
||||
NSI_DOMAIN=Local
|
||||
endif
|
||||
NSI_BASE=$(dir $(GNUSTEP_APPS))
|
||||
|
||||
ABS_OBJ_DIR=$(shell (cd "$(GNUSTEP_BUILD_DIR)"; pwd))/obj
|
||||
GNUSTEP_FILE_LIST = $(ABS_OBJ_DIR)/package/file-list
|
||||
GNUSTEP_DELETE_LIST = $(ABS_OBJ_DIR)/package/delete-list
|
||||
GNUSTEP_RMDIR_LIST = $(ABS_OBJ_DIR)/package/rmdir-list
|
||||
REL_INSTALL_DIR=$(GNUSTEP_OBJ_DIR)/package/$(NSI_BASE)
|
||||
|
||||
NSI_FILE_NAME=$(PACKAGE_NAME).nsi
|
||||
NSI_FILE=$(NSI_FILE_NAME)
|
||||
ifneq ($(APP_NAME),)
|
||||
NSI_TEMPLATE=$(GNUSTEP_MAKEFILES)/nsi-app.template
|
||||
else
|
||||
NSI_TEMPLATE=
|
||||
endif
|
||||
NSI_IN=$(PACKAGE_NAME).nsi.in
|
||||
|
||||
.PHONY: nsifile nsis nsis_package_install nsis_build_filelist
|
||||
|
||||
nsis_package_install:
|
||||
$(ECHO_NOTHING)if [ -d $(ABS_OBJ_DIR)/package ]; then \
|
||||
rm -rf $(ABS_OBJ_DIR)/package; fi;$(END_ECHO)
|
||||
$(ECHO_NOTHING)$(MAKE) DESTDIR=$(ABS_OBJ_DIR)/package nsilist=yes install$(END_ECHO)
|
||||
|
||||
#
|
||||
# Target to build up the file lists
|
||||
#
|
||||
nsis_build_filelist::
|
||||
$(ECHO_NOTHING)rm -f $(GNUSTEP_FILE_LIST)$(END_ECHO)
|
||||
$(ECHO_NOTHING)rm -f $(GNUSTEP_DELETE_LIST)$(END_ECHO)
|
||||
$(ECHO_NOTHING)rm -f $(GNUSTEP_RMDIR_LIST)$(END_ECHO)
|
||||
$(ECHO_NOTHING)cdir="nosuchdirectory"; \
|
||||
for file in `$(TAR) Pcf - $(REL_INSTALL_DIR) | $(TAR) t`; do \
|
||||
wfile=`echo $$file | sed "s,$(REL_INSTALL_DIR),," | tr '/' '\'`; \
|
||||
wodir=`echo $(REL_INSTALL_DIR) | tr '/' '\'`; \
|
||||
slashsuffix=`basename $${file}yes`; \
|
||||
if [ "$$slashsuffix" = yes ]; then \
|
||||
newdir=`dirname $$file`/`basename $$file`; \
|
||||
else \
|
||||
newdir=`dirname $$file`; \
|
||||
fi; \
|
||||
if [ "$$file" = "$(REL_INSTALL_DIR)/" ]; then \
|
||||
:; \
|
||||
elif [ -d "$$file" ]; then \
|
||||
cdir=$$newdir; \
|
||||
echo " RMDir \"\$$DOMDIR\\$$wfile\"" >> $(GNUSTEP_RMDIR_LIST); \
|
||||
echo " SetOutPath \"\$$DOMDIR\\$$wfile\"" >> $(GNUSTEP_FILE_LIST); \
|
||||
elif [ $$cdir != $$newdir ]; then \
|
||||
cdir=$$newdir; \
|
||||
wdir=`dirname $$file`; \
|
||||
wdir=`echo $$wdir | sed "s,$(REL_INSTALL_DIR),," | tr '/' '\'`; \
|
||||
echo " SetOutPath \"\$$DOMDIR\\$$wdir\"" >> $(GNUSTEP_FILE_LIST); \
|
||||
echo " File \"$$wodir$$wfile\"" >> $(GNUSTEP_FILE_LIST); \
|
||||
echo " Delete \"\$$DOMDIR\\$$wfile\"" >> $(GNUSTEP_DELETE_LIST); \
|
||||
else \
|
||||
echo " Delete \"\$$DOMDIR\\$$wfile\"" >> $(GNUSTEP_DELETE_LIST); \
|
||||
echo " File \"$$wodir$$wfile\"" >> $(GNUSTEP_FILE_LIST); \
|
||||
fi; \
|
||||
done$(END_ECHO)
|
||||
|
||||
#
|
||||
# The user will type `make nsifile' to generate the nsifile
|
||||
#
|
||||
nsifile: $(NSI_FILE)
|
||||
|
||||
#
|
||||
# This is the real target
|
||||
#
|
||||
$(NSI_FILE): nsis_package_install nsis_build_filelist
|
||||
$(ECHO_NOTHING)echo "Generating the nsi script..."$(END_ECHO)
|
||||
$(ECHO_NOTHING)rm -f $@$(END_ECHO)
|
||||
$(ECHO_NOTHING)rm -f ${GNUSTEP_RMDIR_LIST}.reverse$(END_ECHO)
|
||||
$(ECHO_NOTHING)sed '1!G;h;$$!d' ${GNUSTEP_RMDIR_LIST} > \
|
||||
${GNUSTEP_RMDIR_LIST}.reverse$(END_ECHO)
|
||||
$(ECHO_NOTHING)mv ${GNUSTEP_RMDIR_LIST}.reverse \
|
||||
${GNUSTEP_RMDIR_LIST}$(END_ECHO)
|
||||
$(ECHO_NOTHING)if [ -f $(NSI_IN) ]; then \
|
||||
nsi_infile=${NSI_IN}; \
|
||||
else \
|
||||
nsi_infile=${NSI_TEMPLATE}; fi; \
|
||||
sed -e :t \
|
||||
-e "s,@gs_domain@,$(NSI_DOMAIN),;t t" \
|
||||
-e "s,@gs_name@,$(PACKAGE_NAME),;t t" \
|
||||
-e "s,@gs_version@,$(PACKAGE_VERSION),;t t" \
|
||||
-e "/@file_list@/ r ${GNUSTEP_FILE_LIST}" \
|
||||
-e "/@delete_list@/ r ${GNUSTEP_DELETE_LIST}" \
|
||||
-e "/@rmdir_list@/ r ${GNUSTEP_RMDIR_LIST}" \
|
||||
$$nsi_infile > $@ \
|
||||
$(END_ECHO)
|
||||
|
||||
nsis: nsifile
|
||||
# $(ECHO_NOTHING)echo "Generating the nsis installer..."$(END_ECHO)
|
||||
# ${MAKENSIS} $(NSI_FILE_NAME)
|
3
config-precomp-test/config-precomp-test.h
Normal file
3
config-precomp-test/config-precomp-test.h
Normal file
|
@ -0,0 +1,3 @@
|
|||
@interface TestClass
|
||||
+ (int) test;
|
||||
@end
|
13
config-precomp-test/config-precomp-test.m
Normal file
13
config-precomp-test/config-precomp-test.m
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include "config-precomp-test.h"
|
||||
|
||||
@implementation TestClass
|
||||
+ (int) test
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@end
|
||||
|
||||
int main (void)
|
||||
{
|
||||
return [TestClass test];
|
||||
}
|
108
nsi-app.template
Normal file
108
nsi-app.template
Normal file
|
@ -0,0 +1,108 @@
|
|||
; @gs_name@.app installer script
|
||||
;
|
||||
!define PRODUCT_NAME "@gs_name@"
|
||||
!define PRODUCT_VERSION "@gs_version@"
|
||||
!define PRODUCT_PUBLISHER "GNUstep"
|
||||
!define PRODUCT_WEB_SITE "http://www.gnustep.org"
|
||||
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\GNUstep"
|
||||
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
||||
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
|
||||
|
||||
; MUI 1.67 compatible ------
|
||||
!include "MUI.nsh"
|
||||
|
||||
; MUI Settings
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
|
||||
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
|
||||
|
||||
; Welcome page
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
; Directory page
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
; Start menu page
|
||||
var ICONS_GROUP
|
||||
!define MUI_STARTMENUPAGE_NODISABLE
|
||||
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "GNUstep\Apps"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
|
||||
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
|
||||
; Instfiles page
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
; Finish page
|
||||
!define MUI_FINISHPAGE_RUN_NOTCHECKED
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\GNUstep\@gs_domain@\Applications\${PRODUCT_NAME}.app\${PRODUCT_NAME}.exe"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
; Uninstaller pages
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
; Language files
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
; Reserve files
|
||||
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
||||
|
||||
; MUI end ------
|
||||
|
||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||
OutFile "@gs_name@-${PRODUCT_VERSION}-setup.exe"
|
||||
InstallDir "C:\GNUstep"
|
||||
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
||||
ShowInstDetails show
|
||||
ShowUnInstDetails show
|
||||
Var DOMDIR
|
||||
|
||||
Section "Main" SEC01
|
||||
SetOverwrite try
|
||||
StrCpy $DOMDIR "$INSTDIR\GNUstep\@gs_domain@"
|
||||
;@file_list@
|
||||
SectionEnd
|
||||
|
||||
Section Uninstall
|
||||
StrCpy $DOMDIR "$INSTDIR\GNUstep\@gs_domain@"
|
||||
;@delete_list@
|
||||
;@rmdir_list@
|
||||
|
||||
Delete "$INSTDIR\Uninstall${PRODUCT_NAME}.exe"
|
||||
!insertmacro MUI_STARTMENU_GETFOLDER Application $ICONS_GROUP
|
||||
Delete "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME}.lnk"
|
||||
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall\Uninstall${PRODUCT_NAME}.lnk"
|
||||
RMDir "$SMPROGRAMS\$ICONS_GROUP\Uninstall"
|
||||
RMDir "$SMPROGRAMS\$ICONS_GROUP"
|
||||
|
||||
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
|
||||
SetAutoClose true
|
||||
SectionEnd
|
||||
|
||||
Section -AdditionalIcons
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
|
||||
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Uninstall"
|
||||
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME}.lnk" "$DOMDIR\Applications\${PRODUCT_NAME}.app\${PRODUCT_NAME}.exe"
|
||||
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall\Uninstall${PRODUCT_NAME}.lnk" "$INSTDIR\Uninstall${PRODUCT_NAME}.exe"
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
SectionEnd
|
||||
|
||||
Section -Post
|
||||
WriteUninstaller "$INSTDIR\Uninstall${PRODUCT_NAME}.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\Uninstall${PRODUCT_NAME}.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\m.ico"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
|
||||
SectionEnd
|
||||
|
||||
Function un.onUninstSuccess
|
||||
HideWindow
|
||||
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
|
||||
FunctionEnd
|
||||
|
||||
Function un.onInit
|
||||
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
|
||||
Abort
|
||||
FunctionEnd
|
||||
|
Loading…
Reference in a new issue