emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 1d8f885: Add support for Windows installer build


From: Phillip Lord
Subject: [Emacs-diffs] master 1d8f885: Add support for Windows installer build
Date: Sun, 5 Nov 2017 10:54:55 -0500 (EST)

branch: master
commit 1d8f8851a414fb75e05a048559c03e02c0df1c42
Author: Phillip Lord <address@hidden>
Commit: Phillip Lord <address@hidden>

    Add support for Windows installer build
    
     * etc/images/slash.bmp,admin/nt/dist-build/emacs.nsi: New files
     * admin/nt/dist-build/build-zips.sh: Support building installer
---
 admin/nt/dist-build/build-zips.sh |  54 +++++++++++++++++++++++------
 admin/nt/dist-build/emacs.nsi     |  71 ++++++++++++++++++++++++++++++++++++++
 etc/images/splash.bmp             | Bin 0 -> 310494 bytes
 3 files changed, 114 insertions(+), 11 deletions(-)

diff --git a/admin/nt/dist-build/build-zips.sh 
b/admin/nt/dist-build/build-zips.sh
index fb44c31..138ef4d 100755
--- a/admin/nt/dist-build/build-zips.sh
+++ b/admin/nt/dist-build/build-zips.sh
@@ -22,11 +22,10 @@ function git_up {
     echo Making git worktree for Emacs $VERSION
     cd $HOME/emacs-build/git/emacs-$MAJOR_VERSION
     git pull
-    git worktree add ../emacs-$BRANCH emacs-$BRANCH
+    git worktree add ../$BRANCH $BRANCH
 
-    cd ../emacs-$BRANCH
+    cd ../$BRANCH
     ./autogen.sh
-
 }
 
 function build_zip {
@@ -42,15 +41,18 @@ function build_zip {
         MSYSTEM=MINGW32
     fi
 
+    ## Clean the install location because we use it twice
+    rm -rf $HOME/emacs-build/install/emacs-$VERSION/$ARCH
     mkdir --parents $HOME/emacs-build/build/emacs-$VERSION/$ARCH
     cd $HOME/emacs-build/build/emacs-$VERSION/$ARCH
 
     export PKG_CONFIG_PATH=$PKG
-    ../../../git/emacs-$BRANCH/configure \
+    ../../../git/$BRANCH/configure \
         --without-dbus \
         --host=$HOST --without-compress-install \
+        $CACHE \
         CFLAGS="-O2 -static -g3"
-    make -j 8 install \
+    make -j 16 install \
          prefix=$HOME/emacs-build/install/emacs-$VERSION/$ARCH
     cd $HOME/emacs-build/install/emacs-$VERSION/$ARCH
     cp $HOME/emacs-build/deps/libXpm/$ARCH/libXpm-noX4.dll bin
@@ -62,17 +64,28 @@ function build_zip {
     mv emacs-$VERSION-$ARCH.zip ~/emacs-upload
 }
 
+function build_installer {
+    ARCH=$1
+    cd $HOME/emacs-build/install/emacs-$VERSION
+    echo Calling makensis in `pwd`
+    cp ../../git/$BRANCH/admin/nt/dist-build/emacs.nsi .
+    makensis -DARCH=$ARCH -DEMACS_VERSION=$ACTUAL_VERSION \
+             -DOUT_VERSION=$VERSION emacs.nsi
+    rm emacs.nsi
+    mv Emacs-$ARCH-$VERSION-installer.exe ~/emacs-upload
+}
 
-##set -o xtrace
 set -o errexit
 
 SNAPSHOT=
+CACHE=
 
+BUILD=1
 BUILD_32=1
 BUILD_64=1
 GIT_UP=0
 
-while getopts "36ghsV:" opt; do
+while getopts "36ghsiV:" opt; do
   case $opt in
     3)
         BUILD_32=1
@@ -90,6 +103,9 @@ while getopts "36ghsV:" opt; do
         BUILD_64=0
         GIT_UP=1
         ;;
+    i)
+        BUILD=1
+        ;;
     V)
         VERSION=$OPTARG
         ;;
@@ -111,7 +127,6 @@ done
 
 if [ -z $VERSION ];
 then
