Skip to content

Commit 41f3cb4

Browse files
committed
Switch GitLab dktool to GitHub dkcoder
+ Unify various licenses (merge with dksdk-coder project)
1 parent 7f809ca commit 41f3cb4

40 files changed

+609
-117
lines changed

.vscode/settings.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"psi-header.variables": [
9090
[
9191
"project",
92-
"dktool"
92+
"dkcoder"
9393
]
9494
],
9595
"psi-header.templates": [
@@ -109,9 +109,5 @@
109109
]
110110
}
111111
],
112-
"ocaml.sandbox": {
113-
"kind": "opam",
114-
"switch": "Y:\\source\\dksdk-type"
115-
},
116112
"editor.wordWrapColumn": 78
117113
}

COPYRIGHT

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Copyright 2023 Diskuv, Inc.
1+
Copyright 2021 Diskuv, Inc.
22

3-
Licensed under the Open Software License version 3.0
3+
Licensed under the DkSDK SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT

DEVELOPING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ if you rebase and then push.
1010
1111
## Local `user.` prefix
1212

13-
When running dktool scripts inside a git clone of `dktool`, the
13+
When running dkcoder scripts inside a git clone of `dkcoder`, the
1414
commands will be prefixed with `user.`.
1515

16-
For example, run `./dk user.dksdk.cmake.link` within a git clone of 'dktool'
16+
For example, run `./dk user.dksdk.cmake.link` within a git clone of 'dkcoder'
1717
to test it. Then, after your change is committed and push, other projects
1818
will see that command as `./dk dksdk.cmake.link`.

LICENSE-DKSDK

+69
Large diffs are not rendered by default.

LICENSE-LGPL21-ocaml

+203
Large diffs are not rendered by default.

LICENSE-LGPL21-octachron

+203
Large diffs are not rendered by default.

LICENSE LICENSE-OSL3

File renamed without changes.

README.md

+27-6
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ The `./dk` tool is compatible with Windows PowerShell, macOS and desktop Linux.
1313
In Windows PowerShell, macOS and desktop Linux:
1414

1515
```sh
16-
git clone https://gitlab.com/diskuv/dktool.git
17-
dktool/dk user.dkml.wrapper.upgrade HERE
16+
git clone https://github.com/diskuv/dkcoder.git
17+
dkcoder/dk user.dkml.wrapper.upgrade HERE
1818
./dk dkml.wrapper.upgrade DONE
1919
```
2020

2121
In Windows Command Prompt:
2222

2323
```dosbatch
24-
git clone https://gitlab.com/diskuv/dktool.git
25-
dktool\dk user.dkml.wrapper.upgrade HERE
24+
git clone https://github.com/diskuv/dkcoder.git
25+
dkcoder\dk user.dkml.wrapper.upgrade HERE
2626
.\dk dkml.wrapper.upgrade DONE
2727
```
2828

@@ -33,10 +33,31 @@ However, if `sudo` is required for elevation, then commands will be echoed to th
3333

3434
## Licenses
3535

36-
`dktool` is available under the Open Software License version 3.0,
37-
<https://opensource.org/license/osl-3-0-php/>. A guide to the Open Software License version 3.0 is available at
36+
Copyright 2023 Diskuv, Inc.
37+
38+
Full source code and other platforms are available with a
39+
"DkSDK SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT" from
40+
<https://diskuv.com/pricing>, and is free for security engineers,
41+
educators and related-field researchers (ex. programming language theory,
42+
memory and thread modeling) on request.
43+
44+
`DkSDKCoder_Std` documentation and the `./dk`, `./dk.cmd` and `__dk.cmake` build scripts are also
45+
available under the Open Software License version 3.0,
46+
<https://opensource.org/license/osl-3-0-php/>, **at your option**. A guide to the Open Software License version 3.0 is available at
3847
<https://rosenlaw.com/OSL3.0-explained.htm>.
3948

