-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
4 changed files
with
44 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# download, build, install nano text editor | ||
# requires Autotools and GNU Make | ||
|
||
cmake_minimum_required(VERSION 3.19) | ||
|
||
set(CMAKE_EXECUTE_PROCESS_COMMAND_ECHO STDOUT) | ||
|
||
file(READ ${CMAKE_CURRENT_LIST_DIR}/scripts/versions.json _j) | ||
string(JSON version GET ${_j} "nano") | ||
|
||
set(stem nano-${version}) | ||
set(prefix "~/${stem}") | ||
get_filename_component(prefix ${prefix} ABSOLUTE) | ||
|
||
option(CMAKE_TLS_VERIFY "verify certificates" true) | ||
|
||
execute_process(COMMAND mktemp -d OUTPUT_VARIABLE bindir OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
|
||
set(name ${stem}.tar.xz) | ||
set(url https://nano-editor.org/dist/latest/${name}) | ||
set(archive ${bindir}/${name}) | ||
|
||
if(NOT EXISTS ${archive}) | ||
message(STATUS "${url} => ${archive}") | ||
file(DOWNLOAD ${url} ${archive} INACTIVITY_TIMEOUT 60) | ||
file(ARCHIVE_EXTRACT INPUT ${archive} DESTINATION ${bindir}) | ||
endif() | ||
|
||
set(src ${bindir}/${stem}) | ||
|
||
execute_process(COMMAND ${src}/configure --prefix ${prefix} | ||
WORKING_DIRECTORY ${src} | ||
COMMAND_ERROR_IS_FATAL ANY | ||
) | ||
# need WORKING_DIRECTORY to generate Makefile appropriately | ||
|
||
execute_process(COMMAND make -j -C ${src} COMMAND_ERROR_IS_FATAL ANY) | ||
|
||
execute_process(COMMAND make -j -C ${src} install COMMAND_ERROR_IS_FATAL ANY) | ||
|
||
message(STATUS "Please add ${prefix}/bin to environment variable PATH") |
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
File renamed without changes.
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 |
---|---|---|
|
@@ -28,5 +28,6 @@ | |
"3.1": "3.1.3" | ||
}, | ||
"ninja": "1.11.1", | ||
"zstd": "1.5.2" | ||
"nano": "7.2", | ||
"zstd": "1.5.5" | ||
} |