Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@ name: CI-Linux

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
build-linux:
name: Build On Ubuntu
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
timeout-minutes: 120

steps:
# Checks-out your repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: ccache
uses: hendrikmuhs/ccache-action@v1
- name: Install Dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake qtbase5-dev libqt5svg5-dev libfreetype-dev libsqlite-dev libjpeg-dev
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake qtbase5-dev libqt5svg5-dev libfreetype6-dev libsqlite3-dev libjpeg-dev
- name: Create Build Dir
run: mkdir build
working-directory: ${{runner.workspace}}
run: mkdir -p ${{github.workspace}}/build
- name: Build using CMake
run: cmake --build ${{github.workspace}}/build -DBUILD_TESTS=on
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest
run: cmake ${{github.workspace}} -DBUILD_TESTS=on && make -j8
- name: Test
run: cd ${{github.workspace}}/build && QT_QPA_PLATFORM=offscreen ctest -V

66 changes: 66 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# binary files
*.so
*.[oa]
*.exe
*.pyc
bin/
build
.kdev4
*.kdev4
*.py[cod]
*$py.class
__pycache__/

# editor files
*.sln
.idea
.vscode

# Mac OS
.DS_Store
*/.DS_Store

# temp files
*~
*.log
SVNREV
Testing
texmacs.1
tests/gtest
cmake-build-debug
CMakeLists.txt.user
misc/benchmark/gbench

TeXmacs/progs/ice-9
src/Plugins/Qt/moc_*.cpp
src/Deps
src/Objects
TeXmacs/plugins/
src/System/config.h
src/System/tm_configure.hpp
misc/man/texmacs.1
misc/admin/admin.makefile
misc/scripts/texmacs
misc/scripts/fig2ps
misc/doxygen/Doxyfile
misc/vscode/c_cpp_properties.json
misc/autotroll/test.sh
cmake/CreateBundle.sh
cmake/CompleteBundle.cmake
TeXmacs/examples/plugins/dynlink/Makefile
packages/macos/Info-Xcode.plist
packages/macos/Base.xcconfig
packages/macos/Info.plist
packages/debian/control
packages/debian/changelog
packages/mandriva/TeXmacs.spec
packages/centos/TeXmacs.spec
packages/fedora/TeXmacs.spec
packages/windows/resource.rc
packages/windows/TeXmacs.iss
packages/redhat/TeXmacs.spec
Makefile
src/makefile
packages/macos/TeXmacs.xcodeproj/project.xcworkspace
packages/macos/TeXmacs.xcodeproj/xcuserdata
config.status
26 changes: 19 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ find_package (JPEG)
### --------------------------------------------------------------------

# Allow for selection of Scheme implementation
set(SCHEME_IMPL "default" CACHE STRING "Implementation of Scheme to compile for.")
set(SCHEME_IMPL "s7" CACHE STRING "Implementation of Scheme to compile for.")
set_property(CACHE SCHEME_IMPL PROPERTY STRINGS default guile-1.8 guile-2.0 guile-2.2 guile-3.0 chez s7)
message(STATUS "Looking for Scheme implementation: " ${SCHEME_IMPL})

