From 9d6f65607f9de2432060b714e1759e92e41c8944 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 21:23:18 +0800 Subject: [PATCH 01/15] wip --- xmake/research.lua | 57 ++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/xmake/research.lua b/xmake/research.lua index 004537c58..7f686e1fd 100644 --- a/xmake/research.lua +++ b/xmake/research.lua @@ -301,34 +301,53 @@ end if is_mode("release") then xpack("research") do set_formats("nsis", "zip") - set_specfile(path.join(os.projectdir(), "packages/windows/research.nsis")) - set_specvar("PACKAGE_INSTALL_DIR", "XmacsLabs\\MoganResearch-"..XMACS_VERSION) - set_specvar("PACKAGE_NAME", "MoganResearch") - set_specvar("PACKAGE_SHORTCUT_NAME", "Mogan Research") + set_author("XmacsLabs") + set_license("GPLv3") + set_licensefile(path.join(os.projectdir(), "LICENSE")) + set_title("Mogan Research") + set_description("user friendly distribution of GNU TeXmacs") + set_homepage("https://mogan.app") + _, pos = string.find(XMACS_VERSION, "-") local XMACS_VERSION_XYZ= XMACS_VERSION if not (pos == nil) then XMACS_VERSION_XYZ= string.sub(XMACS_VERSION, 1, pos-1) end set_version(XMACS_VERSION_XYZ) - set_title("Mogan Research") - set_author("XmacsLabs") - set_description("user friendly distribution of GNU TeXmacs") - set_homepage("https://mogan.app") - set_license("GPLv3") - set_licensefile(path.join(os.projectdir(), "LICENSE")) + + if is_plat ("windows") then + set_specfile(path.join(os.projectdir(), "packages/windows/research.nsis")) + set_specvar("PACKAGE_INSTALL_DIR", "XmacsLabs\\MoganResearch-"..XMACS_VERSION) + set_specvar("PACKAGE_NAME", "MoganResearch") + set_specvar("PACKAGE_SHORTCUT_NAME", "Mogan Research") + set_iconfile(path.join(os.projectdir(), "packages/windows/Xmacs.ico")) + set_bindir("bin") + add_installfiles(path.join(os.projectdir(), "build/packages/app.mogan/data/bin/(**)|MoganResearch.exe"), {prefixdir = "bin"}) + end + + if is_plat ("linux") then + end + add_targets("research") - set_iconfile(path.join(os.projectdir(), "packages/windows/Xmacs.ico")) - set_bindir("bin") - add_installfiles(path.join(os.projectdir(), "build/packages/app.mogan/data/bin/(**)|MoganResearch.exe"), {prefixdir = "bin"}) - on_load(function (package) - local format = package:format() - if format == "nsis" then - package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-installer") + + if is_plat("linux") then + if package:with_source() then + package:set("basename", "goldfish-$(plat)-src-v$(version)") else - package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-portable") + package:set("basename", "goldfish-$(plat)-$(arch)-v$(version)") end - end) + end + + if is_plat("windows") then + on_load(function (package) + local format = package:format() + if format == "nsis" then + package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-installer") + else + package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-portable") + end + end) + end end end From 2d6b3362db32890e572c5c85c9fb526d0b73fbe1 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 21:23:36 +0800 Subject: [PATCH 02/15] wip --- xmake/research.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/research.lua b/xmake/research.lua index 7f686e1fd..45e2fac9c 100644 --- a/xmake/research.lua +++ b/xmake/research.lua @@ -300,7 +300,7 @@ end if is_mode("release") then xpack("research") do - set_formats("nsis", "zip") + set_formats("nsis", "zip", "deb") set_author("XmacsLabs") set_license("GPLv3") set_licensefile(path.join(os.projectdir(), "LICENSE")) From 77596d71c48103829075942665e4202a3d50afd5 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 21:25:16 +0800 Subject: [PATCH 03/15] wip --- xmake/research.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/xmake/research.lua b/xmake/research.lua index 45e2fac9c..cf646bd15 100644 --- a/xmake/research.lua +++ b/xmake/research.lua @@ -331,11 +331,13 @@ xpack("research") do add_targets("research") if is_plat("linux") then - if package:with_source() then - package:set("basename", "goldfish-$(plat)-src-v$(version)") - else - package:set("basename", "goldfish-$(plat)-$(arch)-v$(version)") - end + on_load(function (package) + if package:with_source() then + package:set("basename", "goldfish-$(plat)-src-v$(version)") + else + package:set("basename", "goldfish-$(plat)-$(arch)-v$(version)") + end + end) end if is_plat("windows") then From dd6ad36d080c266f837a4595f9b1a44f950c5fbe Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 22:15:19 +0800 Subject: [PATCH 04/15] wip --- xmake/debian/changelog.in | 4 ++++ xmake/debian/compat | 1 + xmake/debian/control.in | 24 ++++++++++++++++++++++++ xmake/debian/copyright | 17 +++++++++++++++++ xmake/debian/package.sh | 28 ++++++++++++++++++++++++++++ xmake/debian/rules | 26 ++++++++++++++++++++++++++ xmake/debian/source/format | 1 + xmake/research.lua | 3 ++- 8 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 xmake/debian/changelog.in create mode 100644 xmake/debian/compat create mode 100644 xmake/debian/control.in create mode 100644 xmake/debian/copyright create mode 100755 xmake/debian/package.sh create mode 100755 xmake/debian/rules create mode 100644 xmake/debian/source/format diff --git a/xmake/debian/changelog.in b/xmake/debian/changelog.in new file mode 100644 index 000000000..9d0b30927 --- /dev/null +++ b/xmake/debian/changelog.in @@ -0,0 +1,4 @@ +mogan-research (@DEVEL_VERSION@-@DEVEL_RELEASE@) unstable; urgency=low + + * Mogan Debian Package + -- Darcy Shen Sun, 01 Jan 2023 23:34:00 +0800 diff --git a/xmake/debian/compat b/xmake/debian/compat new file mode 100644 index 000000000..b1bd38b62 --- /dev/null +++ b/xmake/debian/compat @@ -0,0 +1 @@ +13 diff --git a/xmake/debian/control.in b/xmake/debian/control.in new file mode 100644 index 000000000..ac8787f71 --- /dev/null +++ b/xmake/debian/control.in @@ -0,0 +1,24 @@ +Source: mogan-research +Section: editors +Priority: optional +Maintainer: Darcy Shen +Build-Depends: debhelper (>= 7.0.50~) +Standards-Version: 3.9.1 +Homepage: https://mogan.app + +Package: mogan-research +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, qt6-qpa-plugins +Description: A structured editor for science and technology + Mogan Research is a fork of GNU TeXmacs using S7 Scheme and Qt 5 with massive + online TeXmacs documents provided by Xmacs Planet and TMML wiki. + The software includes a text editor with support for mathematical formulas, + a small technical picture editor and a tool for making presentations from + a laptop. Moreover, Mogan can be used as an interface for many external + systems for computer algebra, numerical analysis, statistics, etc. + New presentation styles can be written by the user and new features can be + added to the editor using the Scheme extension language. A native spreadsheet + and tools for collaborative authoring are planned for later. + Mogan runs on all major Unix platforms and Windows. Documents can be + saved in TeXmacs, Xml or Scheme format and printed as Postscript or + Pdf files. Converters exist for TeX/LaTeX and Html/Mathml. diff --git a/xmake/debian/copyright b/xmake/debian/copyright new file mode 100644 index 000000000..bb6330d37 --- /dev/null +++ b/xmake/debian/copyright @@ -0,0 +1,17 @@ +Author(s): + + +Upstream Author(s): + + + +Copyright: + + + +License: + + < GPL version 3> + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/xmake/debian/package.sh b/xmake/debian/package.sh new file mode 100755 index 000000000..acbffdd9e --- /dev/null +++ b/xmake/debian/package.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ -L ${BASH_SOURCE-$0} ]; then + FWDIR=$(dirname $(readlink "${BASH_SOURCE-$0}")) +else + FWDIR=$(dirname "${BASH_SOURCE-$0}") +fi + +APP_HOME="$(cd "${FWDIR}/../.."; pwd)" + +VERSION="1.2.9.7" + +ln -s $APP_HOME/packages/debian $APP_HOME/debian +cp $APP_HOME/debian/control.in $APP_HOME/debian/control +sed -e "s/@DEVEL_VERSION@/$VERSION/" -e "s/@DEVEL_RELEASE@/1/" \ + $APP_HOME/debian/changelog.in \ + > $APP_HOME/debian/changelog + +cd $APP_HOME +rm -rf $APP_HOME/TeXmacs/docs/tests +export INSTALL_DIR=$APP_HOME/debian/mogan-research/usr +dpkg-buildpackage -us -uc -b + +$APP_HOME/debian/rules clean +rm $APP_HOME/debian/changelog +rm $APP_HOME/debian/control +unlink $APP_HOME/debian + diff --git a/xmake/debian/rules b/xmake/debian/rules new file mode 100755 index 000000000..8f35edf3b --- /dev/null +++ b/xmake/debian/rules @@ -0,0 +1,26 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +%: + dh $@ --parallel + +override_dh_auto_configure: + xmake config -m release --yes --qt=/usr/lib/qt6 --root + +override_dh_auto_build: + xmake build --yes -vD --root research + +override_dh_auto_install: + xmake install --root research + +override_dh_dwz: + echo "Skip dh_dwz" + diff --git a/xmake/debian/source/format b/xmake/debian/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/xmake/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/xmake/research.lua b/xmake/research.lua index cf646bd15..10fddd408 100644 --- a/xmake/research.lua +++ b/xmake/research.lua @@ -325,7 +325,8 @@ xpack("research") do add_installfiles(path.join(os.projectdir(), "build/packages/app.mogan/data/bin/(**)|MoganResearch.exe"), {prefixdir = "bin"}) end - if is_plat ("linux") then + if is_plat ("linux") and linuxos.name() == "debian" then + set_specfile("debian") end add_targets("research") From 3922c1abcbd40e691534fb164229c69f715477df Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 22:19:12 +0800 Subject: [PATCH 05/15] wip --- xmake/debian/{changelog.in => changelog} | 2 +- xmake/debian/{control.in => control} | 0 xmake/debian/package.sh | 28 ------------------------ 3 files changed, 1 insertion(+), 29 deletions(-) rename xmake/debian/{changelog.in => changelog} (56%) rename xmake/debian/{control.in => control} (100%) delete mode 100755 xmake/debian/package.sh diff --git a/xmake/debian/changelog.in b/xmake/debian/changelog similarity index 56% rename from xmake/debian/changelog.in rename to xmake/debian/changelog index 9d0b30927..577bac413 100644 --- a/xmake/debian/changelog.in +++ b/xmake/debian/changelog @@ -1,4 +1,4 @@ -mogan-research (@DEVEL_VERSION@-@DEVEL_RELEASE@) unstable; urgency=low +mogan-research (1.2.9.7-1) unstable; urgency=low * Mogan Debian Package -- Darcy Shen Sun, 01 Jan 2023 23:34:00 +0800 diff --git a/xmake/debian/control.in b/xmake/debian/control similarity index 100% rename from xmake/debian/control.in rename to xmake/debian/control diff --git a/xmake/debian/package.sh b/xmake/debian/package.sh deleted file mode 100755 index acbffdd9e..000000000 --- a/xmake/debian/package.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -if [ -L ${BASH_SOURCE-$0} ]; then - FWDIR=$(dirname $(readlink "${BASH_SOURCE-$0}")) -else - FWDIR=$(dirname "${BASH_SOURCE-$0}") -fi - -APP_HOME="$(cd "${FWDIR}/../.."; pwd)" - -VERSION="1.2.9.7" - -ln -s $APP_HOME/packages/debian $APP_HOME/debian -cp $APP_HOME/debian/control.in $APP_HOME/debian/control -sed -e "s/@DEVEL_VERSION@/$VERSION/" -e "s/@DEVEL_RELEASE@/1/" \ - $APP_HOME/debian/changelog.in \ - > $APP_HOME/debian/changelog - -cd $APP_HOME -rm -rf $APP_HOME/TeXmacs/docs/tests -export INSTALL_DIR=$APP_HOME/debian/mogan-research/usr -dpkg-buildpackage -us -uc -b - -$APP_HOME/debian/rules clean -rm $APP_HOME/debian/changelog -rm $APP_HOME/debian/control -unlink $APP_HOME/debian - From 1248be5863950571232b6856a00c2aebd42c1a6a Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 22:22:22 +0800 Subject: [PATCH 06/15] wip --- xmake/debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmake/debian/rules b/xmake/debian/rules index 8f35edf3b..541ede272 100755 --- a/xmake/debian/rules +++ b/xmake/debian/rules @@ -13,13 +13,13 @@ export DH_VERBOSE=1 dh $@ --parallel override_dh_auto_configure: - xmake config -m release --yes --qt=/usr/lib/qt6 --root + xmake config -m release --yes --qt=/usr/lib/qt6 --vD --root override_dh_auto_build: xmake build --yes -vD --root research override_dh_auto_install: - xmake install --root research + xmake install --root -vD research override_dh_dwz: echo "Skip dh_dwz" From 2a15b6cc6f31cb08470bac046b87f36ff26e9e30 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 22:27:12 +0800 Subject: [PATCH 07/15] wip --- xmake/debian/rules | 70 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/xmake/debian/rules b/xmake/debian/rules index 541ede272..6431dbe90 100755 --- a/xmake/debian/rules +++ b/xmake/debian/rules @@ -1,26 +1,60 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. -# Uncomment this to turn on verbose mode. -export DH_VERBOSE=1 +#export DH_VERBOSE = 1 -%: - dh $@ --parallel +PREFIX=$(CURDIR)/debian/research/usr -override_dh_auto_configure: - xmake config -m release --yes --qt=/usr/lib/qt6 --vD --root +configure: configure-stamp +configure-stamp: + dh_testdir + touch configure-stamp -override_dh_auto_build: - xmake build --yes -vD --root research +build-arch: + # pass -override_dh_auto_install: - xmake install --root -vD research +build-indep: + # pass -override_dh_dwz: - echo "Skip dh_dwz" +build: build-stamp +build-stamp: configure-stamp + dh_testdir + xmake build -P . -y research --qt=/usr/lib/qt6 + touch $@ +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + dh_clean + +install: build + dh_testdir + dh_testroot + dh_installdirs + xmake install -P . -y -o $(PREFIX) research + +distclean: clean + +uninstall: + + +binary-indep: build install +# We have nothing to do by default. +# # Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install uninstall configure From 359728cfcfa99c4d94844345994f8e4e67d78fa1 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 22:32:18 +0800 Subject: [PATCH 08/15] wip --- xmake/debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/debian/rules b/xmake/debian/rules index 6431dbe90..037b36ce8 100755 --- a/xmake/debian/rules +++ b/xmake/debian/rules @@ -1,6 +1,6 @@ #!/usr/bin/make -f -#export DH_VERBOSE = 1 +export DH_VERBOSE = 1 PREFIX=$(CURDIR)/debian/research/usr From 92deaadaf2180dc46b4117392a42e3295eddf546 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 22:44:43 +0800 Subject: [PATCH 09/15] wp --- xmake/debian/changelog | 7 ++++--- xmake/debian/compat | 1 - xmake/debian/control | 2 +- xmake/research.lua | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 xmake/debian/compat diff --git a/xmake/debian/changelog b/xmake/debian/changelog index 577bac413..94e6cd1d2 100644 --- a/xmake/debian/changelog +++ b/xmake/debian/changelog @@ -1,4 +1,5 @@ -mogan-research (1.2.9.7-1) unstable; urgency=low +research (1.2.9.7-1) UNRELEASED; urgency=medium - * Mogan Debian Package - -- Darcy Shen Sun, 01 Jan 2023 23:34:00 +0800 + * Initial release (Closes: #nnnn) + + -- Darcy Shen Sun, 24 Nov 2024 14:35:24 +0000 diff --git a/xmake/debian/compat b/xmake/debian/compat deleted file mode 100644 index b1bd38b62..000000000 --- a/xmake/debian/compat +++ /dev/null @@ -1 +0,0 @@ -13 diff --git a/xmake/debian/control b/xmake/debian/control index ac8787f71..024d2258b 100644 --- a/xmake/debian/control +++ b/xmake/debian/control @@ -1,4 +1,4 @@ -Source: mogan-research +Source: research Section: editors Priority: optional Maintainer: Darcy Shen diff --git a/xmake/research.lua b/xmake/research.lua index 10fddd408..109c94a7c 100644 --- a/xmake/research.lua +++ b/xmake/research.lua @@ -301,7 +301,7 @@ end if is_mode("release") then xpack("research") do set_formats("nsis", "zip", "deb") - set_author("XmacsLabs") + set_author("Darcy Shen ") set_license("GPLv3") set_licensefile(path.join(os.projectdir(), "LICENSE")) set_title("Mogan Research") From 8846d47caea484bcab37bf6eb685f26e09b7deac Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 22:47:16 +0800 Subject: [PATCH 10/15] wip --- xmake/debian/control | 2 +- xmake/debian/rules | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xmake/debian/control b/xmake/debian/control index 024d2258b..3e4639537 100644 --- a/xmake/debian/control +++ b/xmake/debian/control @@ -2,7 +2,7 @@ Source: research Section: editors Priority: optional Maintainer: Darcy Shen -Build-Depends: debhelper (>= 7.0.50~) +Build-Depends: debhelper-compat (= 13) Standards-Version: 3.9.1 Homepage: https://mogan.app diff --git a/xmake/debian/rules b/xmake/debian/rules index 037b36ce8..7ff967b7f 100755 --- a/xmake/debian/rules +++ b/xmake/debian/rules @@ -18,7 +18,8 @@ build-indep: build: build-stamp build-stamp: configure-stamp dh_testdir - xmake build -P . -y research --qt=/usr/lib/qt6 + xmake config -m release --yes --qt=/usr/lib/qt6 --root + xmake build -P . -y research touch $@ clean: From f8042d834a945d790586f2e628bdf566aa16feed Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 22:49:33 +0800 Subject: [PATCH 11/15] wip --- xmake/debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/debian/rules b/xmake/debian/rules index 7ff967b7f..1eec7d63a 100755 --- a/xmake/debian/rules +++ b/xmake/debian/rules @@ -18,7 +18,7 @@ build-indep: build: build-stamp build-stamp: configure-stamp dh_testdir - xmake config -m release --yes --qt=/usr/lib/qt6 --root + xmake config -m release --yes --qt=/usr/lib/qt6 xmake build -P . -y research touch $@ From 9659a73cdc5e0992fda541ac6f504970578fd69a Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 23:43:57 +0800 Subject: [PATCH 12/15] wip --- xmake.lua | 63 ++++++++++++++++++++++++++++++++++++++++++++++ xmake/research.lua | 58 ------------------------------------------ 2 files changed, 63 insertions(+), 58 deletions(-) diff --git a/xmake.lua b/xmake.lua index ccb18bc59..58cbaddc7 100644 --- a/xmake.lua +++ b/xmake.lua @@ -276,6 +276,69 @@ end -- Mogan Research includes("xmake/research.lua") +if is_mode("release") then +xpack("research") do + set_formats("nsis", "zip", "deb", "rpm", "srpm") + if is_plat ("linux") and linuxos.name() == "debian" then + set_specfile("debian") + end + set_author("Darcy Shen ") + set_license("GPLv3") + set_licensefile(path.join(os.projectdir(), "LICENSE")) + set_title("Mogan Research") + set_description("user friendly distribution of GNU TeXmacs") + set_homepage("https://mogan.app") + + _, pos = string.find(XMACS_VERSION, "-") + local XMACS_VERSION_XYZ= XMACS_VERSION + if not (pos == nil) then + XMACS_VERSION_XYZ= string.sub(XMACS_VERSION, 1, pos-1) + end + set_version(XMACS_VERSION_XYZ) + + if is_plat ("windows") then + set_specfile(path.join(os.projectdir(), "packages/windows/research.nsis")) + set_specvar("PACKAGE_INSTALL_DIR", "XmacsLabs\\MoganResearch-"..XMACS_VERSION) + set_specvar("PACKAGE_NAME", "MoganResearch") + set_specvar("PACKAGE_SHORTCUT_NAME", "Mogan Research") + set_iconfile(path.join(os.projectdir(), "packages/windows/Xmacs.ico")) + set_bindir("bin") + add_installfiles(path.join(os.projectdir(), "build/packages/app.mogan/data/bin/(**)|MoganResearch.exe"), {prefixdir = "bin"}) + end + + add_targets("research") + + if is_plat ("linux") and linuxos.name() == "fedora" then + add_sourcefiles("(src/**)") + add_sourcefiles("(TeXmacs/**)") + add_sourcefiles("(xmake/**)") + add_sourcefiles("(tests/**)") + add_sourcefiles("xmake.lua") + end + + if is_plat("linux") + on_load(function (package) + if package:with_source() then + package:set("basename", "goldfish-$(plat)-src-v$(version)") + else + package:set("basename", "goldfish-$(plat)-$(arch)-v$(version)") + end + end) + end + + if is_plat("windows") then + on_load(function (package) + local format = package:format() + if format == "nsis" then + package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-installer") + else + package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-portable") + end + end) + end +end +end + -- Mogan Beamer if is_plat("macosx", "windows") then diff --git a/xmake/research.lua b/xmake/research.lua index 109c94a7c..e4f2e10b4 100644 --- a/xmake/research.lua +++ b/xmake/research.lua @@ -297,64 +297,6 @@ target("research") do end end - -if is_mode("release") then -xpack("research") do - set_formats("nsis", "zip", "deb") - set_author("Darcy Shen ") - set_license("GPLv3") - set_licensefile(path.join(os.projectdir(), "LICENSE")) - set_title("Mogan Research") - set_description("user friendly distribution of GNU TeXmacs") - set_homepage("https://mogan.app") - - _, pos = string.find(XMACS_VERSION, "-") - local XMACS_VERSION_XYZ= XMACS_VERSION - if not (pos == nil) then - XMACS_VERSION_XYZ= string.sub(XMACS_VERSION, 1, pos-1) - end - set_version(XMACS_VERSION_XYZ) - - if is_plat ("windows") then - set_specfile(path.join(os.projectdir(), "packages/windows/research.nsis")) - set_specvar("PACKAGE_INSTALL_DIR", "XmacsLabs\\MoganResearch-"..XMACS_VERSION) - set_specvar("PACKAGE_NAME", "MoganResearch") - set_specvar("PACKAGE_SHORTCUT_NAME", "Mogan Research") - set_iconfile(path.join(os.projectdir(), "packages/windows/Xmacs.ico")) - set_bindir("bin") - add_installfiles(path.join(os.projectdir(), "build/packages/app.mogan/data/bin/(**)|MoganResearch.exe"), {prefixdir = "bin"}) - end - - if is_plat ("linux") and linuxos.name() == "debian" then - set_specfile("debian") - end - - add_targets("research") - - if is_plat("linux") then - on_load(function (package) - if package:with_source() then - package:set("basename", "goldfish-$(plat)-src-v$(version)") - else - package:set("basename", "goldfish-$(plat)-$(arch)-v$(version)") - end - end) - end - - if is_plat("windows") then - on_load(function (package) - local format = package:format() - if format == "nsis" then - package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-installer") - else - package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-portable") - end - end) - end -end -end - - target("research_packager") do set_enabled(is_plat("macosx") and is_mode("release")) set_kind("phony") From 39dcaf512e3c8847afb899aa0954b9948f3a5188 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 23:49:31 +0800 Subject: [PATCH 13/15] wip --- .github/workflows/cd_research_on_fedora.yml | 48 +++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/cd_research_on_fedora.yml diff --git a/.github/workflows/cd_research_on_fedora.yml b/.github/workflows/cd_research_on_fedora.yml new file mode 100644 index 000000000..d579a60c0 --- /dev/null +++ b/.github/workflows/cd_research_on_fedora.yml @@ -0,0 +1,48 @@ +name: CD for Mogan Research on Debian bookworm +on: + workflow_dispatch: + push: + tags: + - '*' + +env: + XMAKE_ROOT: y + QT_QPA_PLATFORM: offscreen + INSTALL_DIR: tmp/build/packages/app.mogan/ + +jobs: + build: + container: fedora:41 + runs-on: ubuntu-22.04 + steps: + - name: Install dependencies + run: | + sudo dnf update -y + sudo dnf install -y git xmake unzip gcc g++ curl-devel libgit2-devel fontconfig-devel \ + qt6-qtbase-devel qt6-qtsvg-devel mimalloc-devel libpng-devel + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: set XMAKE_GLOBALDIR + run: echo "XMAKE_GLOBALDIR=/tmp/xmake-global" >> $GITHUB_ENV + + - name: Xrepo update + run: xmake repo --update + + - name: Generate Installer + run: | + QA_RPATHS=0x0001 xmake pack -vD -f rpm research + cp build/xpack/research/x86_64/*rpm mogan-research-v1.2.9.7-rc3-fedora41.rpm + - name: Upload + uses: actions/upload-artifact@v3 + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + with: + path: mogan-*.rpm + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + prerelease: true + files: mogan-*.rpm + From a67b0da3abc1ac778b79a8d2831f51058251a2c7 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 23:51:03 +0800 Subject: [PATCH 14/15] wip --- xmake.lua | 5 +--- xmake/debian/changelog | 5 ---- xmake/debian/control | 24 --------------- xmake/debian/copyright | 17 ----------- xmake/debian/rules | 61 -------------------------------------- xmake/debian/source/format | 1 - 6 files changed, 1 insertion(+), 112 deletions(-) delete mode 100644 xmake/debian/changelog delete mode 100644 xmake/debian/control delete mode 100644 xmake/debian/copyright delete mode 100755 xmake/debian/rules delete mode 100644 xmake/debian/source/format diff --git a/xmake.lua b/xmake.lua index 58cbaddc7..0e075c653 100644 --- a/xmake.lua +++ b/xmake.lua @@ -278,10 +278,7 @@ includes("xmake/research.lua") if is_mode("release") then xpack("research") do - set_formats("nsis", "zip", "deb", "rpm", "srpm") - if is_plat ("linux") and linuxos.name() == "debian" then - set_specfile("debian") - end + set_formats("nsis", "zip", "rpm", "srpm") set_author("Darcy Shen ") set_license("GPLv3") set_licensefile(path.join(os.projectdir(), "LICENSE")) diff --git a/xmake/debian/changelog b/xmake/debian/changelog deleted file mode 100644 index 94e6cd1d2..000000000 --- a/xmake/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -research (1.2.9.7-1) UNRELEASED; urgency=medium - - * Initial release (Closes: #nnnn) - - -- Darcy Shen Sun, 24 Nov 2024 14:35:24 +0000 diff --git a/xmake/debian/control b/xmake/debian/control deleted file mode 100644 index 3e4639537..000000000 --- a/xmake/debian/control +++ /dev/null @@ -1,24 +0,0 @@ -Source: research -Section: editors -Priority: optional -Maintainer: Darcy Shen -Build-Depends: debhelper-compat (= 13) -Standards-Version: 3.9.1 -Homepage: https://mogan.app - -Package: mogan-research -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, qt6-qpa-plugins -Description: A structured editor for science and technology - Mogan Research is a fork of GNU TeXmacs using S7 Scheme and Qt 5 with massive - online TeXmacs documents provided by Xmacs Planet and TMML wiki. - The software includes a text editor with support for mathematical formulas, - a small technical picture editor and a tool for making presentations from - a laptop. Moreover, Mogan can be used as an interface for many external - systems for computer algebra, numerical analysis, statistics, etc. - New presentation styles can be written by the user and new features can be - added to the editor using the Scheme extension language. A native spreadsheet - and tools for collaborative authoring are planned for later. - Mogan runs on all major Unix platforms and Windows. Documents can be - saved in TeXmacs, Xml or Scheme format and printed as Postscript or - Pdf files. Converters exist for TeX/LaTeX and Html/Mathml. diff --git a/xmake/debian/copyright b/xmake/debian/copyright deleted file mode 100644 index bb6330d37..000000000 --- a/xmake/debian/copyright +++ /dev/null @@ -1,17 +0,0 @@ -Author(s): - - -Upstream Author(s): - - - -Copyright: - - - -License: - - < GPL version 3> - -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. diff --git a/xmake/debian/rules b/xmake/debian/rules deleted file mode 100755 index 1eec7d63a..000000000 --- a/xmake/debian/rules +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/make -f - -export DH_VERBOSE = 1 - -PREFIX=$(CURDIR)/debian/research/usr - -configure: configure-stamp -configure-stamp: - dh_testdir - touch configure-stamp - -build-arch: - # pass - -build-indep: - # pass - -build: build-stamp -build-stamp: configure-stamp - dh_testdir - xmake config -m release --yes --qt=/usr/lib/qt6 - xmake build -P . -y research - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - dh_clean - -install: build - dh_testdir - dh_testroot - dh_installdirs - xmake install -P . -y -o $(PREFIX) research - -distclean: clean - -uninstall: - - -binary-indep: build install -# We have nothing to do by default. -# # Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installdocs - dh_installexamples - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install uninstall configure diff --git a/xmake/debian/source/format b/xmake/debian/source/format deleted file mode 100644 index 163aaf8d8..000000000 --- a/xmake/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) From 4098e262e464c81e6f3feda8cde4af8b540a48b2 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Sun, 24 Nov 2024 23:52:07 +0800 Subject: [PATCH 15/15] wip --- xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake.lua b/xmake.lua index 0e075c653..aafbb0c09 100644 --- a/xmake.lua +++ b/xmake.lua @@ -313,7 +313,7 @@ xpack("research") do add_sourcefiles("xmake.lua") end - if is_plat("linux") + if is_plat("linux") then on_load(function (package) if package:with_source() then package:set("basename", "goldfish-$(plat)-src-v$(version)")