-    echo "doing version thing"
     VERSION=`
   sed -n 's/^AC_INIT(GNU Emacs,[        ]*\([^  ,)]*\).*/\1/p' < 
../../../configure.ac
 `
@@ -124,7 +139,16 @@ then
 fi
 
 MAJOR_VERSION="$(echo $VERSION | cut -d'.' -f1)"
-BRANCH=$VERSION
+
+if [ -z $SNAPSHOT ];
+then
+    BRANCH=emacs-$VERSION
+else
+    BRANCH=master
+    CACHE=-C
+fi
+
+ACTUAL_VERSION=$VERSION
 VERSION=$VERSION$SNAPSHOT
 
 if (($GIT_UP))
@@ -134,12 +158,20 @@ fi
 
 if (($BUILD_64))
 then
-    build_zip x86_64 /mingw64/lib/pkgconfig x86_64-w64-mingw32
+    if (($BUILD))
+    then
+        build_zip x86_64 /mingw64/lib/pkgconfig x86_64-w64-mingw32
+    fi
+    build_installer x86_64
 fi
 
 ## Do the 64 bit build first, because we reset some environment
 ## variables during the 32 bit which will break the build.
 if (($BUILD_32))
 then
-    build_zip i686 /mingw32/lib/pkgconfig i686-w64-mingw32
+    if (($BUILD))
+    then
+        build_zip i686 /mingw32/lib/pkgconfig i686-w64-mingw32
+    fi
+    build_installer i686
 fi
diff --git a/admin/nt/dist-build/emacs.nsi b/admin/nt/dist-build/emacs.nsi
new file mode 100644
index 0000000..947ac9a
--- /dev/null
+++ b/admin/nt/dist-build/emacs.nsi
@@ -0,0 +1,71 @@
+!include MUI2.nsh
+
+
+Outfile "Emacs-${ARCH}-${OUT_VERSION}-installer.exe"
+
+
+
+InstallDir "$DESKTOP\Emacs-${EMACS_VERSION}"
+SetCompressor /solid lzma
+
+
+Var StartMenuFolder
+
+
+!define MUI_WELCOMEPAGE_TITLE "Emacs"
+!define MUI_WELCOMEPAGE_TITLE_3LINES
+!define MUI_WELCOMEPAGE_TEXT "Welcome to Emacs -- the editor of a lifetime."
+
+!define MUI_WELCOMEFINISHPAGE_BITMAP 
"${ARCH}\share\emacs\${EMACS_VERSION}\etc\images\splash.bmp"
+
+!insertmacro MUI_PAGE_WELCOME
+
+
+!define MUI_LICENSEPAGE_TEXT_TOP "The GNU General Public License"
+!insertmacro MUI_PAGE_LICENSE 
"${ARCH}\share\emacs\${EMACS_VERSION}\lisp\COPYING"
+
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
+
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE "English"
+Name Emacs-${EMACS_VERSION}
+
+Section
+
+  SetOutPath $INSTDIR
+
+  File /r ${ARCH}
+  # define uninstaller name
+  WriteUninstaller $INSTDIR\Uninstall.exe
+
+  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+  ;Create shortcuts
+  CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
+  CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" 
"$INSTDIR\Uninstall.exe"
+
+  !insertmacro MUI_STARTMENU_WRITE_END
+  CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Emacs.lnk" 
"$INSTDIR\${ARCH}\bin\runemacs.exe"
+SectionEnd
+
+
+# create a section to define what the uninstaller does.
+# the section will always be named "Uninstall"
+Section "Uninstall"
+
+  # Always delete uninstaller first
+  Delete "$INSTDIR\Uninstall.exe"
+
+  # now delete installed directory
+  RMDir /r "$INSTDIR\${ARCH}"
+  RMDir "$INSTDIR"
+
+  !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
+
+  Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
+  RMDir "$SMPROGRAMS\$StartMenuFolder"
+SectionEnd
diff --git a/etc/images/splash.bmp b/etc/images/splash.bmp
new file mode 100644
index 0000000..1e83326
Binary files /dev/null and b/etc/images/splash.bmp differ



reply via email to

[Prev in Thread] Current Thread [Next in Thread]