Skip to content

Commit

Permalink
Major restructuring to shift focus to windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
citypilgrim committed Mar 26, 2022
1 parent 73dd489 commit 3c65704
Show file tree
Hide file tree
Showing 36 changed files with 74 additions and 58 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.emacs.d
.ssh
Git
.gitconfig
Keytweak.exe
27.2
.gitconfig*
.git*
.authinfo
.gnupg/
6 changes: 0 additions & 6 deletions Emacs 27.2 nodeps.bat

This file was deleted.

41 changes: 31 additions & 10 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
#+TITLE: Portable Emacs

Simple structure with scripts for incoporating a portable version of emacs
Simple structure with scripts to make emacs portable for Windows

* Requirements
1. place emacs configurations in =~/.emacs.d=, make sure that any paths within configs must be relative from =HOME=
2. Relevant SSH keys, stored in =~/.ssh=
3. Git portable installed in =~/executables/Git=, with global configs configured in
* Structure
The repo contains the following structure:
#+begin_src
.
|
+-build
| +-<emacs versions for diff OS>
| +-Emacs; emacs build
| +-cache; cache built by emacs
+-cots
| +-Git; portable
| | +-<git for different OS>
| +-KeyTweak.exe; for windows
+-resource
+-src
+-.ssh
+-.emacs.d
+-main.sh; script to prompt emacs version to run
+-main.bat;

#+end_src

* Requirements
1. Download
2. place emacs configurations in =~/.emacs.d=, make sure that any paths within configs must be relative from =HOME=
3. Relevant SSH keys, stored in =~/.ssh=
4. Git portable installed in =~/cots/Git=, with global configs configured in
5. msys64 installed in system, configured to the appropriate path i =~/.emacs.d/per-system/per-system-settings.el=
* Usage
1. Place portable emacs version within a folder titled =~/<version number>/Emacs=
2. Write a =~/Emacs <version number> [nodeps].bat= script, change the =emacs_version= parameter to the appropriate version
3. Double-click on bat file to run

* Optional
3. First run the =build_emacs.bat= script to build the ~org-roam~ sqlite database
4. Double-click on bat file to run
* Notes
- Keytweak.exe for changing CAPS into CTRL
- In order to be able to use org-roam, install =~/executables/msys64=.
Note: msys has to be in the path before git and system32. This can be switched after installation. In particular when install python lsp server, it would require git to be before msys. When running the build script for the first time use the =~/Build Emacs nodeps.bat=
25 changes: 21 additions & 4 deletions add_shortcuts.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,37 @@

set HOME=%~dp0

set icon=%HOME%27.2\Emacs\share\emacs\27.2\etc\images\icons\hicolor\scalable\apps\emacs.ico
set bat=Emacs 27.2 nodeps
set icon=%HOME%build\27.2\Emacs\share\emacs\27.2\etc\images\icons\hicolor\scalable\apps\emacs.ico
set bat=Emacs 27.2
set src=%HOME%%bat%.bat
set dst=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Emacs\%bat%.lnk
for %%a in ("%dst%") do set "dstpar=%%~dpa"
if not exist "%dstpar%" mkdir "%dstpar%"
@call %HOME%src\common\create_shortcut "%src%" "%dst%" "%icon%"

set icon=%HOME%28.0.50-snapshot-2021-01-15\Emacs\share\icons\hicolor\scalable\apps\emacs.ico
set bat=Emacs 28.0.50-snapshot-2021-01-15 nodeps
set icon=%HOME%build\28.0.50-snapshot-2021-01-15\Emacs\share\icons\hicolor\scalable\apps\emacs.ico
set bat=Emacs 28.0.50-snapshot-2021-01-15
set src=%HOME%%bat%.bat
set dst=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Emacs\%bat%.lnk
for %%a in ("%dst%") do set "dstpar=%%~dpa"
if not exist "%dstpar%" mkdir "%dstpar%"
@call %HOME%src\common\create_shortcut "%src%" "%dst%" "%icon%"

set icon=%HOME%build\28.0.91-snapshot-2022-02-12\Emacs\share\icons\hicolor\scalable\apps\emacs.ico
set bat=Emacs 28.0.91-snapshot-2022-02-12
set src=%HOME%%bat%.bat
set dst=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Emacs\%bat%.lnk
for %%a in ("%dst%") do set "dstpar=%%~dpa"
if not exist "%dstpar%" mkdir "%dstpar%"
@call %HOME%src\common\create_shortcut "%src%" "%dst%" "%icon%"

