Skip to content

Commit 20e217d

Browse files
committed
Merge branch 'release-1.0.1'
2 parents 81f2a05 + 2014bd7 commit 20e217d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+846
-419
lines changed

doc/changelog.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
========================
2+
SDM 1.0.1
3+
------------------------
4+
Released on 2021-12-03
5+
========================
6+
7+
sdmconsole:
8+
9+
* plotter now supports limitless scrolling, scrollbars have been removed
10+
* various minor ergonomic enhancements in the plotter module
11+
* default console font for Windows changed from Courier New to Consolas (if available)
12+
* implement unobtrusive hints on startup
13+
* fixed minor glitches in the stream viewer
14+
15+
Build system:
16+
17+
* Linux installer now creates an sdmconsole application shortcut
18+
* requirements bumped: gcc>=4.9, Qt>=5.6, Ubuntu>=18.04
19+
* fixed a bunch of compiler errors/warnings generated with newer Qt, gcc, clang and libstdc++
20+
* experimental BSD-specific code removed
21+
122
========================
223
SDM 1.0.0
324
------------------------

doc/licenses/license.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ IN THE SOFTWARE.
5252
THIRD PARTY SOFTWARE COMPONENTS
5353

5454
SDM framework includes the following third party software components. License
55-
conditions for third-party software are provided in the documentation.
55+
conditions for third-party software are provided in the documentation
56+
directory.
5657

5758
* Lua: Copyright © 1994–2020 Lua.org, PUC-Rio.
5859
* The Qt Toolkit: Copyright © 2015 The Qt Company Ltd.

doc/manual.pdf

365 Bytes
Binary file not shown.

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ endif()
2525

2626
if(UNIX)
2727
option(OPTION_VALGRIND "Enable Valgrind in the main test suite")
28+
option(OPTION_NO_ICONS "Skip installation of desktop entries")
2829
endif()
2930

3031
include(Version)

src/cmake/GlobalBuildConfig.cmake

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,19 @@ endif()
7676
# Set up warning level
7777

7878
if(GCC_CMDLINE_SYNTAX)
79-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
80-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
79+
# Note: -Wno-misleading-indentation prevents bogus Clang warnings related
80+
# to the Qt's "emit" macro which expands to nothing and breaks indentation.
81+
# -Wno-stringop-overflow prevents bogus GCC11 warning in the
82+
# QVector<T>::append(), probably a compiler bug.
83+
set(GCC_WARNINGS "-pedantic -Wall -Wextra -Wno-unused-parameter")
84+
if(CMAKE_C_COMPILER_ID STREQUAL GNU)
85+
set(GCC_WARNINGS "${GCC_WARNINGS} -Wno-stringop-overflow")
86+
endif()
87+
if(CMAKE_C_COMPILER_ID STREQUAL Clang)
88+
set(GCC_WARNINGS "${GCC_WARNINGS} -Wno-unknown-warning-option -Wno-misleading-indentation")
89+
endif()
90+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_WARNINGS}")
91+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_WARNINGS}")
8192
endif()
8293

8394
# Don't export unnecessary symbols from the executables
@@ -96,10 +107,3 @@ if(GCC_CMDLINE_SYNTAX)
96107
set(CMAKE_C_VISIBILITY_PRESET hidden)
97108
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
98109
endif()
99-
100-
# Enable timed mutex workaround for libstdc++
101-
102-
if(GCC_CMDLINE_SYNTAX)
103-
include_directories(${CMAKE_CURRENT_LIST_DIR}/workarounds)
104-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include timed_mutex_workaround.h")
105-
endif()

src/cmake/InstallDirectories.cmake

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,26 @@ else()
4949
set(DATA_INSTALL_DIR share/sdm/data)
5050
set(CONFIG_PACKAGE_INSTALL_DIR share/sdm/cmake)
5151
set(EXAMPLES_INSTALL_DIR share/sdm/examples)
52+
53+
# Set desktop entry directories
54+
if(NOT OPTION_NO_ICONS)
55+
file(RELATIVE_PATH INSTALL_PREFIX_FROM_HOME "$ENV{HOME}" "${CMAKE_INSTALL_PREFIX}")
56+
string(SUBSTRING "${INSTALL_PREFIX_FROM_HOME}" 0 2 TMP)
57+
if(TMP STREQUAL "..")
58+
# Install path is a system directory
59+
if(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
60+
set(FREEDESKTOP_INSTALL_DIR /usr/share)
61+
else()
62+
set(FREEDESKTOP_INSTALL_DIR /usr/local/share)
63+
endif()
64+
else()
65+
# Install path is a user directory
66+
if("$ENV{XDG_DATA_HOME}")
67+
set(FREEDESKTOP_INSTALL_DIR "$ENV{XDG_DATA_HOME}")
68+
else()
69+
set(FREEDESKTOP_INSTALL_DIR "$ENV{HOME}/.local/share")
70+
endif()
71+
endif()
72+
message("Installing desktop entries to ${FREEDESKTOP_INSTALL_DIR}")
73+
endif()
5274
endif()

src/cmake/Version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.3.0)
44