Expand All @@ -302,7 +302,6 @@ elseif ( (${SCHEME_IMPL} STREQUAL "guile-1.8")
OR (${SCHEME_IMPL} STREQUAL "guile-3.0") )
pkg_check_modules (Guile REQUIRED ${SCHEME_IMPL})
elseif ((${SCHEME_IMPL} STREQUAL "chez") OR (${SCHEME_IMPL} STREQUAL "s7"))
message(FATAL_ERROR "Selected Scheme implementation not implemented yet.")
else ()
message(FATAL_ERROR "Incorrect scheme implementation selected.")
endif()
Expand Down Expand Up @@ -422,7 +421,8 @@ set (TeXmacs_Include_Dirs
${TEXMACS_SOURCE_DIR}/src/Plugins
${TEXMACS_SOURCE_DIR}/src/Plugins/Pdf/LibAesgm
${TEXMACS_SOURCE_DIR}/src/Scheme
${TEXMACS_SOURCE_DIR}/src/Scheme/Guile
# ${TEXMACS_SOURCE_DIR}/src/Scheme/Guile
${TEXMACS_SOURCE_DIR}/src/Scheme/S7
${TEXMACS_SOURCE_DIR}/src/Scheme/Scheme
${TEXMACS_SOURCE_DIR}/src/Style/Environment
${TEXMACS_SOURCE_DIR}/src/Style/Evaluate
Expand Down Expand Up @@ -453,7 +453,8 @@ else (WIN32)
endif (WIN32)

set (TeXmacs_Include_Dirs ${TeXmacs_Include_Dirs}
${Guile_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS} ${Cairo_INCLUDE_DIRS}
# ${Guile_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS} ${Cairo_INCLUDE_DIRS}
${IMLIB2_INCLUDE_DIR} ${GMP_INCLUDES}
)

Expand All @@ -466,7 +467,9 @@ file (GLOB_RECURSE TeXmacs_Base_SRCS
"${TEXMACS_SOURCE_DIR}/src/Graphics/*.cpp"
"${TEXMACS_SOURCE_DIR}/src/Kernel/*.cpp"
"${TEXMACS_SOURCE_DIR}/src/Scheme/Scheme/*.cpp"
"${TEXMACS_SOURCE_DIR}/src/Scheme/Guile/*.cpp"
# "${TEXMACS_SOURCE_DIR}/src/Scheme/Guile/*.cpp"
"${TEXMACS_SOURCE_DIR}/src/Scheme/S7/*.cpp"
"${TEXMACS_SOURCE_DIR}/src/Scheme/S7/*.c"
"${TEXMACS_SOURCE_DIR}/src/System/*.cpp"
"${TEXMACS_SOURCE_DIR}/src/Texmacs/Data/*.cpp"
"${TEXMACS_SOURCE_DIR}/src/Texmacs/Server/*.cpp"
Expand Down Expand Up @@ -547,15 +550,24 @@ set (TeXmacs_MacOS_SRCS
### --------------------------------------------------------------------
### Determine TeXmacs_Libraries
### --------------------------------------------------------------------

set (TeXmacs_Libraries
${Guile_LIBRARIES}
# ${Guile_LIBRARIES}
${ZLIB_LIBRARIES}
${JPEG_LIBRARIES}
${PNG_LIBRARIES}
-lpthread
)

if (WIN32)
# explore this
# CMAKE_INSTALL_UCRT_LIBRARIES
# I only to manage to get it working for msys2-ucrt.
set (TeXmacs_Libraries
${TeXmacs_Libraries}
wsock32 ws2_32
)
endif (WIN32)

if (LINKED_CAIRO)
set (TeXmacs_Libraries ${TeXmacs_Libraries} ${CAIRO_LIBRARIES})
endif (LINKED_CAIRO)
Expand Down
16 changes: 16 additions & 0 deletions TeXmacs/doc/devel/scheme/api/glue-auto-doc.en.tm
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,22 @@ source code.
<scm|url>.
</explain>

<\explain>
<scm|(get-user-login)>
<explain-synopsis|no synopsis>
<|explain>
Calls the <c++> function <cpp|get_user_login> which returns
<scm|string>.
</explain>

<\explain>
<scm|(get-user-name)>
<explain-synopsis|no synopsis>
<|explain>
Calls the <c++> function <cpp|get_user_name> which returns
<scm|string>.
</explain>

<\explain>
<scm|(plugin-list)>
<explain-synopsis|no synopsis>
Expand Down
4 changes: 3 additions & 1 deletion TeXmacs/progs/check/check-master.scm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(texmacs-module (check check-master)
(:use (convert html htmltm-test)
(:use (kernel texmacs tm-define-test)
(convert html htmltm-test)
(convert html tmhtml-test)
(convert tools xmltm-test)
(convert tools tmlength-test)
Expand Down Expand Up @@ -88,4 +89,5 @@
(regtest-tmhtml)
(regtest-tmmltm)
(regtest-prog-format)
(regtest-tm-define)
)
4 changes: 2 additions & 2 deletions TeXmacs/progs/convert/html/tmhtml-test.scm
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
(define (make-result l) (tmhtml-root `(image ,@l "" "")))
(define (make-expected l) (if (null? l) '() (apply make-expected-sub l)))
(define (make-expected-sub f w h)
`((h:img (@ (src ,f)
`((h:img (@ (class "image") (src ,f)
,@(if w `((width ,w)) '())
,@(if h `((height ,h)) '())))))
(regression-test-group
Expand Down Expand Up @@ -428,7 +428,7 @@
(regtest-tmhtml-verbatim)
;; (regtest-tmhtml-table)
;; (regtest-tmhtml-table-post)
(regtest-tmhtml-picture))))
(regtest-tmhtml-picture))))
;; (regtest-tmhtml-document-post))))
(display* "Total: " (object->string n) " tests.\n")
(display "Test suite of tmhtml: ok\n")))
2 changes: 1 addition & 1 deletion TeXmacs/progs/convert/html/tmhtml.scm
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@
(cmpx (/ 1 (ahash-ref tmhtml-length-table "px"))))
(cond ((== unit "px") (number->htmlstring val))
((in? unit '("par" "pag"))
(string-append (number->htmlstring (* 100 val)) "%"))
(string-append (number->htmlstring (/ (round (* val 10000)) 100)) "%"))
((and css? (== unit "tmpt"))
(string-append (number->htmlstring (* cmpx val incm)) "px"))
((and css? (== unit "fn"))
Expand Down
2 changes: 1 addition & 1 deletion TeXmacs/progs/convert/latex/tmtex.scm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
(doc tmdoc-markup)
(convert latex latex-tools)))

(use-modules (ice-9 format))
;(use-modules (ice-9 format))

(tm-define tmtex-debug-mode? #f)

Expand Down
31 changes: 16 additions & 15 deletions TeXmacs/progs/convert/tools/environment-test.scm
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,22 @@
(set-rcons! out (environment-ref env foo)))
out)
'("bar" "baz" "bar"))
(test "never bound"
(error-or-value
(lambda ()
(let ((env (environment)))
(environment-ref env foo))))
"")
(test "unbound"
(error-or-value
(lambda ()
(let ((env (environment)))
(with-environment
env ((foo "bar"))
(noop))
(environment-ref env foo))))
"")))
; (test "never bound"
; (error-or-value
; (lambda ()
; (let ((env (environment)))
; (environment-ref env foo))))
; "")
; (test "unbound"
; (error-or-value
; (lambda ()
; (let ((env (environment)))
; (with-environment
; env ((foo "bar"))
; (noop))
; (environment-ref env foo))))
; "")
))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Test suite
Expand Down
6 changes: 1 addition & 5 deletions TeXmacs/progs/convert/tools/environment.scm
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@
`(ahash-remove! ,env ,key))

(tm-define (environment-ref* env key)
(let ((h (ahash-get-handle env key)))
(if h (cdr h)
(begin
(display* "warning: unbound key " key " in environment " env "\n")
""))))
(ahash-ref env key))

(tm-define-macro (environment-ref env key)
`(environment-ref* ,env (quote ,key)))
Expand Down
2 changes: 1 addition & 1 deletion TeXmacs/progs/convert/tools/xmltm-test.scm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
(test "processing instruction"
"<?xml version='1.0'?>" '((*PI* xml "version='1.0'")))
(test "empty PI" "<?empty?>" '((*PI* empty "")))
(test "null PI" "<??>" `((*PI* ,(string->symbol "") "")))
;(test "null PI" "<??>" `((*PI* ,(string->symbol "") "")))
(test "doctype" "<!DOCTYPE mytype>" '((*DOCTYPE* "mytype")))
(test "implicit /p" "<p>hello<p>b" '((p "hello") (p "b")))
(test "implicit /li" "<ul><li>a<li>b</ul>" '((ul (li "a") (li "b"))))
Expand Down
25 changes: 2 additions & 23 deletions TeXmacs/progs/database/db-users.scm
Original file line number Diff line number Diff line change
Expand Up @@ -95,30 +95,9 @@

(define db-the-default-user #f)

(define (safe-getpwnam id)
(catch #t
(lambda () (passwd:gecos (getpwnam id)))
(lambda err
(display* "Error in getpwnam: " err "\n")
"")))

(define (safe-getpwuid id)
(catch #t
(lambda () (passwd:name (getpwuid id)))
(lambda err
(display* "Error in getpwuid: " err "\n")
"")))

(define (get-full-name user)
(if (os-mingw?)
(or (and (url-exists-in-path? "fullname")
(var-eval-system (string-append "fullname " user)))
"Default User")
(safe-getpwnam user)))

(define (create-default-user)
(let* ((pseudo (or (getlogin) (safe-getpwuid (getuid))))
(name (get-full-name pseudo)))
(let* ((pseudo (get-user-login))
(name (get-user-name)))
;;(display* "pseudo= " pseudo "\n")
;;(display* "name= " name "\n")
(when (== pseudo "") (set! pseudo "default"))
Expand Down
2 changes: 1 addition & 1 deletion TeXmacs/progs/generic/generic-edit.scm
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@
(:synopsis "Selects word @w in tree @t, more or less around column @col.")
(let* ((st (tree->string t))
(pos (- col (string-length w)))
(beg (string-contains st w (max 0 pos)))) ; returns index of w in st
(beg (string-search-forwards w (max 0 pos) st))) ; returns index of w in st
(if beg
(with p (tree->path t)
(go-to (rcons p beg))
Expand Down
6 changes: 2 additions & 4 deletions TeXmacs/progs/graphics/graphics-utils.scm
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@
;;NOTE: This section is OK.
(define-macro (define-export-macro head . body)
`(begin
(define-macro ,(car head)
(lambda ,(cdr head) ,@body)
)
(define-macro ,head ,@body)
(export ,(car head))))
(export define-export-macro)
(export define-export-macro)
;; NOTE: It seems that as soon as macros become a little bit complex,
;; the Guile macroexpander interacts poorly with the memoizing stuff
;; in (define-public-macro), and then it becomes unstable. This is
Expand Down
Loading