Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
152 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
if(APPLE) | ||
add_subdirectory(mac) | ||
elseif(WIN32) | ||
add_subdirectory(windows) | ||
endif() | ||
|
||
# NB freebsd currently OK to ride on linux for this subdir. eventually may need separating. | ||
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") | ||
add_subdirectory(linux) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
install(FILES ${CMAKE_SOURCE_DIR}/COPYING DESTINATION SuperCollider) | ||
|
||
# Add a target that invokes a cmake script that: | ||
# -- invokes fixup_bundle to copy dependencies over | ||
# -- invokes a custom NSIS script, because CPack would | ||
# not create a suitable installer for sced | ||
|
||
add_custom_target( package | ||
COMMAND cmake | ||
"-DSC_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" | ||
"-DSC_WIN_DEP_DIRS=${SC_WIN_DEP_DIRS}" | ||
"-DSC_ED=${SC_ED}" | ||
"-DNSIS_SCRIPT=${CMAKE_CURRENT_SOURCE_DIR}/supercollider.nsi" | ||
-P "${CMAKE_CURRENT_SOURCE_DIR}/package.cmake" | ||
COMMENT "Building the installer:" | ||
VERBATIM | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
file(TO_NATIVE_PATH ${SC_INSTALL_PREFIX} NATIVE_INSTALL_PREFIX) | ||
|
||
if(SC_ED) | ||
set(DEFINE_SC_ED "/DSC_ED") | ||
endif() | ||
|
||
include(BundleUtilities) | ||
fixup_bundle( | ||
"${SC_INSTALL_PREFIX}/SuperCollider/sclang.exe" | ||
"" | ||
"${SC_WIN_DEP_DIRS}" | ||
) | ||
|
||
execute_process( COMMAND makensis | ||
/DSC_SRC_DIR="${NATIVE_INSTALL_PREFIX}" | ||
# FIXME: Does not support spaces in path: | ||
/DSC_DST_DIR=${NATIVE_INSTALL_PREFIX} | ||
${DEFINE_SC_ED} | ||
${NSIS_SCRIPT} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
!cd ${SC_SRC_DIR} | ||
|
||
!include "Sections.nsh" | ||
!include "FileFunc.nsh" | ||
!include "WordFunc.nsh" | ||
!include "MUI2.nsh" | ||
!insertmacro MUI_LANGUAGE "English" | ||
|
||
!define VERSION "3.5-rc1" | ||
Name "SuperCollider ${VERSION}" | ||
OutFile ${SC_DST_DIR}\SuperCollider-${VERSION}-win32.exe | ||
InstallDir $PROGRAMFILES\SuperCollider-${VERSION} | ||
|
||
!ifdef SC_ED | ||
Var GEDIT_DIR | ||
!endif | ||
|
||
; --- PAGES --- | ||
|
||
!define MUI_PAGE_HEADER_TEXT "License" | ||
!define MUI_LICENSEPAGE_TEXT_TOP "Please review the license below." | ||
!define MUI_LICENSEPAGE_TEXT_BOTTOM \ | ||
"By installing this software you implicitely agree with this license." | ||
!insertmacro MUI_PAGE_LICENSE SuperCollider\COPYING | ||
|
||
!define MUI_PAGE_HEADER_TEXT "Installation components" | ||
!insertmacro MUI_PAGE_COMPONENTS | ||
|
||
!define MUI_PAGE_HEADER_TEXT "Installation Folder" | ||
!insertmacro MUI_PAGE_DIRECTORY | ||
|
||
!ifdef SC_ED | ||
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Gedit Folder" | ||
!define MUI_DIRECTORYPAGE_VARIABLE $GEDIT_DIR | ||
!define MUI_PAGE_HEADER_TEXT "Gedit Folder" | ||
!define MUI_PAGE_CUSTOMFUNCTION_PRE skipIfNoSced | ||
!define MUI_DIRECTORYPAGE_TEXT_TOP \ | ||
"Setup will install Sced - a plugin for gedit text editor \ | ||
that allows you to interact with SuperCollider from within the editor, \ | ||
and adds syntax highlighting for SuperCollider code.$\n$\n\ | ||
Please select a folder where gedit is installed:" | ||
!insertmacro MUI_PAGE_DIRECTORY | ||
!endif | ||
|
||
!insertmacro MUI_PAGE_INSTFILES | ||
|
||
; --- SECTIONS --- | ||
|
||
Section "Core" core_sect | ||
SetOutPath $INSTDIR | ||
File /r SuperCollider\* | ||
SectionEnd | ||
|
||
!ifdef SC_ED | ||
Section "Sced (gedit integration)" sced_sect | ||
SetOutPath $GEDIT_DIR | ||
File /r gedit\* | ||
FileOpen $0 $APPDATA\sced.config.json w | ||
IfErrors done | ||
${WordReplace} $INSTDIR "\" "\\" "+" $1 | ||
FileWrite $0 "{$\"supercollider-dir$\": $\"$1$\"}" | ||
FileClose $0 | ||
done: | ||
SectionEnd | ||
!endif | ||
|
||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN | ||
!insertmacro MUI_DESCRIPTION_TEXT ${core_sect} \ | ||
"Language interpreter and sound synthesis server. Command-line only." | ||
!ifdef SC_ED | ||
!insertmacro MUI_DESCRIPTION_TEXT ${sced_sect} \ | ||
"Integration with gedit text editor.$\n$\n\ | ||
You need to have gedit installed." | ||
!endif | ||
!insertmacro MUI_FUNCTION_DESCRIPTION_END | ||
|
||
; --- FUNCTIONS --- | ||
|
||
Function .onInit | ||
IntOp $0 ${SF_SELECTED} | ${SF_RO} | ||
SectionSetFlags ${core_sect} $0 | ||
FunctionEnd | ||
|
||
!ifdef SC_ED | ||
Function skipIfNoSced | ||
SectionGetFlags ${sced_sect} $0 | ||
IntOp $0 $0 & ${SF_SELECTED} | ||
IntCmp $0 0 is0 ok ok | ||
is0: | ||
Abort | ||
ok: | ||
${Locate} $PROGRAMFILES32 "/G=0 /L=D /M=gedit*" geditFound | ||
StrCmp $GEDIT_DIR "" 0 done | ||
${Locate} $PROGRAMFILES64 "/G=0 /L=D /M=gedit*" geditFound | ||
done: | ||
FunctionEnd | ||
|
||
Function geditFound | ||
StrCpy $GEDIT_DIR $R9 | ||
Push "StopLocate" | ||
FunctionEnd | ||
!endif |