55
set(PRODUCT_VERSION_MAJOR 1)
66
set(PRODUCT_VERSION_MINOR 0)
7-
set(PRODUCT_VERSION_PATCH 0)
7+
set(PRODUCT_VERSION_PATCH 1)
88

99
try_compile(CPU_DETECTED "${CMAKE_CURRENT_BINARY_DIR}/try_compile/DetectCPU" "${CMAKE_CURRENT_LIST_DIR}/DetectCPU.c" COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/try_compile/DetectCPU.bin")
1010

src/cmake/installer/addtopath.lua

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
-- This script adds/removes the SDM installation directory to/from the PATH
2+
-- environment variable.
3+
-- This is an experimental script that is not currently used by the installer.
4+
-- Usage: addtopath.lua <add|remove>
5+
6+
if #arg~=1 or (arg[1]~="add" and arg[1]~="remove") then
7+
print("Adds/removes SDM to/from the Windows PATH environment variable")
8+
print("Usage: "..arg[0].." <add|remove>")
9+
return
10+
end
11+
12+
-- Import the necessary Win32 functions
13+
14+
dfic=require("luadfic")
15+
16+
local RegCreateKeyExA=dfic.import("advapi32","RegCreateKeyExA",
17+
"long@winapi@uintptr_t,".. -- HKEY hKey
18+
"const char*,".. -- LPCSTR lpSubKey
19+
"unsigned long,".. -- DWORD Reserved
20+
"const void*,".. -- LPSTR lpClass
21+
"unsigned long,".. -- DWORD dwOptions
22+
"unsigned long,".. -- REGSAM samDesired
23+
"const void*,".. -- const LPSECURITY_ATTRIBUTES lpSecurityAttributes
24+
"uintptr_t*,".. -- PHKEY phkResult,
25+
"const void*") -- LPDWORD lpdwDisposition
26+
27+
local RegQueryValueExW=dfic.import("advapi32","RegQueryValueExW",
28+
"long@winapi@uintptr_t,".. -- HKEY hKey,
29+
"const void*,".. -- LPCWSTR lpValueName,
30+
"const unsigned long*,".. -- LPDWORD lpReserved,
31+
"unsigned long*,".. -- LPDWORD lpType,
32+
"void*,".. -- LPBYTE lpData,
33+
"unsigned long*") -- LPDWORD lpcbData
34+
35+
local RegSetValueExW=dfic.import("advapi32","RegSetValueExW",
36+
"long@winapi@uintptr_t,".. -- HKEY hKey,
37+
"const void*,".. -- LPCWSTR lpValueName,
38+
"unsigned long,".. -- DWORD Reserved,
39+
"unsigned long,".. -- DWORD dwType,
40+
"const void*,".. -- const BYTE *lpData,
41+
"unsigned long") -- DWORD cbData
42+
43+
local RegCloseKey=dfic.import("advapi32","RegCloseKey","long@winapi@uintptr_t")
44+
45+
local SendMessageTimeoutA=dfic.import("user32","SendMessageTimeoutA",
46+
"long@winapi@uintptr_t,".. -- HWND hWnd,
47+
"unsigned int,".. -- UINT Msg,
48+
"const void*,".. -- WPARAM wParam,
49+
"const char*,".. -- LPARAM lParam,
50+
"unsigned int,".. -- UINT fuFlags,
51+
"unsigned int,".. -- UINT uTimeout,
52+
"unsigned int*" -- PDWORD_PTR lpdwResult
53+
);
54+
55+
-- A helper function to parse the PATH environment variable
56+
57+
function parse_path(path)
58+
local t={}
59+
local i=1
60+
61+
function additem(str)
62+
if str~="" then table.insert(t,str) end
63+
end
64+
65+
while true do
66+
-- "i" points to the beginning of an item
67+
if path:sub(i,i)~="\"" then
68+
-- normal item
69+
local r=path:find(";",i,true)
70+
if not r then
71+
additem(path:sub(i))
72+
break
73+
end
74+
additem(path:sub(i,r-1))
75+
i=r+1
76+
else
77+
-- quoted item
78+
local r=path:find("\"",i+1,true)
79+
if not r then break end -- malformed string
80+
additem(path:sub(i+1,r-1))
81+
i=path:find(";",r+1,true)
82+
if not i then break end
83+
end
84+
end
85+
86+
return t
87+
end
88+
89+
-- Create a UTF-16 codec because Windows API doesn't support UTF-8
90+
91+
local c=codec.createcodec("utf-16")
92+
93+
-- Open the environment registry key
94+
95+
local HKEY_LOCAL_MACHINE=0x80000002
96+
local KEY_ALL_ACCESS=0xF003F
97+
local subkey="SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"
98+
99+
local r,key=RegCreateKeyExA(HKEY_LOCAL_MACHINE,subkey,0,nil,0,KEY_ALL_ACCESS,nil,1,nil)
100+
101+
if r~=0 then
102+
print("Error opening registry key")
103+
return
104+
end
105+
106+
-- Query the Path value
107+
108+
local valuename_buf=dfic.buffer(256)
109+
valuename_buf.write(c.fromutf8("Path"))
110+
111+
local r,valuetype,size=RegQueryValueExW(key[1],valuename_buf.ptr(),nil,1,nil,1)
112+
113+
if r~=0 then
114+
print("Error querying registry key value")
115+
RegCloseKey(key[1])
116+
return
117+
end
118+
119+
local path_buf=dfic.buffer(size[1])
120+
121+
r,valuetype,size=RegQueryValueExW(key[1],valuename_buf.ptr(),nil,1,path_buf.ptr(),{size[1]})
122+
123+
if r~=0 then
124+
print("Error querying registry key value")
125+
RegCloseKey(key[1])
126+
return
127+
end
128+
129+
if valuetype[1]~=1 and valuetype[1]~=2 then
130+
print("Unexpected [Path] value type")
131+
RegCloseKey(key[1])
132+
return
133+
end
134+
135+
local path=c.toutf8(path_buf.read(1,size[1]))
136+
137+
-- Remove the terminating null character(s), if any
138+
139+
for i=#path,1,-1 do
140+
if path:byte(i)~=0 then
141+
path=path:sub(1,i)
142+
break
143+
end
144+
end
145+
146+
-- Dissect the path string
147+
148+
local path_table=parse_path(path)
149+
150+
-- Obtain the path to the SDM installation directory
151+
152+
local installprefix=sdm.path("installprefix")
153+
154+
-- Modify the path table
155+
156+
if arg[1]=="add" then
157+
-- Add the SDM installation prefix to the PATH
158+
-- Check whether it is not already present
159+
for k,v in ipairs(path_table) do
160+
if v==installprefix or v==installprefix.."\\" then
161+
print("["..installprefix.."] is already present in the PATH")
162+
RegCloseKey(key[1])
163+
return
164+
end
165+
end
166+
table.insert(path_table,installprefix)
167+
else
168+
-- Remove the SDM installation prefix from the PATH
169+
local removed=false
170+
for k,v in ipairs(path_table) do
171+
if v==installprefix or v==installprefix.."\\" then
172+
table.remove(path_table,k)
173+
removed=true
174+
end
175+
end
176+
if not removed then
177+
print("["..installprefix.."] is not present in the PATH")
178+
RegCloseKey(key[1])
179+
return
180+
end
181+
end
182+
183+
-- Reassemble the path string
184+
185+
path=""
186+
for i=1,#path_table do
187+
if path_table[i]:find(";",1,true) then
188+
path=path.."\""..path_table[i].."\""
189+
else
190+
path=path..path_table[i]
191+
end
192+
if i~=#path_table then path=path..";" end
193+
end
194+
195+
-- Set the new PATH environment variable value
196+
197+
local path_utf16=c.fromutf8(path)
198+
path_buf.resize(#path_utf16+2)
199+
path_buf.write(path_utf16)
200+
path_buf.write("\0\0",#path_utf16) -- add terminating null character
201+
202+
r=RegSetValueExW(key[1],valuename_buf.ptr(),0,valuetype[1],path_buf.ptr(),#path_buf)
203+
204+
if r~=0 then
205+
print("Error setting registry key value")
206+
RegCloseKey(key[1])
207+
return
208+
end
209+
210+
RegCloseKey(key[1])
211+
212+
-- Inform applications that the environment has been updated
213+
214+
local HWND_BROADCAST=0xFFFF
215+
local WM_SETTINGCHANGE=0x001A
216+
217+
SendMessageTimeoutA(HWND_BROADCAST,WM_SETTINGCHANGE,nil,"Environment",0,1000,1)
218+
219+
print("PATH environment variable has been successfully modified")

src/cmake/installer/make_installer.nsi.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,14 @@ Function .onInit
190190
ReadRegStr $OldUninstaller HKLM \
191191
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_FULL_NAME_WITH_ARCH}" \
192192
"UninstallString"
193+
StrCmp $OldUninstaller "" 0 process_old_uninstaller
194+
# Detect legacy Microproject SDM installations
195+
ReadRegStr $OldUninstaller HKLM \
196+
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Microproject SDM (${ARCH_STR})" \
197+
"UninstallString"
193198
StrCmp $OldUninstaller "" done
194199

200+
process_old_uninstaller:
195201
Push $OldUninstaller
196202
Call GetInQuotes
197203
Pop $OldUninstallerPath

src/cmake/installer/uninstall.sh.in

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,29 @@
22

33
# Uninstall program
44

5-
@EMPTY@rm -f @CMAKE_INSTALL_PREFIX@/bin/sdmconsole
6-
@EMPTY@rm -f @CMAKE_INSTALL_PREFIX@/bin/sdmhost
7-
@EMPTY@rm -rf @CMAKE_INSTALL_PREFIX@/lib/sdm
8-
@EMPTY@rm -rf @CMAKE_INSTALL_PREFIX@/include/sdm
9-
@EMPTY@rm -rf @CMAKE_INSTALL_PREFIX@/share/sdm
5+
@EMPTY@rm -f "@CMAKE_INSTALL_PREFIX@/bin/sdmconsole"
6+
@EMPTY@rm -f "@CMAKE_INSTALL_PREFIX@/bin/sdmhost"
7+
@EMPTY@rm -rf "@CMAKE_INSTALL_PREFIX@/lib/sdm"
8+
@EMPTY@rm -rf "@CMAKE_INSTALL_PREFIX@/include/sdm"
9+
@EMPTY@rm -rf "@CMAKE_INSTALL_PREFIX@/share/sdm"
10+
11+
# Remove desktop entries
12+
13+
@EMPTY@rm -f "@FREEDESKTOP_INSTALL_DIR@/applications/sdmconsole.desktop"
14+
@EMPTY@rm -f "@FREEDESKTOP_INSTALL_DIR@/icons/hicolor/scalable/apps/sdmconsole.svg"
15+
@EMPTY@rm -f "@FREEDESKTOP_INSTALL_DIR@/icons/hicolor/256x256/apps/sdmconsole.png"
16+
@EMPTY@rm -f "@FREEDESKTOP_INSTALL_DIR@/icons/hicolor/48x48/apps/sdmconsole.png"
1017

1118
# Remove user configuration
1219

13-
@EMPTY@rm -f $ENV{HOME}/.config/Microproject/sdmconsole.ini
14-
@EMPTY@rm -rf $ENV{HOME}/.config/Microproject/sdmconsole
15-
@EMPTY@rm -df $ENV{HOME}/.config/Microproject
20+
@EMPTY@rm -f "$ENV{HOME}/.config/Microproject/sdmconsole.ini"
21+
@EMPTY@rm -rf "$ENV{HOME}/.config/Microproject/sdmconsole"
22+
@EMPTY@rm -df "$ENV{HOME}/.config/Microproject"
1623

17-
# Remove empty directories (if appropriate)
24+
# Remove these directories only if empty
1825

19-
@DONTREMOVE@rm -df @CMAKE_INSTALL_PREFIX@/bin
20-
@DONTREMOVE@rm -df @CMAKE_INSTALL_PREFIX@/lib
21-
@DONTREMOVE@rm -df @CMAKE_INSTALL_PREFIX@/include
22-
@DONTREMOVE@rm -df @CMAKE_INSTALL_PREFIX@/share
23-
@DONTREMOVE@rm -df @CMAKE_INSTALL_PREFIX@
26+
@DONTREMOVE@rm -df "@CMAKE_INSTALL_PREFIX@/bin"
27+
@DONTREMOVE@rm -df "@CMAKE_INSTALL_PREFIX@/lib"
28+
@DONTREMOVE@rm -df "@CMAKE_INSTALL_PREFIX@/include"
29+
@DONTREMOVE@rm -df "@CMAKE_INSTALL_PREFIX@/share"
30+
@DONTREMOVE@rm -df "@CMAKE_INSTALL_PREFIX@"

0 commit comments

Comments
 (0)