summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2017-03-13 10:57:40 +0800
committerruki <[email protected]>2017-03-13 10:57:40 +0800
commit0a931dee6044337a08fc641872ef8c69564808bc (patch)
tree084e4178bb7b9018f2e9dd2dbfd98213802a1fba /scripts
parentae00877f6648cdaf84df9ed01d0f3f3b0bd68f53 (diff)
move package configs to scripts
Diffstat (limited to 'scripts')
-rw-r--r--scripts/PKGBUILD33
-rw-r--r--scripts/installer.nsi128
2 files changed, 161 insertions, 0 deletions
diff --git a/scripts/PKGBUILD b/scripts/PKGBUILD
new file mode 100644
index 000000000..df6352c01
--- /dev/null
+++ b/scripts/PKGBUILD
@@ -0,0 +1,33 @@
+# Maintainer: <[email protected]>
+# PKGBuild Create By: lumpyzhu <[email protected]>
+
+pkgname=xmake
+pkgver=2.1.1
+pkgrel=1
+pkgdesc="A make-like build utility based on Lua"
+arch=('i686' 'x86_64')
+url="https://github.com/tboox/xmake"
+license=('Apache')
+makedepends=()
+source=("$pkgname.zip::https://github.com/tboox/xmake/archive/v${pkgver}.zip")
+md5sums=('fca9f41c64c1bb0838d399aad0ac3a2a')
+
+build() {
+ cd "$srcdir/${pkgname}-${pkgver}"
+ cd ./core
+ make f DEBUG=n
+ make r
+}
+
+package() {
+ cd "$srcdir/${pkgname}-${pkgver}"
+ mkdir -p "${pkgdir}/usr/local/share"
+ mkdir -p "${pkgdir}/usr/local/bin"
+ cp -vr "./xmake" "${pkgdir}/usr/local/share/"
+ install -Dvm755 `find ./core/bin/demo.pkg/bin/linux/ -name "demo.b"` "${pkgdir}/usr/local/share/xmake/xmake"
+ echo "#/!bin/bash
+export XMAKE_PROGRAM_DIR=/usr/local/share/xmake
+/usr/local/share/xmake/xmake \"\$@\"
+" > ./xmake.sh
+ install "./xmake.sh" "${pkgdir}/usr/local/bin/xmake"
+}
diff --git a/scripts/installer.nsi b/scripts/installer.nsi
new file mode 100644
index 000000000..f49579093
--- /dev/null
+++ b/scripts/installer.nsi
@@ -0,0 +1,128 @@
+; xmake.nsi
+;
+; This script is perhaps one of the simplest NSIs you can make. All of the
+; optional settings are left to their default settings. The installer simply
+; prompts the user asking them where to install, and drops a copy of xmake.nsi
+; there.
+
+;--------------------------------
+; includes
+!include "MUI2.nsh"
+!include "WordFunc.nsh"
+!include "WinMessages.nsh"
+
+;--------------------------------
+
+; The name of the installer
+Name "xmake"
+
+; The file to write
+OutFile "xmake.exe"
+
+; The default installation directory
+InstallDir $PROGRAMFILES\xmake
+
+; Request application privileges for Windows Vista
+RequestExecutionLevel admin
+
+;--------------------------------
+; Interface Settings
+
+!define MUI_ABORTWARNING
+
+;--------------------------------
+; Pages
+
+!insertmacro MUI_PAGE_LICENSE "..\LICENSE.md"
+!insertmacro MUI_PAGE_COMPONENTS
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+;--------------------------------
+; Languages
+
+!insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+; Version Information
+
+VIProductVersion "2.1.2.0304"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "XMake"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "website: http://www.xmake.io"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The TBOOX Open Source Group"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright 2015-2017 tboox.org"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "The Make-like Build Utility based on Lua"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "2.1.2"
+
+;--------------------------------
+
+; Installer
+Section "xmake (required)" Installer
+
+ SectionIn RO
+
+ ; Set output path to the installation directory.
+ SetOutPath $INSTDIR
+
+ ; Put file there
+ File /r /x ".DS_Store" "..\xmake\*.*"
+ File "..\*.md"
+ File "..\core\build\demo.exe"
+
+ ; Rename file
+ Rename "$INSTDIR\demo.exe" "$INSTDIR\xmake.exe"
+
+ ; Write the installation path into the registry
+ WriteRegStr HKLM SOFTWARE\NSIS_xmake "Install_Dir" "$INSTDIR"
+
+ ; Write the uninstall keys for Windows
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\xmake" "DisplayName" "NSIS xmake"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\xmake" "UninstallString" '"$INSTDIR\uninstall.exe"'
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\xmake" "NoModify" 1
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\xmake" "NoRepair" 1
+ WriteUninstaller "uninstall.exe"
+
+ ; Remove the installation path from the $PATH environment variable first
+ ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
+ ${WordReplace} $R0 ";$INSTDIR" "" "+" $R1
+
+ ; Write the installation path into the $PATH environment variable
+ WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R1;$INSTDIR"
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment"
+
+SectionEnd
+
+;--------------------------------
+; Descriptions
+
+; Language strings
+LangString DESC_Installer ${LANG_ENGLISH} "The Make-like Build Utility based on Lua"
+
+; Assign language strings to sections
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+!insertmacro MUI_DESCRIPTION_TEXT ${Installer} $(DESC_Installer)
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+;--------------------------------
+
+; Uninstaller
+
+Section "Uninstall"
+
+ ; Remove registry keys
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\xmake"
+ DeleteRegKey HKLM SOFTWARE\NSIS_xmake
+
+ ; Remove directories used
+ RMDir /r "$INSTDIR"
+
+ ; Remove the installation path from the $PATH environment variable
+ ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
+ ${WordReplace} $R0 ";$INSTDIR" "" "+" $R1
+ ; MessageBox MB_OK|MB_USERICON '$R0 - $INSTDIR - $R1 '
+ WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R1"
+
+SectionEnd