set icon=%HOME%build\emacs-28.0.92\Emacs\share\icons\hicolor\scalable\apps\emacs.ico
set bat=emacs-28.0.92
set src=%HOME%%bat%.bat
set dst=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Emacs\%bat%.lnk
for %%a in ("%dst%") do set "dstpar=%%~dpa"
if not exist "%dstpar%" mkdir "%dstpar%"
@call %HOME%src\common\create_shortcut "%src%" "%dst%" "%icon%"


pause
2 changes: 2 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 1 addition & 1 deletion Build Emacs nodeps.bat → build_emacs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set /p emacs_version=Enter Emacs version:

set src_dir=%~dp0src
@call "%src_dir%"\buildemacs_nodeps.bat %emacs_version%
@call "%src_dir%"\buildemacs.bat %emacs_version%
2 changes: 2 additions & 0 deletions cots/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 1 addition & 4 deletions src/buildemacs_nodeps.bat → src/buildemacs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ rem Setting env variables
set HOME=%~dp0..\
@call "%HOME%src\common\set_path_for_build"

rem Temporarily installing dependencies
@call "%HOME%src\temp_install_deps"

rem Running emacs
start "" "%HOME%%emacs_version%\Emacs\bin\runemacs.exe" --debug-init
start "" "%HOME%build\%emacs_version%\Emacs\bin\runemacs.exe"
6 changes: 4 additions & 2 deletions src/common/set_path.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

set PATH=
set PATH=%PATH%;C:\Program Files\Common Files\Oracle\Java\javapath
set PATH=%PATH%;%HOME%executables\Git\cmd
set PATH=%PATH%;%HOME%executables\Git\usr\bin
set PATH=%PATH%;%HOME%cots\Git\cmd
set PATH=%PATH%;%HOME%cots\Git\usr\bin
set PATH=%PATH%;C:\msys64\usr\bin
set PATH=%PATH%;C:\msys64\mingw64\bin
set PATH=%PATH%;%SystemRoot%\System32
set PATH=%PATH%;%SystemRoot%
set PATH=%PATH%;%SystemRoot%\System32\Wbem
set PATH=%PATH%;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
set PATH=%PATH%;%SYSTEMROOT%\System32\OpenSSH\
set PATH=%PATH%;%PROGRAMFILES%\Crosswire\xiphos\bin
5 changes: 3 additions & 2 deletions src/common/set_path_for_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
set PATH=
set PATH=%PATH%;C:\Program Files\Common Files\Oracle\Java\javapath
set PATH=%PATH%;C:\msys64\usr\bin
set PATH=%PATH%;%HOME%executables\Git\cmd
set PATH=%PATH%;%HOME%executables\Git\usr\bin
set PATH=%PATH%;C:\msys64\mingw64\bin
set PATH=%PATH%;%HOME%cots\Git\cmd
set PATH=%PATH%;%HOME%cots\Git\usr\bin
set PATH=%PATH%;%SystemRoot%\System32
set PATH=%PATH%;%SystemRoot%
set PATH=%PATH%;%SystemRoot%\System32\Wbem
Expand Down
2 changes: 1 addition & 1 deletion src/deps/install_fonts.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off

set font_dir=%~dpdpdp0resources\fonts
set font_dir=%~dpdpdp0resource\fonts
for /F "delims=;" %%a in ('dir %font_dir% /B /A-D-H-S /S') do (
copy "%%a" "%WINDIR%\Fonts"
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "FontName (TrueType)" /t REG_SZ /d %%~nxa /f
Expand Down
4 changes: 0 additions & 4 deletions src/deps/temp_install_fonts.bat

This file was deleted.

5 changes: 4 additions & 1 deletion src/runemacs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
set emacs_version=%1
set emacs_version=%emacs_version:"=%

set HOME=%~dp0..\

rem Setting env variables
@call "%HOME%src\common\set_path"


rem Running emacs
start "" "%HOME%%emacs_version%\Emacs\bin\runemacs.exe" --debug-init
start "" "%HOME%build\%emacs_version%\Emacs\bin\runemacs.exe" --debug-init
13 changes: 0 additions & 13 deletions src/runemacs_nodeps.bat

This file was deleted.

6 changes: 0 additions & 6 deletions src/temp_install_no_deps.bat

This file was deleted.

0 comments on commit 3c65704

Please sign in to comment.