49+
The "DkSDK Coder Runtime Binaries" is the set of `.tar` and `.zip`
50+
archives distributed by Diskuv, Inc. and downloaded by the `./dk`, `./dk.cmd` and `__dk.cmake` build scripts.
51+
DkSDK Coder Runtime Binaries © 2023 by Diskuv, Inc. is
52+
licensed under Attribution-NoDerivatives 4.0 International. To view a copy
53+
of this license, visit <http://creativecommons.org/licenses/by-nd/4.0/>.
54+
55+
The `ocaml*` executables within the DkSDK Coder Runtime Binaries have their own [LPGL2.1 license with Static Linking Exceptions](./LICENSE-LGPL21-ocaml).
56+
The `codept-lib-dkcodersig` executable within the DkSDK Coder Runtime Binaries has a similar [LPGL2.1 license with Static Linking Exceptions](./LICENSE-LGPL21-octachron).
57+
You are free to replace both the `codept-lib-dkcodersig` executable and the `ocaml*` executables with your own compiled binaries.
58+
59+
`DkSDKCoder_Gen` and all other `DkSDKCoder_*` and `DkCoder_*` libraries and executables are licensed under the [DkSDK SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT](./LICENSE-DKSDK).
60+
4061
### 7-Zip
4162

4263
`dk.cmd` downloads parts of the 7-Zip program. 7-Zip is licensed under the GNU LGPL license. The source code for 7-Zip can be found at <www.7-zip.org>. Attribute requirements are available at <https://www.7-zip.org/faq.html>.

__dk.cmake

+40-40
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##########################################################################
2-
# File: dktool/__dk.cmake #
2+
# File: dkcoder/__dk.cmake #
33
# #
44
# Copyright 2023 Diskuv, Inc. #
55
# #
@@ -12,7 +12,7 @@
1212
##########################################################################
1313

1414
# Recommendation: Place this file in source control.
15-
# Auto-generated by `./dk dkml.wrapper.upgrade` of dktool.
15+
# Auto-generated by `./dk dkml.wrapper.upgrade` of dkcoder.
1616

1717
include(FetchContent)
1818

