summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCoprDistGit <copr-devel@lists.fedorahosted.org>2023-11-18 22:12:05 +0000
committerCoprDistGit <copr-devel@lists.fedorahosted.org>2023-11-18 22:12:05 +0000
commit8944ec250b99331a8b08039e3ac4dcdff46e0538 (patch)
tree8d250989520c97c13608ae4d1b0b66c382ceb5b4
parentda71001a97464506998a7850ad3ff8bae3a82a8e (diff)
automatic import of xmakeHEADmasterf39f38
-rw-r--r--.gitignore1
-rw-r--r--0001-add-relwithdebinfo-build-mode.patch14
-rw-r--r--0001-fix-deps.patch91
-rw-r--r--0001-pkgconfig-fix-check.patch31
-rw-r--r--0001-system-include.patch26
-rw-r--r--sources2
-rw-r--r--xmake.spec118
7 files changed, 151 insertions, 132 deletions
diff --git a/.gitignore b/.gitignore
index 85c223c..c27fd07 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/xmake-v2.8.5.tar.gz
+/xmake-2.8.5.tar.gz
diff --git a/0001-add-relwithdebinfo-build-mode.patch b/0001-add-relwithdebinfo-build-mode.patch
new file mode 100644
index 0000000..1d2d7e5
--- /dev/null
+++ b/0001-add-relwithdebinfo-build-mode.patch
@@ -0,0 +1,14 @@
+diff --git a/core/xmake.sh b/core/xmake.sh
+index b21e34efe..69b2b3c3e 100755
+--- a/core/xmake.sh
++++ b/core/xmake.sh
+@@ -21,6 +21,9 @@ fi
+ if is_mode "debug"; then
+ set_symbols "debug"
+ set_optimizes "none"
++elif is_mode "relwithdebinfo"; then
++ set_symbols "debug"
++ set_optimizes "faster" # -O2
+ else
+ set_strip "all"
+ if ! is_kind "shared"; then
diff --git a/0001-fix-deps.patch b/0001-fix-deps.patch
deleted file mode 100644
index 7dc3986..0000000
--- a/0001-fix-deps.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-diff --git a/core/src/xmake/hash/xxhash.c b/core/src/xmake/hash/xxhash.c
-index 9901f58f6..ef523c2d9 100644
---- a/core/src/xmake/hash/xxhash.c
-+++ b/core/src/xmake/hash/xxhash.c
-@@ -32,7 +32,7 @@
- #define XXH_NAMESPACE XM_
- #define XXH_STATIC_LINKING_ONLY
- #define XXH_IMPLEMENTATION
--#include "xxhash/xxhash.h"
-+#include "xxhash.h"
-
- /* //////////////////////////////////////////////////////////////////////////////////////
- * implementation
-diff --git a/core/src/xmake/semver/prefix.h b/core/src/xmake/semver/prefix.h
-index 2112d73f1..9077b49ca 100644
---- a/core/src/xmake/semver/prefix.h
-+++ b/core/src/xmake/semver/prefix.h
-@@ -25,7 +25,7 @@
- * includes
- */
- #include "../prefix.h"
--#include "semver.h"
-+#include "sv/semver.h"
-
- /* //////////////////////////////////////////////////////////////////////////////////////
- * extern
-diff --git a/core/src/xmake/xmake.sh b/core/src/xmake/xmake.sh
-index a813cf078..ce4b6c296 100755
---- a/core/src/xmake/xmake.sh
-+++ b/core/src/xmake/xmake.sh
-@@ -6,6 +6,7 @@ target "xmake"
-
- # add deps
- if has_config "external"; then
-+ add_deps "tbox"
- local libs="lz4 sv tbox"
- for lib in $libs; do
- if has_config "$lib"; then
-diff --git a/core/xmake.sh b/core/xmake.sh
-index b21e34efe..277647fdc 100755
---- a/core/xmake.sh
-+++ b/core/xmake.sh
-@@ -87,8 +87,8 @@ option_find_lua() {
- local ldflags=""
- local cflags=""
- option "lua"
-- cflags=`pkg-config --cflags lua5.4 2>/dev/null`
-- ldflags=`pkg-config --libs lua5.4 2>/dev/null`
-+ cflags=`pkg-config --cflags lua 2>/dev/null`
-+ ldflags=`pkg-config --libs lua 2>/dev/null`
- if test_z "${cflags}"; then
- cflags="-I/usr/include/lua5.4"
- fi
-@@ -164,7 +164,7 @@ option_find_sv() {
- cflags=`pkg-config --cflags libsv 2>/dev/null`
- ldflags=`pkg-config --libs libsv 2>/dev/null`
- if test_z "${cflags}"; then
-- cflags="-I/usr/include"
-+ cflags="-I/usr/include/sv"
- fi
- if test_z "${ldflags}"; then
- ldflags="-lsv"
-@@ -204,16 +204,17 @@ option_find_tbox() {
- }
-
- # add projects
--if ! has_config "external"; then
-- if is_config "runtime" "luajit"; then
-- includes "src/luajit"
-- else
-- includes "src/lua"
-- fi
-- includes "src/lua-cjson"
-- includes "src/lz4"
-- includes "src/sv"
-- includes "src/tbox"
--fi
-+# if ! has_config "external"; then
-+# if is_config "runtime" "luajit"; then
-+# includes "src/luajit"
-+# else
-+# includes "src/lua"
-+# fi
-+# includes "src/lua-cjson"
-+# includes "src/lz4"
-+# includes "src/sv"
-+# includes "src/tbox"
-+# fi
-+includes "src/tbox"
- includes "src/xmake"
- includes "src/demo"
diff --git a/0001-pkgconfig-fix-check.patch b/0001-pkgconfig-fix-check.patch
new file mode 100644
index 0000000..094b76e
--- /dev/null
+++ b/0001-pkgconfig-fix-check.patch
@@ -0,0 +1,31 @@
+diff --git a/core/xmake.sh b/core/xmake.sh
+index b21e34efe..f391618de 100755
+--- a/core/xmake.sh
++++ b/core/xmake.sh
+@@ -87,13 +87,13 @@ option_find_lua() {
+ local ldflags=""
+ local cflags=""
+ option "lua"
+- cflags=`pkg-config --cflags lua5.4 2>/dev/null`
+- ldflags=`pkg-config --libs lua5.4 2>/dev/null`
++ cflags=`pkg-config --cflags lua 2>/dev/null`
++ ldflags=`pkg-config --libs lua 2>/dev/null`
+ if test_z "${cflags}"; then
+- cflags="-I/usr/include/lua5.4"
++ cflags="-I/usr/include"
+ fi
+ if test_z "${ldflags}"; then
+- ldflags="-llua5.4"
++ ldflags="-llua"
+ fi
+ add_cflags "${cflags}"
+ add_ldflags "${ldflags}"
+@@ -152,7 +152,7 @@ option_find_lz4() {
+ # the sv option
+ option "sv"
+ add_cfuncs "semver_tryn"
+- add_cincludes "semver.h"
++ add_cincludes "sv/semver.h"
+ add_links "sv"
+ before_check "option_find_sv"
+ option_end
diff --git a/0001-system-include.patch b/0001-system-include.patch
new file mode 100644
index 0000000..2d89037
--- /dev/null
+++ b/0001-system-include.patch
@@ -0,0 +1,26 @@
+diff --git a/core/src/xmake/hash/xxhash.c b/core/src/xmake/hash/xxhash.c
+index 9901f58f6..ef523c2d9 100644
+--- a/core/src/xmake/hash/xxhash.c
++++ b/core/src/xmake/hash/xxhash.c
+@@ -32,7 +32,7 @@
+ #define XXH_NAMESPACE XM_
+ #define XXH_STATIC_LINKING_ONLY
+ #define XXH_IMPLEMENTATION
+-#include "xxhash/xxhash.h"
++#include "xxhash.h"
+
+ /* //////////////////////////////////////////////////////////////////////////////////////
+ * implementation
+diff --git a/core/src/xmake/semver/prefix.h b/core/src/xmake/semver/prefix.h
+index 2112d73f1..9077b49ca 100644
+--- a/core/src/xmake/semver/prefix.h
++++ b/core/src/xmake/semver/prefix.h
+@@ -25,7 +25,7 @@
+ * includes
+ */
+ #include "../prefix.h"
+-#include "semver.h"
++#include "sv/semver.h"
+
+ /* //////////////////////////////////////////////////////////////////////////////////////
+ * extern
diff --git a/sources b/sources
index c60097f..4ec44db 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-afc7f8682576bd15cd950e6fbf6f998a xmake-v2.8.5.tar.gz
+21e0ded584af0e51dfa43bb6a3529d5c xmake-2.8.5.tar.gz
diff --git a/xmake.spec b/xmake.spec
index cc8fa2c..3c0d906 100644
--- a/xmake.spec
+++ b/xmake.spec
@@ -1,45 +1,78 @@
-%global debug_package %{nil}
-%global use_luajit 0
+%bcond_with luajit
-Name: xmake
-Version: 2.8.5
-Release: %autorelease
-Summary: A cross-platform build utility based on Lua
+Name: xmake
+Version: 2.8.5
-# Xmake is under Apache-2.0 license, except the bundled libraries:
-# tbox - Apache-2.0 AND BSL-1.0 AND Zlib
+%global forgeurl https://github.com/xmake-io/xmake
-License: Apache-2.0 AND BSL-1.0 AND Zlib
-URL: https://xmake.io
-Source0: https://github.com/xmake-io/xmake/releases/download/v%{version}/%{name}-v%{version}.tar.gz
-Patch0: 0001-fix-deps.patch
+%forgemeta
+
+Release: %autorelease
+Summary: A cross-platform build utility based on Lua
+
+License: Apache-2.0
+URL: https://xmake.io
+Source: %forgesource
+
+Patch0: 0001-pkgconfig-fix-check.patch
+Patch1: 0001-system-include.patch
+Patch2: 0001-add-relwithdebinfo-build-mode.patch
-BuildRequires: gcc
-BuildRequires: make
BuildRequires: pkgconfig(ncurses)
+BuildRequires: pkgconfig(readline)
BuildRequires: pkgconfig(liblz4)
-BuildRequires: pkgconfig(libsv)
BuildRequires: pkgconfig(libxxhash)
-%if %{use_luajit}
+BuildRequires: pkgconfig(libtbox)
+BuildRequires: pkgconfig(libsv)
+%if %{with luajit}
BuildRequires: pkgconfig(luajit)
%else
-BuildRequires: pkgconfig(lua)
+BuildRequires: pkgconfig(lua) >= 5.4
%endif
+BuildRequires: pkgconfig(libtbox)
-Provides: bundled(tbox)
+BuildRequires: bash
+BuildRequires: sed
+BuildRequires: make
+BuildRequires: gcc
+BuildRequires: gcc-c++
+
+Requires: %{name}-data = %{version}-%{release}
%description
-%{summary}.
+xmake is a lightweight cross-platform build utility based on Lua.
+
+It uses xmake.lua to maintain project builds. Compared with
+makefile/CMakeLists.txt, the configuration syntax is more concise and
+intuitive. It is very friendly to novices and can quickly get started in
+a short time. Let users focus more on actual project development.
+
+It can compile the project directly like Make/Ninja, or generate project
+files like CMake/Meson, and it also has a built-in package management
+system to help users solve the integrated use of C/C++ dependent
+libraries.
+
+%package data
+Summary: Common data-files for %{name}
+Requires: %{name} = %{version}-%{release}
+BuildArch: noarch
+
+%description data
+This package contains common data-files for %{name}.
%prep
-%autosetup -p1
+%forgeautosetup -p1
+
+# Cleanup bundled deps
+rm -rf core/src/{lua,luajit,lua-cjson,lz4,pdcurses,sv,tbox,xxhash}/*/
-rm -rf core/src/{lua,luajit,lua-cjson,lz4,pdcurses,sv,xxhash}/
+# Fix shebang since the configure script is not strictly POSIX sh
+# and relies on bash-specific behavior
+sed -i '1 s|#!/bin/sh|#!/bin/bash|' %{_configure}
%build
-%configure --external=yes \
- --mode=release \
-%if %{use_luajit}
+%configure --external=yes --mode=relwithdebinfo \
+%if %{with luajit}
--runtime=luajit
%else
--runtime=lua
@@ -49,32 +82,37 @@ rm -rf core/src/{lua,luajit,lua-cjson,lz4,pdcurses,sv,xxhash}/
%install
mkdir -p %{buildroot}%{_mandir}/man1/
-install -Dpm0755 build/xmake %{buildroot}%{_bindir}/xmake
-install -Dpm0755 scripts/xrepo.sh %{buildroot}%{_bindir}/xrepo
-install -Dpm0644 scripts/man/*1 %{buildroot}%{_mandir}/man1/
-
+install -Dpm0755 build/xmake \
+ %{buildroot}%{_bindir}/%{name}
+install -Dpm0755 scripts/xrepo.sh \
+ %{buildroot}%{_bindir}/xrepo
+install -Dpm0644 scripts/man/*1 \
+ %{buildroot}%{_mandir}/man1/
install -Dpm0644 xmake/scripts/completions/register-completions.bash \
- %{buildroot}%{bash_completions_dir}/xmake
+ %{buildroot}%{bash_completions_dir}/%{name}
install -Dpm0644 xmake/scripts/completions/register-completions.fish \
- %{buildroot}%{fish_completions_dir}/xmake.fish
+ %{buildroot}%{fish_completions_dir}/%{name}.fish
install -Dpm0644 xmake/scripts/completions/register-completions.zsh \
- %{buildroot}%{zsh_completions_dir}/_xmake
-cp -r xmake/ %{buildroot}%{_datadir}/xmake
+ %{buildroot}%{zsh_completions_dir}/_%{name}
+cp -rp xmake \
+ %{buildroot}%{_datadir}/%{name}
%check
-%{buildroot}%{_bindir}/xmake --version
+%{buildroot}%{_bindir}/%{name} --version
%{buildroot}%{_bindir}/xrepo --version
%files
%doc README.md CHANGELOG.md
-%license LICENSE.md
-%{_bindir}/xmake
+%license LICENSE.md NOTICE.md
+%{_bindir}/%{name}
%{_bindir}/xrepo
-%{_datadir}/xmake
-%{_mandir}/man1/*
-%{bash_completions_dir}/xmake
-%{zsh_completions_dir}/_xmake
-%{fish_completions_dir}/xmake.fish
+%{bash_completions_dir}/%{name}
+%{zsh_completions_dir}/_%{name}
+%{fish_completions_dir}/%{name}.fish
+%{_mandir}/man1/*.1*
+
+%files data
+%{_datadir}/%{name}
%changelog
%autochangelog