Skip to content

Commit

Permalink
[73_24] xpack for rpm
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii authored Nov 24, 2024
1 parent 3d24765 commit 07919a6
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 36 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/cd_research_on_fedora.yml
Original file line number Diff line number Diff line change
@@ -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

60 changes: 60 additions & 0 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,66 @@ end
-- Mogan Research
includes("xmake/research.lua")

if is_mode("release") then
xpack("research") do
set_formats("nsis", "zip", "rpm", "srpm")
set_author("Darcy Shen <[email protected]>")
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") 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


-- Mogan Beamer
if is_plat("macosx", "windows") then
Expand Down
36 changes: 0 additions & 36 deletions xmake/research.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,42 +297,6 @@ target("research") do
end
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")
_, 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"))
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")
else
package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-portable")
end
end)
end
end


target("research_packager") do
set_enabled(is_plat("macosx") and is_mode("release"))
set_kind("phony")
Expand Down

0 comments on commit 07919a6

Please sign in to comment.