@@ -621,7 +621,7 @@ function(__dkcoder_delegate)
621621
cmake_path(NATIVE_PATH CMAKE_COMMAND CMAKE_COMMAND_NATIVE)
622622
cmake_path(NATIVE_PATH DKCODER_OCAMLRUN DKCODER_OCAMLRUN_NATIVE)
623623
cmake_path(NATIVE_PATH entryExec entryExec_NATIVE)
624-
file(CONFIGURE OUTPUT "${DKTOOL_POST_SCRIPT}" CONTENT [[REM @ECHO OFF
624+
file(CONFIGURE OUTPUT "${DKCODER_POST_SCRIPT}" CONTENT [[REM @ECHO OFF
625625
REM Clear "SET" variables from dk.cmd. They are not part of DkCoder API.
626626
SET DK_7Z_MAJVER=
627627
SET DK_7Z_MINVER=
@@ -651,7 +651,7 @@ SET DKRUN_ENV_URL_BASE=
651651
@ONLY NEWLINE_STYLE DOS)
652652
else()
653653
# + Clear "export" variables from dk
654-
file(CONFIGURE OUTPUT "${DKTOOL_POST_SCRIPT}" CONTENT [[#!/bin/sh
654+
file(CONFIGURE OUTPUT "${DKCODER_POST_SCRIPT}" CONTENT [[#!/bin/sh
655655
set -euf
656656
# Clear "export" variables from ./dk. They are not part of DkCoder API.
657657
unset DKMLSYS_MV DKMLSYS_CHMOD DKMLSYS_UNAME DKMLSYS_ENV DKMLSYS_AWK DKMLSYS_SED DKMLSYS_COMM DKMLSYS_INSTALL
@@ -694,7 +694,7 @@ function(__parse_if_ocaml_command)
694694
set(${ARG_SUCCESS_VARIABLE} OFF PARENT_SCOPE)
695695
endfunction()
696696

697-
function(__parse_dktool_command_line)
697+
function(__parse_dkcoder_command_line)
698698
# The first argument is <command>. All dots will be replaced with a
699699
# triple underscore as a convenience and to be pretty for the user.
700700
# However, we do not error if no <command> is given ... we'll do
@@ -708,7 +708,7 @@ function(__parse_dktool_command_line)
708708
./dk <command> [args]
709709

710710
Environment variables:
711-
DKTOOL_TTL_MINUTES=<n>. How many minutes before updates are fetched.
711+
DKCODER_TTL_MINUTES=<n>. How many minutes before updates are fetched.
712712
Defaults to 60 minutes. Set to 0 to disable caching.
713713
]])
714714
else()
@@ -736,18 +736,18 @@ Environment variables:
736736
endif()
737737

738738
# Setup the binary directory
739-
if(NOT DKTOOL_WORKDIR)
740-
message(FATAL_ERROR "Problem: Your `dk` and/or `dk.cmd` are corrupted. Solution: Follow the instructions at https://gitlab.com/diskuv/dktool#installing")
739+
if(NOT DKCODER_WORKDIR)
740+
message(FATAL_ERROR "Problem: Your `dk` and/or `dk.cmd` are corrupted. Solution: Follow the instructions at https://github.com/diskuv/dkcoder.git#installing")
741741
endif()
742-
set(CMAKE_BINARY_DIR "${DKTOOL_WORKDIR}")
742+
set(CMAKE_BINARY_DIR "${DKCODER_WORKDIR}")
743743
set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_BINARY_DIR}")
744744

745745
# Set a log level used for essentially informational messages
746-
set(__dktool_log_level STATUS)
747-
if(DEFINED ENV{DKTOOL_LOGLEVEL} AND (
748-
"$ENV{DKTOOL_LOGLEVEL_OVERRIDE}" STREQUAL DEBUG OR
749-
"$ENV{DKTOOL_LOGLEVEL_OVERRIDE}" STREQUAL STATUS))
750-
set(__dktool_log_level "$ENV{DKTOOL_LOGLEVEL_OVERRIDE}")
746+
set(__dkcoder_log_level STATUS)
747+
if(DEFINED ENV{DKCODER_LOGLEVEL} AND (
748+
"$ENV{DKCODER_LOGLEVEL_OVERRIDE}" STREQUAL DEBUG OR
749+
"$ENV{DKCODER_LOGLEVEL_OVERRIDE}" STREQUAL STATUS))
750+
set(__dkcoder_log_level "$ENV{DKCODER_LOGLEVEL_OVERRIDE}")
751751
endif()
752752

753753
# Determine if the <command> is a legacy CMake command or a modern OCaml command
@@ -790,7 +790,7 @@ Environment variables:
790790
# Set log level if DkRun_*.RunQuiet. And then rename module from RunQuiet to Run.
791791
set(quiet OFF)
792792
if(package_namespace STREQUAL "Dk" AND package_qualifier STREQUAL "Run" AND module STREQUAL "RunQuiet")
793-
set(__dktool_log_level DEBUG)
793+
set(__dkcoder_log_level DEBUG)
794794
set(module Run)
795795
set(quiet ON)
796796
endif()
@@ -801,7 +801,7 @@ Environment variables:
801801
# Do DkCoder install
802802
__dkcoder_install(
803803
ABI "${abi}"
804-
LOGLEVEL "${__dktool_log_level}"
804+
LOGLEVEL "${__dkcoder_log_level}"
805805
VERSION "${__dkrun_compile_version}"
806806
QUIET "${quiet}")
807807

@@ -887,36 +887,36 @@ endfunction()
887887
# hooks or redefine CMake built-in functions. Regardless, the user
888888
# scripts are namespaced with `user__` prefix
889889
if(NOT IS_DIRECTORY cmake/scripts/dksdk)
890-
# If this project (ex. dktool) has the system scripts, it must
890+
# If this project (ex. dkcoder) has the system scripts, it must
891891
# have all of them. Otherwise we download the system scripts.
892892
# But we don't want to download every time we run the script.
893893
#
894894
# The default, but explicit so we know where it is.
895-
set(dktool_subbuild_dir "${CMAKE_CURRENT_BINARY_DIR}/dktool-subbuild")
895+
set(dkcoder_subbuild_dir "${CMAKE_CURRENT_BINARY_DIR}/dkcoder-subbuild")
896896
# Also the default, but explicit since we don't always call FetchContent_Populate().
897-
set(dktool_src_dir "${CMAKE_CURRENT_BINARY_DIR}/dktool-src")
897+
set(dkcoder_src_dir "${CMAKE_CURRENT_BINARY_DIR}/dkcoder-src")
898898
# Prior downloads are fine if done within the last one hour.
899899
set(ttl_MINUTES 60)
900-
if(DEFINED ENV{DKTOOL_TTL_MINUTES})
901-
set(ttl_MINUTES "$ENV{DKTOOL_TTL_MINUTES}")
900+
if(DEFINED ENV{DKCODER_TTL_MINUTES})
901+
set(ttl_MINUTES "$ENV{DKCODER_TTL_MINUTES}")
902902
endif()
903903
string(TIMESTAMP now_EPOCHSECS "%s")
904904
math(EXPR min_valid_EPOCHSECS "${now_EPOCHSECS} - 60*${ttl_MINUTES}")
905905
set(tstamp_EPOCHSECS 0)
906-
if(EXISTS "${dktool_subbuild_dir}/build.ninja")
907-
file(TIMESTAMP "${dktool_subbuild_dir}/build.ninja" tstamp_EPOCHSECS "%s")
906+
if(EXISTS "${dkcoder_subbuild_dir}/build.ninja")
907+
file(TIMESTAMP "${dkcoder_subbuild_dir}/build.ninja" tstamp_EPOCHSECS "%s")
908908
endif()
909909
if(NOT tstamp_EPOCHSECS OR tstamp_EPOCHSECS LESS_EQUAL min_valid_EPOCHSECS)
910-
# Cache miss. Time to update dktool.
911-
FetchContent_Populate(dktool
910+
# Cache miss. Time to update dkcoder.
911+
FetchContent_Populate(dkcoder
912912
QUIET
913-
SOURCE_DIR "${dktool_src_dir}"
914-
SUBBUILD_DIR "${dktool_subbuild_dir}"
915-
GIT_REPOSITORY https://gitlab.com/diskuv/dktool.git
913+
SOURCE_DIR "${dkcoder_src_dir}"
914+
SUBBUILD_DIR "${dkcoder_subbuild_dir}"
915+
GIT_REPOSITORY https://github.com/diskuv/dkcoder.git
916916
GIT_TAG 1.0
917917
# As of 3.25.3 the bug https://gitlab.kitware.com/cmake/cmake/-/issues/24578
918918
# has still not been fixed. That means empty strings get removed.
919-
# ExternalProject_Add(GIT_SUBMODULES) in dktool-subbuild/CMakeLists.txt
919+
# ExternalProject_Add(GIT_SUBMODULES) in dkcoder-subbuild/CMakeLists.txt
920920
# means fetch all submodules.
921921
# https://gitlab.kitware.com/cmake/cmake/-/issues/20579#note_734045
922922
# has a workaround.
@@ -925,9 +925,9 @@ endfunction()
925925
endif()
926926
file(GLOB_RECURSE system_command_files
927927
LIST_DIRECTORIES FALSE
928-
RELATIVE ${dktool_src_dir}/cmake/scripts
929-
${dktool_src_dir}/cmake/scripts/dkml/*.cmake
930-
${dktool_src_dir}/cmake/scripts/dksdk/*.cmake)
928+
RELATIVE ${dkcoder_src_dir}/cmake/scripts
929+
${dkcoder_src_dir}/cmake/scripts/dkml/*.cmake
930+
${dkcoder_src_dir}/cmake/scripts/dksdk/*.cmake)
931931
foreach(command_file IN LISTS system_command_files)
932932
# Normalize and lowercase
933933
cmake_path(NORMAL_PATH command_file)
@@ -947,11 +947,11 @@ endfunction()
947947
message(VERBOSE "Shimming ${command_function_name}")
948948
cmake_language(EVAL CODE "
949949
function(${command_function_name})
950-
include(\"${dktool_src_dir}/cmake/scripts/${command_file}\")
950+
include(\"${dkcoder_src_dir}/cmake/scripts/${command_file}\")
951951
if(COMMAND run)
952952
run(${quotedArgs})
953953
else()
954-
message(FATAL_ERROR [[The system script ${dktool_src_dir}/cmake/scripts/${command_file} was missing:
954+
message(FATAL_ERROR [[The system script ${dkcoder_src_dir}/cmake/scripts/${command_file} was missing:
955955
function(run)
956956
# The system code
957957
endfunction()
@@ -1007,14 +1007,14 @@ if(CMAKE_HOST_WIN32)
10071007
else()
10081008
set(post_script_suffix .sh)
10091009
endif()
1010-
cmake_path(APPEND DKTOOL_WORKDIR "${DKTOOL_NONCE}${post_script_suffix}" OUTPUT_VARIABLE DKTOOL_POST_SCRIPT)
1011-
cmake_path(NORMAL_PATH DKTOOL_POST_SCRIPT)
1010+
cmake_path(APPEND DKCODER_WORKDIR "${DKCODER_NONCE}${post_script_suffix}" OUTPUT_VARIABLE DKCODER_POST_SCRIPT)
1011+
cmake_path(NORMAL_PATH DKCODER_POST_SCRIPT)
10121012

10131013
# Escape any escape characters before EVAL CODE
1014-
string(REPLACE "\\" "\\\\" DKTOOL_CMDLINE "${DKTOOL_CMDLINE}")
1014+
string(REPLACE "\\" "\\\\" DKCODER_CMDLINE "${DKCODER_CMDLINE}")
10151015

10161016
# Escape any hash symbols (#) characters before EVAL CODE
1017-
string(REPLACE "#" "\\#" DKTOOL_CMDLINE "${DKTOOL_CMDLINE}")
1017+
string(REPLACE "#" "\\#" DKCODER_CMDLINE "${DKCODER_CMDLINE}")
10181018

1019-
# Splat DKTOOL_CMDLINE
1020-
cmake_language(EVAL CODE "__parse_dktool_command_line(${DKTOOL_CMDLINE})")
1019+
# Splat DKCODER_CMDLINE
1020+
cmake_language(EVAL CODE "__parse_dkcoder_command_line(${DKCODER_CMDLINE})")

ci/build-test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
##########################################################################
3-
# File: dktool/cmake/scripts/dkml/workflow/compilers-build-test.in.sh #
3+
# File: dkcoder/cmake/scripts/dkml/workflow/compilers-build-test.in.sh #
44
# #
55
# Copyright 2022 Diskuv, Inc. #
66
# #

cmake/scripts/dkml/workflow/compilers-build-test.in.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
##########################################################################
3-
# File: dktool/cmake/scripts/dkml/workflow/compilers-build-test.in.sh #
3+
# File: dkcoder/cmake/scripts/dkml/workflow/compilers-build-test.in.sh #
44
# #
55
# Copyright 2022 Diskuv, Inc. #
66
# #

cmake/scripts/dkml/workflow/compilers-github-workflows-dkml.in.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##########################################################################
2-
# File: dktool/cmake/scripts/dkml/workflow/compilers-github-workflows-dkml.in.yml#
2+
# File: dkcoder/cmake/scripts/dkml/workflow/compilers-github-workflows-dkml.in.yml#
33
# #
44
# Copyright 2022 Diskuv, Inc. #
55
# #

cmake/scripts/dkml/workflow/compilers-gitlab-ci.in.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##########################################################################
2-
# File: dktool/cmake/scripts/dkml/workflow/compilers-gitlab-ci.in.yml #
2+
# File: dkcoder/cmake/scripts/dkml/workflow/compilers-gitlab-ci.in.yml #
33
# #
44
# Copyright 2022 Diskuv, Inc. #
55
# #

cmake/scripts/dkml/workflow/compilers.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##########################################################################
2-
# File: dktool/cmake/scripts/dkml/workflow/compilers.cmake #
2+
# File: dkcoder/cmake/scripts/dkml/workflow/compilers.cmake #
33
# #
44
# Copyright 2023 Diskuv, Inc. #
55
# #

cmake/scripts/dkml/wrapper/upgrade.cmake

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##########################################################################
2-
# File: dktool/cmake/scripts/dkml/wrapper/upgrade.cmake #
2+
# File: dkcoder/cmake/scripts/dkml/wrapper/upgrade.cmake #
33
# #
44
# Copyright 2023 Diskuv, Inc. #
55
# #
@@ -54,12 +54,12 @@ HERE
5454
directory that ./dk lives.
5555
This is useful as the first step in adding ./dk to a
5656
new project:
57-
git clone https://gitlab.com/diskuv/dktool.git
58-
dktool/dk user.dkml.wrapper.upgrade HERE
57+
git clone https://github.com/diskuv/dkcoder.git
58+
dkcoder/dk user.dkml.wrapper.upgrade HERE
5959

6060
DONE
61-
Remove the dktool/ created by a prior invocation of:
62-
git clone https://gitlab.com/diskuv/dktool.git
61+
Remove the dkcoder/ created by a prior invocation of:
62+
git clone https://github.com/diskuv/dkcoder.git
6363
This is useful as the final step in adding ./dk to a
6464
new project.
6565
]])
@@ -240,7 +240,7 @@ function(run)
240240
return()
241241
endif()
242242

243-
# <dktool>/cmake/scripts/dkml/wrapper/upgrade.cmake -> <dktool>
243+
# <dkcoder>/cmake/scripts/dkml/wrapper/upgrade.cmake -> <dkcoder>
244244
cmake_path(GET CMAKE_CURRENT_FUNCTION_LIST_DIR PARENT_PATH d)
245245
cmake_path(GET d PARENT_PATH d)
246246
cmake_path(GET d PARENT_PATH d)
@@ -268,8 +268,8 @@ function(run)
268268
# DONE?
269269
if(ARG_DONE)
270270
# we already checked that no [HERE] argument
271-
if(IS_DIRECTORY "${CMAKE_SOURCE_DIR}/dktool" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/dktool/.git")
272-
file(REMOVE_RECURSE "${CMAKE_SOURCE_DIR}/dktool")
271+
if(IS_DIRECTORY "${CMAKE_SOURCE_DIR}/dkcoder" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/dkcoder/.git")
272+
file(REMOVE_RECURSE "${CMAKE_SOURCE_DIR}/dkcoder")
273273
endif()
274274
message(NOTICE [[
275275

cmake/scripts/dkml/wrapper/upgrade.remove-old-dk-find-scripts.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
##########################################################################
3-
# File: dktool\cmake\scripts\dkml\wrapper\upgrade.remove-old-dk-find-scripts.sh#
3+
# File: dkcoder\cmake\scripts\dkml\wrapper\upgrade.remove-old-dk-find-scripts.sh#
44
# #
55
# Copyright 2024 Diskuv, Inc. #
66
# #

cmake/scripts/dksdk/android/cmake/download.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##########################################################################
2-
# File: dktool\cmake\scripts\dksdk\android\cmake\download.cmake #
2+
# File: dkcoder\cmake\scripts\dksdk\android\cmake\download.cmake #
33
# #
44
# Copyright 2023 Diskuv, Inc. #
55
# #

0 commit comments

Comments
 (0)